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

[python] Re-enable scikit-learn 0.22+ support #2949

Merged
merged 8 commits into from
Apr 10, 2020
Merged

Conversation

StrikerRUS
Copy link
Collaborator

Skip failing check_no_attributes_set_in_init test, refer to #2628 (comment).

Minor refactoring to pass new check_sample_weights_not_an_array test.

Reverted #2637. Fixed #2628. Closed #2946.

.ci/test.sh Outdated Show resolved Hide resolved
@StrikerRUS
Copy link
Collaborator Author

@jameslamb Can you please help with failing R test on macOS?

Installing packages into ‘/Users/travis/Rlib’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
   packages ‘data.table’, ‘jsonlite’, ‘Matrix’, ‘R6’, ‘testthat’ are available as source packages but not as binaries
Warning message:
packages ‘data.table’, ‘jsonlite’, ‘Matrix’, ‘R6’, ‘testthat’ are not available (as a binary package for R version 3.6.1) 

This reverts commit 8b4db08.
@StrikerRUS
Copy link
Collaborator Author

@jameslamb I tried to change CRAN repo
echo 'options(repos = "https://cran.rstudio.com")' > ${HOME}/.Rprofile -> echo 'options(repos = "https://cloud.r-project.org")' > ${HOME}/.Rprofile

The same error:

Installing packages into ‘/Users/travis/Rlib’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
   packages ‘data.table’, ‘jsonlite’, ‘Matrix’, ‘R6’, ‘testthat’ are available as source packages but not as binaries
Warning message:
packages ‘data.table’, ‘jsonlite’, ‘Matrix’, ‘R6’, ‘testthat’ are not available (as a binary package for R version 3.6.1) 

@jameslamb
Copy link
Collaborator

@jameslamb I tried to change CRAN repo
echo 'options(repos = "https://cran.rstudio.com")' > ${HOME}/.Rprofile -> echo 'options(repos = "https://cloud.r-project.org")' > ${HOME}/.Rprofile

The same error:

Installing packages into ‘/Users/travis/Rlib’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
   packages ‘data.table’, ‘jsonlite’, ‘Matrix’, ‘R6’, ‘testthat’ are available as source packages but not as binaries
Warning message:
packages ‘data.table’, ‘jsonlite’, ‘Matrix’, ‘R6’, ‘testthat’ are not available (as a binary package for R version 3.6.1) 

looking right now

@jameslamb
Copy link
Collaborator

If you rebase to master, to get the changes from #2954 , the R test issues should be resolved.

@StrikerRUS
Copy link
Collaborator Author

@henry0312 Please take a look when have time

@henry0312
Copy link
Contributor

Sure, I'm going to check tomorrow

@@ -276,7 +276,7 @@ def run(self):
install_requires=[
'numpy',
'scipy',
'scikit-learn<=0.21.3'
'scikit-learn!=0.22.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

is this 'scikit-learn~=0.22,!=0.22.0'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, I can't find ~ in the setuptools docs. Can you please clarify what do you mean?

A version specifier is one of the operators <, >, <=, >=, == or !=, followed by a version identifier.
https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-dependencies

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. I guess that this specifier is not compatible with setuptools as it is not listed there, is it?

Also, why do we need it? We are compatible with all (reasonable) versions except 0.22.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ping @henry0312

Copy link
Collaborator Author

@StrikerRUS StrikerRUS Apr 8, 2020

Choose a reason for hiding this comment

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

@henry0312

though I don't think the policy is common in software engineering.

It's kind of debatable statements. And I don't think that this PR is a good place to discuss it. I think we should create a separate issue where we should at least get opinions of other maintainers before changing the current policy.

we should check its compatibility and will add suuport of it in series.

In ideal situation, yes! You are absolutely right! But given that we are lacking human resources to do it in time, I suppose that it will be simply abandoned in the near future. Which will result in very old dependencies of LightGBM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unless you're ready to release a new version of LightGBM every time a new minor version or patch for a dependency is released, of course.

Absolutely agree! It is definitely not our case when only 2-3 maintainers work actively at the same time.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ekerazha @StrikerRUS I don't mean all of the future versions wont' be allowed, but only the future versions that can breaks backward compatibility (in other words, a release changes major version), which version specifiers (i.e. scikit-learn~=0.22,!=0.22.0 or scikit-learn>=0.22, == 0.*) realizes.
And is LightGBM an almost end-user products? I think so.

I don't think sklearn is following SemVer.

oh, really...? Actually, I'm not sure.

Copy link

@ekerazha ekerazha Apr 8, 2020

Choose a reason for hiding this comment

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

@henry0312

And is LightGBM an almost end-user products? I think so.

LightGBM is a library, a travel website which uses LightGBM to recommend travels would be the end-user product.

oh, really...? Actually, I'm not sure.

scikit-learn had breaking API changes in minor versions, so it's not following SemVer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@henry0312 I guess 0.22 is a minor release, but it broke backward compatibility.

Again, please let's move all our discussion to a separate issue where everyone will be able to comment. It's very hard to find it here and I want to merge this PR ASAP to enable the latest scikit-learn support.

@henry0312
Copy link
Contributor

By the way, why is there the same (similar?) PR, #2946?

@StrikerRUS
Copy link
Collaborator Author

@henry0312

By the way, why is there the same (similar?) PR, #2946?

That PR only reverts version constraint. This one fixes some new tests in addition. Refer to #2946 (comment).

@henry0312
Copy link
Contributor

@henry0312

By the way, why is there the same (similar?) PR, #2946?

That PR only reverts version constraint. This one fixes some new tests in addition. Refer to #2946 (comment).

Thank you for your explanation. I see 😄

@guolinke
Copy link
Collaborator

guolinke commented Apr 9, 2020

@StrikerRUS @henry0312 is this ready to merge?

@henry0312
Copy link
Contributor

@guolinke @StrikerRUS yes it is.

@henry0312 henry0312 merged commit c633c6c into master Apr 10, 2020
@henry0312 henry0312 deleted the sklearn_update branch April 10, 2020 03:53
@henry0312 henry0312 mentioned this pull request May 12, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] compatibility with scikit-learn
5 participants