Skip to content

Conversation

dhruvi003
Copy link

Code of Conduct

Description

This pull request introduces a new method parameter to the counterfactual() function in mlxtend.evaluate.counterfactual, allowing users to specify the optimization algorithm used by scipy.optimize.minimize. Previously, the method was hardcoded to 'Nelder-Mead', which limited flexibility in choosing solvers that may perform better for different problem types.

By default, the method remains 'Nelder-Mead' to preserve backward compatibility. Users can now pass other valid methods like 'Powell', 'CG', or 'BFGS' for experimentation or improved convergence.

Related issues or pull requests

Fixes #1029

Pull Request Checklist

  • [✔️] Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • Added appropriate unit test functions in the ./mlxtend/*/tests directories (if applicable)
  • Modify documentation in the corresponding Jupyter Notebook under mlxtend/docs/sources/ (if applicable)
  • [✔️] Ran PYTHONPATH='.' pytest ./mlxtend -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., PYTHONPATH='.' pytest ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)
  • [✔️] Checked for style issues by running flake8 ./mlxtend

I'm a beginner and this is one of my first contributions to an open-source project. I’ve tried to follow the contribution guidelines carefully, but I’d really appreciate any feedback, suggestions, or guidance to improve. Thank you for the opportunity!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create_counterfactual enhancements (minimization method and fixed features)
1 participant