-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH add partial_fit to NearestCentroid #19262
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
Conversation
…ors.nearest_centroid')
Hi @aerodynamic-saucepan some tests are still failing. There is a docstring failure that you can check locally using
Other failures are accessible via this link. Let us know if you need some help to solve them. |
Hi @cmarmo , thank you for the help. |
Azure run the test suite on different architectures (32/64 bit) and python environments.
will reproduce the issue locally. |
…ier_data_not_an_array]'
I apologize for the inconvenience, but I accidentally closed the PR by misinterpreting a 'Close with comment' button for closing a comment, when it actually means closing the PR with the comment as final.. I re-opened it right away but it seems now the references for the CI pipeline are broken : (from circleci) fatal: Couldn't find remote ref refs/pull/19262/merge
error: pathspec 'pr/19262/merge' did not match any file(s) known to git
Could not fetch merge commit.
There may be conflicts in merging PR #19262 with main. I would appreciate some advice to avoid breaking it any further. |
Hi @aerodynamic-saucepan , apparently you created your branch before the renaming of the main branch in upstream. You still have some references to master and this breaks the checks. Sychronising with upstream will solve the issue. |
Sorry I misread... there is no issue with renaming
Conflicts are the reason of the failing checks. |
Sorry, something went wrong.
But conflicts arise when attempting to merge with main right ? And this PR isn't ready to be merged, yet wouldn't attempting to resolve merge conflicts lead to a merge request on main ? |
Right: but every time there is a commit to an open pull request some checks are run (this is called Continuous Integration , CI) to verify that your pull request does not contain conflicting commits with respect to the base branch, let's say that a merge is simulated at each commit. If there is such a conflict the build checks are not run. You might not want main and your branch conflict too much during the review process, otherwise the merging step will be painful. You will find more information about that on the github documentation about conflicts. |
@aerodynamic-saucepan Could you solve the conflict such that we can make an appropriate review? |
Hey 👋🏻 |
Hello @Valentin-Laurent, are you still working on a related PR? |
Hello @ArturoAmorQ, I was waiting for PR #24083 to be reviewed before starting to work on implementing partial fit. Why? |
Reference Issues/PRs
Adresses issue #12952 and @Robinspecteur 's PR #13033
What does this implement/fix? Explain your changes.
Implements the partial_fit method and the associated tests from PR #13033 while taking into account the comments that were never addressed.
To summarize :
Done
@jnothman comments :
deepcopy()
has been replaced by.copy()
true_classes_
attribute has been documentedtest_partial_fit()
insklearn/neighbors/tests/test_nearest_centroid.py
has been removed.The author of PR Partial centroid #13033 seems to have wanted to add an example of values for which the predicted classes were already correctly guessed partway through the partial_fit process and thus equal to the predicted classes by the end of the complete fit.
test_partial_fit
now checks the predicted classes ofpartial_fit
againstfit
@dirkpadfield comments :
deepcopy()
(which were replaced by.copy()
) were inserted inside aif self.shrink_threshold
condition.They could not be move under the original
if self.shrink_threshold
line 228 (now 230) due to tests failing because the value recovered from the class attributes wouldn't be the same due to thefor
loop line 195 (now 200)warning
has been relocated under theif _refit or _check_partial_fit_first_call(self, classes)
condition line 173 (now 171)To do
Any other comments?
I ran Flake8 and pytest locally to ensure the CI passes, but that is about as many tools as I can run on my machine, I'm not 100% sure about the other scikit-learn's repo automatic checking tools.