Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add decision function method for stacking classifiers #634

Merged
merged 6 commits into from
Dec 7, 2019

Conversation

qiagu
Copy link
Contributor

@qiagu qiagu commented Nov 24, 2019

Description

Related issues or pull requests

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

@pep8speaks
Copy link

pep8speaks commented Nov 24, 2019

Hello @qiagu! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 555:1: W293 blank line contains whitespace

Line 599:1: W293 blank line contains whitespace

Comment last updated at 2019-12-07 19:18:05 UTC

@qiagu
Copy link
Contributor Author

qiagu commented Nov 25, 2019

The roc_auc score calculated in scikit-learn v0.20.3 is different from the one in v0.21.3. I couldn't figure out what parameter caused the discrepancy.

@coveralls
Copy link

coveralls commented Nov 25, 2019

Coverage Status

Coverage decreased (-0.005%) to 92.349% when pulling d4b550f on qiagu:stacking into 9cb5f6c on rasbt:master.

@rasbt
Copy link
Owner

rasbt commented Nov 25, 2019

Thanks for the PR. Looks pretty good so far!

Regarding

The roc_auc score calculated in scikit-learn v0.20.3 is different from the one in v0.21.3. I couldn't figure out what parameter caused the discrepancy.

I found this in the changelog (https://scikit-learn.org/dev/whats_new/v0.21.html#sklearn-svm):

Screen Shot 2019-11-24 at 9 58 11 PM

Maybe you can

  1. add a new test for SVC(... decision_function_shape='ovo')
  2. change the current test such that it only runs in sklearn > 0.21.3

E.g.,

from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version
...

def test ...():
    # test code
    if Version(sklearn_version) > Version("0.21.3"):
        assert ...
    else:
        assert ...

@qiagu
Copy link
Contributor Author

qiagu commented Nov 25, 2019

@rasbt Thanks. Your suggestion always makes the most sense. I stop trying other things.

@qiagu
Copy link
Contributor Author

qiagu commented Nov 25, 2019

@rasbt Do we need to care about the minor decrease of test coverage?

@rasbt
Copy link
Owner

rasbt commented Nov 27, 2019

@rasbt Do we need to care about the minor decrease of test coverage?

No worries, that's fine. The change is so small that it is basically non-existent. I am currently a bit swamped with deadlines but let me go over the code again carefully on the upcoming weekend. Thanks for the PR so far!

@rasbt
Copy link
Owner

rasbt commented Dec 7, 2019

Looks great! I just added some examples to the jupyter notebook. Once the test passed, it should be good to merge. Many thanks!

@rasbt rasbt merged commit aa47008 into rasbt:master Dec 7, 2019
@qiagu
Copy link
Contributor Author

qiagu commented Dec 8, 2019

Thanks for merging. @rasbt

@rasbt rasbt mentioned this pull request Jan 29, 2020
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.

None yet

4 participants