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

Misc fixes for default-constructibility of our learners #144

Merged
merged 6 commits into from
Jul 1, 2020

Conversation

timokau
Copy link
Collaborator

@timokau timokau commented Jul 1, 2020

Description

Pulling out the changes of #116 that are ready for merge now. As I said in #116 (comment), this brings us very close to passing the "default-constructible" test. I think/hope that will be the highest hurdle for sklearn api compatibility.

Outstanding issues are the kernel-regularizers and scikit-learn/scikit-learn#17756.

Motivation and Context

See #116.

How Has This Been Tested?

Linters & tests.

Does this close/impact existing issues?

Impacts #116, but doesn't close it.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

That will give some of the scikit-learn estimator API (such as
set_params and get_params) for free.
@timokau timokau requested a review from kiudee July 1, 2020 13:55
@timokau
Copy link
Collaborator Author

timokau commented Jul 1, 2020

Removing the regularizer default overrides is a small breaking change (analogous to #142).

@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #144 into master will increase coverage by 0.03%.
The diff coverage is 70.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   60.08%   60.11%   +0.03%     
==========================================
  Files         116      116              
  Lines        7662     7668       +6     
==========================================
+ Hits         4604     4610       +6     
  Misses       3058     3058              
Impacted Files Coverage Δ
csrank/choicefunction/cmpnet_choice.py 84.78% <ø> (ø)
csrank/choicefunction/fate_choice.py 91.30% <ø> (ø)
csrank/choicefunction/ranknet_choice.py 81.63% <ø> (ø)
csrank/core/cmpnet_core.py 89.28% <ø> (ø)
csrank/core/fate_network.py 69.19% <ø> (ø)
csrank/core/feta_linear.py 92.24% <ø> (ø)
csrank/core/ranknet_core.py 88.69% <ø> (ø)
csrank/discretechoice/cmpnet_discrete_choice.py 86.84% <ø> (ø)
csrank/discretechoice/fate_discrete_choice.py 94.44% <ø> (ø)
csrank/discretechoice/ranknet_discrete_choice.py 84.61% <ø> (ø)
... and 14 more

@timokau
Copy link
Collaborator Author

timokau commented Jul 1, 2020

Code coverage is only decreasing because of the black changes and doc additions.

Copy link
Owner

@kiudee kiudee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found only a few minor spelling mistakes and wording problems.
Otherwise it looks good to merge.

csrank/core/feta_linear.py Outdated Show resolved Hide resolved
csrank/core/feta_linear.py Outdated Show resolved Hide resolved
csrank/core/feta_linear.py Outdated Show resolved Hide resolved
Tuples are immutable and the scikit-learn estimator API requires
estimator parameters to be immutable (to make cloning work properly).
Since we do not use the parameters in a mutable way, this doesn't make a
difference.
Scikit-learn requires unmodified storage of estimator parameters.
Instead, parameter validation and initialization should be deferred to
fit, which we do here by moving it into the model creation.
Scikit-learn mandates that all estimator arguments should be stored in
an instance attribute of the same name.
@timokau timokau force-pushed the misc-default-constructible branch from 62474a1 to 217c838 Compare July 1, 2020 16:23
@timokau
Copy link
Collaborator Author

timokau commented Jul 1, 2020

Thanks for the feedback, I addressed all your comments. Please have another look.

@timokau timokau merged commit 194dac8 into kiudee:master Jul 1, 2020
@timokau timokau deleted the misc-default-constructible branch July 1, 2020 17:20
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.

2 participants