Commit Graph

105 Commits

Author SHA1 Message Date
Mandy Gu 379919dc59
ENH Add optional parameter to return raw data for diabetes dataset (#16605)
Co-authored-by: happilyeverafter95 <mgu@wealthsimple.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-12-17 11:33:18 +01:00
Loïc Estève 365234563e
Set up matplotlib agg backend at the beginning of the tests (#20230)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2021-06-17 17:45:53 +02:00
Chiara Marmo 40b45e6b7c
[MRG] CI Push Scipy minimum version to 1.1.0. Remove Python 3.6 from builds. (#20069)
* Push scipy min version to 1.0.0

* Update all ubuntu images to 20.04 focal.

* Add ubuntu images 18.04 bionic and scipy fron conda-forge.

* Fix conditions.

* Pin python 3.6 for ubuntu bionic.

* Change pipeline name.

* Change matrix element name.

* Keep python 3.9 from system not conda in Ubuntu 20.04.

* Remove python directive when unnecessary.

* Cleanup.

* Downgrade to python 3.6 as scipy 1.0.0 is incompatible with 3.8.

* Fix comment.

* Fix comment.

* Pin pytest again as we are forced to use 3.6.

* Move to conda installer for 32bit linux.

* Install miniconda for ubuntu 32bit.

* Install wget for ubuntu 32bit.

* Revert 32bit OS to ubuntu bionic 18.04.

* Install scipy from pip in 32bit system.

* Fix doctest failures.

* Revert example rendering.

* Relax pytest version in ubuntu install.

* Skip failing tests.

* Put comment at the right place.

* Remove python3.6. Ubuntu32 still needs to be adapted.

* Push numpy and scipy min versions for compatibility with 3.7.

* Push matplotlib min version for compatibility with 3.7. Install numpy via pip in 32bit linux.

* Install numpy before scipy in Linux 32bit.

* Pass numpy version to linux32.

* Test 32bit architecture on debian buster (still exists for 32bit with python 3.7).

* Install matplotlib from distribution.

* Syntax error...

* Stick to the numpy debian version to avoid Expected 124 from C header, got 112 from PyObject error.

* Clean comments.

* Revert skip in doctest to check with new dependencies.

* Rename distrib.

* Skip again...

* Fix test on check_array.

* Remove comment and fix lint at the same time.

* Clean import.

* Increase atol in test_derivatives to make the test pass in py37_conda_openblas environment.

* Avoid sparse matrix dependent on scipy version.

* Skip docstring test for pandas versions less then 1.1.0.

* Fix lint error.

* Empty commit to force checks.

* Add minimal dependencies in changelog.

* Update to python 3.7 CircleCI and Travis builds.

* Move to debian buster for python3.7 dependencies.

* Fix the container tag.

* Lower the minimal pandas version for compatibility with python 3.7.
2021-05-18 16:09:36 +02:00
Guillaume Lemaitre 4876688d30
[arm64] MNT skip docstring check in tutorial for ARM64 (#18728) 2020-11-02 15:39:58 +01:00
Chiara Marmo bebb6d2255
DOC Tutorial structure and layout (#18261)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
2020-08-29 10:32:33 -04:00
Chiara Marmo 075d424568
FEA Add Nonnegative LinearRegression (#17578)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Joseph Knox <jknox13@uw.edu>
Co-authored-by: Joseph Knox <joseph.edward.knox@gmail.com>
2020-08-06 08:30:24 -04:00
topisan 3379e90f6d DOC return_X_y for load diabetes (#14762) 2019-08-24 23:17:01 -04:00
Kanika Sabharwal 40c7978a64 use return_X_y=True for load_iris dataset (#14777) 2019-08-24 17:54:16 -04:00
Thomas J Fan 2e7e06b78f [MRG] Doctest with print change only adjusts default options for doctest (#13991) 2019-06-01 10:53:45 +02:00
Guillaume Lemaitre c28ef9ef2a DEP change the default of multi_class to 'auto' in logistic regression (#13807) 2019-05-22 09:57:15 -04:00
Guillaume Lemaitre 7896b21562 MNT change default of solver in LogisiticRegression (#13805) 2019-05-08 21:31:39 +08:00
Guillaume Lemaitre 28480f4cb2 DEP change the default of gamma in SVM (#13801) 2019-05-07 16:12:49 +02:00
Adrin Jalali 384c8ad3d3 ENH add a break_ties parameter to SVC and NuSVC (#12557) 2019-05-03 16:15:49 -04:00
surgan12 62d2059804 MNT remove __future__ imports (#12791) 2019-02-02 22:05:06 +08:00
Joel Nothman 486f8fc543 DOC fix plot_iris references after files renamed 2019-01-17 23:31:48 +11:00
Nicolas Hug a50c03f975 [MRG] Add pprint for estimators - continued (#11705)
* add pprint for estimators

* strip color from length, add color option

* Minor cleaning, fixes, factoring and docs

* Added some basic tests

* Fixed line length issue

* fixed flake8 and added visual test for review

* Fixed test

* Fixed Python 2 issues (inspect.signature import)

* Trying to fix flake8 again

* Added special repr for functions

* Added some other visual tests

* Changed _format_function in to _format_callable

because callable() returns True also for class objects (which we want to
reprensent with their name as well anyway)

* Consistent output in Python 2 and 3

* WIP

* Now using the builtin pprint module

* pep8

* Added changed_only param

* Fixed printing when string would fit in less than line width

* Fixed printing of steps parameter

* Fixed changed_only param for short estimators

* fixed pep8

* Added some more description in docstring

* changed_only is now an option from set_config()

* Put _pprint.py into sklearn/utils, added tests

* Added doctest NORMALIZE_WHITESPACE where needed

* Fixed tests

* fix test-doc

* fixing test that passed before....

* Fixed tests

* Added test for changed_only and long lines

* typo

* Added authors names

* Added license file

* Added ellipsis based on number of elements in sequence + added increasinly aggressive repr strategies

* Updated whatsnew

* dont use increaingly aggressive strategy

* Fixed tests

* Removed LICENSE file and put license text in _pprint.py

* fixed test_base

* Sorted parameters dictionary for consistent output in 3.5

* Actually using OrderedDict...

* Addressed comments

* Added test for NaN changed parameter

* Update whatsnew

* Added example to set_config()

* Removed example

* Added example in gallery

* Spelling
2018-12-19 23:48:21 -05:00
Nicolas Hug c1f58745be [MRG] Add elastic net penalty to LogisticRegression (#11646)
* First draft on elasticnet penaly for LogisticRegression

* Some basic tests

* Doc update

* First draft for LogisticRegressionCV.

It seems to be working for binary classification and for multiclass when
multi_class='ovr'. I'm having a hard time figuring out the intricacies
of multi_class='multinomial'.

* Changed default to None for l1_ratio.

added warning message is user sets l1_ratio while penalty is not
elastic-net

* Some more doc

* Updated example to plot elastic net sparsity

* Fixed flake8

* Fixed test by not modifying attribute in fit

* Fixed doc issues

* WIP

* Partially fixed logistic_reg_CV for multinomial.

Also added some comments that are hopefully clear.
Still need to fix refit=False

* Fixed doc issue

* WIP

* Fixed test for refit=False in LogisticRegressionCV

* Fixed Python 2 numpy version issue

* minor doc updates

* Weird doc error...

* Added test to ensure that elastic net is at least as good as L1 or L2
once l1_ratio has been optimized with grid search

Also addressed minor reviews

* Fixed test

* addressed comments

* Added back ignore warning on tests

* Added a functional test

* Scale data in test... Now failing

* elastic-net --> elasticnet

* Updated doc for some attributes and checked their shape in tests

* Added l1_ratio dimension to coefs_paths and scores attr

* improve example + fix test

* FIX incorrect lagged_update in SAGA

* Add non-regression test for SAGA's bug

* FIX flake8 and warning

* Re fixed warning

* Updated some tests

* Addressed comments

* more comments and added dimension to LogisticRegressionCV.n_iter_ attribute

* Updated whatsnew for 0.21

* better doc shape looks

* Fixed whatnew entry after merges

* Added dot

* Addressed comments + standardized optional default param docstrings

* Addessed comments

* use swapaxes instead of unsupported moveaxis (hopefully fixes tests)
2018-11-21 20:23:57 -05:00
Denis Kataev b020f62250 MNT Apply pep8 to docs code (#12275) 2018-10-05 22:51:42 +08:00
Joel Nothman 7ed61a24fe ENH add multi_class='auto' for LogisticRegression, default from 0.22; default solver will be 'lbfgs' (#11905)
* Change default solver in LogisticRegression
* This is an API change, not a feature
* Decrease numerical precision in LogisticRegression doctest
* ENH add multi_class='auto' for LR, default from 0.22
* No warning when binary
2018-08-26 23:00:02 +03:00
Olivier Grisel 40e6c43cb4
Joblib 0.12.2 (#11741)
* joblib 0.12.2

* Export _joblib's register_parallel_backend

* Use latest version of coverage
2018-08-03 12:34:25 +02:00
Gaurav Dhingra eed83790b0 ENH Change default gamma from 'auto' to 'scale' in SVC (#10331) 2018-03-10 10:39:21 +08:00
Joel Nothman 3972f4e615 DOC Add NORMALIZE_WHITESPACE for numpy master 2017-12-11 12:56:27 +11:00
Andreas Mueller 5271a193c3 MRG Sphinx fixes (#9155) 2017-06-28 17:00:13 +02:00
Chayant T15h f34816ab89 Fixes tildes in rst files (#8751) 2017-04-19 14:28:49 +02:00
Dickson 15921603ea fix typo (#8390) 2017-02-18 11:29:07 +01:00
Aseem Bansal 2bf5006ef7 spelling mistake (#8341) 2017-02-12 16:53:58 +01:00
Andreas Mueller 5c4b1bb231 [MRG+1] Housekeeping Deprecations for v0.19 (#7927)
* remove stuff to be removed 0.19

* more changes

* remove classes from 0.19 whatsnew

* remove _LearntSelectorMixin

* remove ProjectedGradientNMF, load_lwf_*

* minor fixes

* remove more copy from logistic regression path

* remove lda, qda from __init__.__all__

* remove pg solver in nmf from tests etc

* remove class_weight="auto" from tests

* doctest change for decision_function_shape="ovr"

* remove transfrom from tree test, minor fixes to tree tests

* some fixes in the tests

* undo changes in functions which still allow 1d input...

* also allow 1d in scale

* more test fixes...

* last test fixes in forest and tree

* svm default value change doctest failures

* pep8

* remove more class_weight="auto" stuff

* minor cosmetics in docstrings deprecated / removed behavior.

* say that store_covariance has been moved to __init__ in discriminant_analysis
2016-12-09 12:43:38 -05:00
Óscar Nájera acef8cd671 Sphinx-doc absolute path for auto_example images 2016-08-03 20:23:50 +02:00
Óscar Nájera 7ec54472fd Add carousel
Fix reference link
2016-08-03 20:23:50 +02:00
Óscar Nájera bd5cecce44 update references link namespace 2016-08-03 20:23:50 +02:00
Óscar Nájera 04116ce286 update image sources namespace 2016-08-03 20:23:50 +02:00
Inki Hwang a2dac46e71 Fix minor typo in doc (#7001) 2016-07-16 08:39:10 +02:00
Robert Lutz 0c879ba551 [MRG+1] Fix: Replace pylab with matplotlib.pyplot #6754 (#6762)
* Fix: Replace pylab with matplotlib.pyplot #6754

 - one instance of 22 occurrences of pylab replaced with matplotlib.pyplot
 - bench_glm.py now free of pylab references
 - code executes properly

* Fix: Replace pylab with matplotlib.pyplot #6754

- one instance of 21 remaining occurrences of pylab replaced with
    matplotlib.pyplot
- bench_glmnet.py now free of pylab references
- code does not execute for extraneous reason: ImportError: No module named
    glmnet.elastic_net

* Fix: Replace pylab with matplotlib.pyplot #6754

- one instance of 19 occurrences of pylab replaced with matplotlib.pyplot
- bench_lasso.py now free of pylab references
- code executes properly

* Fix: Replace pylab with matplotlib.pyplot #6754

- one instance of 18 occurrences of pylab replaced with matplotlib.pyplot
- bench_plot_neighbors.py now free of pylab references
- code executes properly

* Fix: Replace pylab with matplotlib.pyplot #6754

- one instance of 17 occurrences of pylab replaced with matplotlib.pyplot
- bench_plot_omp_lars.py now free of pylab references
- code does not execute for extraneous reasons:
    - File "bench_plot_omp_lars.py", line 111, in <module>
    - ax = fig.add_subplot(1, 2, i)
    - ValueError: num must be 1 <= num <= 2, not 0
    - line 111 should probably be ax = fig.add_subplot(1, 2, i+1)

* Fix: Replace pylab with matplotlib.pyplot #6754

- bench_plot_parallel_pairwise.py now free of pylab references
- code executes properly

* Fix: Replace pylab with matplotlib.pyplot #6754

- bench_plot_ward.py now free of pylab references
- code executes properly

* Fix: Replace pylab with matplotlib.pyplot #6754

- bench_sgd_regression.py now free of pylab references
- code executes properly

* Fix: Replace pylab with matplotlib.pyplot #6754

- bench_tree.py now free of pylab references
- code executes properly

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_glm.py clean

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_glm.py clean of pl
- code does not execute for extraneous reasons

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_lasso.py clean of pl
- code executes properly

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_plot_neighbors.py clean of pl
- code executes properly

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_plot_omp_lars.py clean of pl
- code does not execute for extraneous reasons

* fix: Fix bug that prevented graphs from displaying

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_plot_parallel_pairwise.py clean of pl
- code executes properly

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_plot_ward.py clean of pl
- code executes properly

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_sgd_regression.py clean of pl
- code executes properly

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- bench_tree.py clean of pl
- code executes properly

* docs: removed pylab references from comments

* docs: removed all pylab references

- replaced with matplotlib.pyplot
- pl --> plt

* docs: removed pylab references from comments

- replaced with matplotlib.pyplot
- pl --> plt

* docs: removed all pylab references

- replaced with matplotlib.pyplot
- pl --> plt

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- mlcomp_sparse_document_classification.py clean of pl

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- plot_gpr_noisy_targets.py clean of pl
- code does not execute for extraneous reasons
  - File "examples/gaussian_process/plot_gpr_noisy_targets.py", line 31, in
      <module>
  - from sklearn.gaussian_process import GaussianProcessRegressor
  - ImportError: cannot import name GaussianProcessRegressor

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- plot_gpc_isoprobability.py clean of pl
- code does not execute for extraneous reasons
  - File "examples/gaussian_process/plot_gpc_isoprobability.py", line 24, in
      <module>
  - from sklearn.gaussian_process import GaussianProcessClassifier
  - ImportError: cannot import name GaussianProcessClassifier

* docs: removed all pylab references

- replaced with matplotlib.pyplot
- pl --> plt

* docs: removed all pylab references

- replaced with matplotlib.pyplot

* refactor: Replace pl with plt

- replace instances of pl (as on import pylab as pl)
  with plt (as in import matplotlib.pyplot as plt)
- plot_sparse_coding.py clean of pl
- code executes properly

* docs: removed all pylab references

- replaced with matplotlib.pyplot

* docs: removed all pylab references

- replaced with matplotlib.pyplot

* style: Indent properly

* style: indent properly

* style: Indent properly

* docs: Add missing .pyplot

* docs: Fix typo

* style: Indent properly
2016-05-10 11:34:33 +02:00
Rémy Léone 9b7176dd9d [DOC] Fix broken links 2016-03-23 12:45:34 -07:00
YenChenLin ca4c727e22 Fix misuse of it's 2016-02-26 10:16:28 +08:00
TomDLT 94eb61960a ENH add sag solver in LogisticRegression and Ridge 2015-09-10 13:28:02 -04:00
Gael Varoquaux fb58d37846 Merge branch 'master' into pr_4009
Conflicts:
	sklearn/neighbors/ball_tree.c
	sklearn/neighbors/dist_metrics.c
	sklearn/neighbors/dist_metrics.pyx
	sklearn/neighbors/kd_tree.c
	sklearn/neighbors/tests/test_neighbors.py
2015-08-30 11:54:40 +01:00
Lars Buitinck 567a956338 Merge branch 'pr/4714' + pep8 fixes
Conflicts:
	doc/modules/model_persistence.rst
	doc/modules/pipeline.rst
	doc/modules/svm.rst
	doc/tutorial/basic/tutorial.rst
	doc/tutorial/statistical_inference/supervised_learning.rst
	sklearn/svm/classes.py
2015-06-08 11:31:51 +02:00
Shivan Sornarajah 41788c353b Changed SVM to use gamma='auto' by default. Deprecated gamma=0.0. 2015-06-05 22:47:43 +01:00
Andreas Mueller 6d4bcda876 ENH refactor OVO decision function, use it in SVC for sklearn-like decision_function shape 2015-06-05 13:14:45 -04:00
Nikolay Mayorov 63039b24bc Added multithreading support for kneighbors search 2015-02-19 13:15:55 +03:00
Manoj-Kumar-S e915fcc3ab Changed default argument of precompute in ElasticNet and Lasso
Setting precompute to "auto" was found to be slower when n_samples > n_features
since the computation of the Gram matrix is computationally expensive and
outweighs the benefit of fitting the Gram for just one alpha.
2014-10-03 18:25:12 +02:00
akshayah3 4f2ff2dd7a Small PEP8 fix, n_jobs attribute is compatible with both fit method and the constructor 2014-09-19 15:32:06 +05:30
akshayah3 25c03a7ff8 Added Deprecation warning 2014-09-19 14:39:35 +05:30
jnothman 75e11c0b50 Merge pull request #3591 from MechCoder/refactor_logreg
[MRG] MAINT: Remove BaseLibLinear for LogisticRegression
2014-08-30 21:22:07 +10:00
MechCoder 34a4517983 ENH: Improved verbosity and denesting 2014-08-26 20:48:23 +02:00
MechCoder 959a4ac698 MAINT: Remove BaseLibLinear for LogisticRegression 2014-08-26 13:58:07 +02:00
Lars Buitinck 4b82379c20 TST fix doctest for k-NN 2014-08-25 23:49:56 +02:00
MechCoder 4cd177758f ENH: Merge MultinomialLR into LR with multi_class='multinomial' 2014-08-21 17:37:37 +02:00
Joel Nothman 763af9690a DOC fix line references in tutorial 2014-08-20 21:00:54 +10:00