From a35e2c7da3ab3a3edcfad09f2f27b34738b5d571 Mon Sep 17 00:00:00 2001 From: BenjaminLiu Date: Wed, 1 Apr 2020 14:15:00 -0400 Subject: [PATCH 1/5] minimal supported numpy and scipy version in pyproject.toml --- pyproject.toml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2547baae5874d..5ff965bbbb7b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,14 @@ requires = [ "setuptools", "wheel", - "Cython>=0.28.5", - "numpy>=1.13.3", - "scipy>=0.19.1", + "Cython>=0.29.13", + "scipy>=1.2.2", + "numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'", + "numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'", + "numpy==1.14.5; python_version=='3.7' and platform_system!='AIX'", + "numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'", + "numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'", + "numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'", + "numpy==1.16.0; python_version=='3.7' and platform_system=='AIX'", + "numpy==1.17.3; python_version>='3.8' and platform_system=='AIX'", ] From 026e96958ec8fbc1214739f1f5cab52036efcc6d Mon Sep 17 00:00:00 2001 From: BenjaminLiu Date: Wed, 1 Apr 2020 16:19:21 -0400 Subject: [PATCH 2/5] arrtibute documentations for ElasticNet#14312 --- sklearn/linear_model/_coordinate_descent.py | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 46e924abbc1d0..96aff7c6ce52a 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -658,6 +658,9 @@ class ElasticNet(MultiOutputMixin, RegressorMixin, LinearModel): number of iterations run by the coordinate descent solver to reach the specified tolerance. + dual_gaps_ : float or ndarray of shape (n_targets,) + Given param alpha, the dual gaps at the end of the optimization for each column of target y. + Examples -------- >>> from sklearn.linear_model import ElasticNet @@ -1607,6 +1610,9 @@ class ElasticNetCV(RegressorMixin, LinearModelCV): alphas_ : ndarray of shape (n_alphas,) or (n_l1_ratio, n_alphas) The grid of alphas used for fitting, for each l1_ratio. + dual_gap_ : float + The dual gaps at the end of the optimization for the optimal alpha. + n_iter_ : int number of iterations run by the coordinate descent solver to reach the specified tolerance for the optimal alpha. @@ -1775,6 +1781,15 @@ class MultiTaskElasticNet(Lasso): number of iterations run by the coordinate descent solver to reach the specified tolerance. + dual_gap_ : float + The dual gaps at the end of the optimization + + sparse_coef_ : sparse matrix of shape (n_tasks, n_features) + ``sparse_coef_`` is a readonly property derived from ``coef_`` + + eps_: float, default=1e-4 + same as tol + Examples -------- >>> from sklearn import linear_model @@ -1958,6 +1973,15 @@ class MultiTaskLasso(MultiTaskElasticNet): number of iterations run by the coordinate descent solver to reach the specified tolerance. + dual_gap_ : ndarray of shape (n_alphas,) + The dual gaps at the end of the optimization for each alpha + + sparse_coef_ : sparse matrix of shape (n_tasks, n_features) + ``sparse_coef_`` is a readonly property derived from ``coef_`` + + eps_: float, default=1e-4 + same as tol + Examples -------- >>> from sklearn import linear_model @@ -2134,6 +2158,9 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV): number of iterations run by the coordinate descent solver to reach the specified tolerance for the optimal alpha. + dual_gap_ : float + The dual gap at the end of the optimization for the optimal alpha + Examples -------- >>> from sklearn import linear_model @@ -2304,6 +2331,9 @@ class MultiTaskLassoCV(RegressorMixin, LinearModelCV): number of iterations run by the coordinate descent solver to reach the specified tolerance for the optimal alpha. + dual_gap_ : float + The dual gap at the end of the optimization for the optimal alpha. + Examples -------- >>> from sklearn.linear_model import MultiTaskLassoCV From d59645cb3a6e90501ab8ad2dfa8983fc521ad37f Mon Sep 17 00:00:00 2001 From: BenjaminLiu Date: Wed, 1 Apr 2020 16:37:27 -0400 Subject: [PATCH 3/5] unchange --- pyproject.toml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5ff965bbbb7b6..2547baae5874d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,14 +3,7 @@ requires = [ "setuptools", "wheel", - "Cython>=0.29.13", - "scipy>=1.2.2", - "numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'", - "numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'", - "numpy==1.14.5; python_version=='3.7' and platform_system!='AIX'", - "numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'", - "numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'", - "numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'", - "numpy==1.16.0; python_version=='3.7' and platform_system=='AIX'", - "numpy==1.17.3; python_version>='3.8' and platform_system=='AIX'", + "Cython>=0.28.5", + "numpy>=1.13.3", + "scipy>=0.19.1", ] From 4bfd1d7ca19659a3abf891c6660714446eb47fb2 Mon Sep 17 00:00:00 2001 From: BenjaminLiu Date: Wed, 1 Apr 2020 16:50:31 -0400 Subject: [PATCH 4/5] undo --- sklearn/linear_model/_coordinate_descent.py | 30 --------------------- 1 file changed, 30 deletions(-) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 96aff7c6ce52a..46e924abbc1d0 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -658,9 +658,6 @@ class ElasticNet(MultiOutputMixin, RegressorMixin, LinearModel): number of iterations run by the coordinate descent solver to reach the specified tolerance. - dual_gaps_ : float or ndarray of shape (n_targets,) - Given param alpha, the dual gaps at the end of the optimization for each column of target y. - Examples -------- >>> from sklearn.linear_model import ElasticNet @@ -1610,9 +1607,6 @@ class ElasticNetCV(RegressorMixin, LinearModelCV): alphas_ : ndarray of shape (n_alphas,) or (n_l1_ratio, n_alphas) The grid of alphas used for fitting, for each l1_ratio. - dual_gap_ : float - The dual gaps at the end of the optimization for the optimal alpha. - n_iter_ : int number of iterations run by the coordinate descent solver to reach the specified tolerance for the optimal alpha. @@ -1781,15 +1775,6 @@ class MultiTaskElasticNet(Lasso): number of iterations run by the coordinate descent solver to reach the specified tolerance. - dual_gap_ : float - The dual gaps at the end of the optimization - - sparse_coef_ : sparse matrix of shape (n_tasks, n_features) - ``sparse_coef_`` is a readonly property derived from ``coef_`` - - eps_: float, default=1e-4 - same as tol - Examples -------- >>> from sklearn import linear_model @@ -1973,15 +1958,6 @@ class MultiTaskLasso(MultiTaskElasticNet): number of iterations run by the coordinate descent solver to reach the specified tolerance. - dual_gap_ : ndarray of shape (n_alphas,) - The dual gaps at the end of the optimization for each alpha - - sparse_coef_ : sparse matrix of shape (n_tasks, n_features) - ``sparse_coef_`` is a readonly property derived from ``coef_`` - - eps_: float, default=1e-4 - same as tol - Examples -------- >>> from sklearn import linear_model @@ -2158,9 +2134,6 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV): number of iterations run by the coordinate descent solver to reach the specified tolerance for the optimal alpha. - dual_gap_ : float - The dual gap at the end of the optimization for the optimal alpha - Examples -------- >>> from sklearn import linear_model @@ -2331,9 +2304,6 @@ class MultiTaskLassoCV(RegressorMixin, LinearModelCV): number of iterations run by the coordinate descent solver to reach the specified tolerance for the optimal alpha. - dual_gap_ : float - The dual gap at the end of the optimization for the optimal alpha. - Examples -------- >>> from sklearn.linear_model import MultiTaskLassoCV From 69eaca8d5362e58a652758d7373ad74eebc37488 Mon Sep 17 00:00:00 2001 From: BenjaminLiu Date: Wed, 1 Apr 2020 16:53:20 -0400 Subject: [PATCH 5/5] delete py35 and don't increase requirement for Cython --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2547baae5874d..6011f5d2ea1ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,11 @@ requires = [ "setuptools", "wheel", "Cython>=0.28.5", - "numpy>=1.13.3", + "numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'", + "numpy==1.14.5; python_version=='3.7' and platform_system!='AIX'", + "numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'", + "numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'", + "numpy==1.16.0; python_version=='3.7' and platform_system=='AIX'", + "numpy==1.17.3; python_version>='3.8' and platform_system=='AIX'", "scipy>=0.19.1", ]