Commit Graph

283 Commits

Author SHA1 Message Date
Adrin Jalali 69c8967e21 DOC Fix warnings in examples (#12654)
Fixe or suppresses many warnings in examples, including matplotlib complaining about the non-gui backend.
2019-01-17 21:41:13 +11:00
Rohan Lekhwani e0697b01a7 MNT Used scipy.special.expit for the inverse of the logit function (#12931) 2019-01-08 18:35:19 +11: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
^__^ 6c5f285a32 EXA Fix comment in plot-iris-logistic example (#12564) 2018-11-12 09:33:42 +08:00
Xing Han Lu 5df8cd3bd7 EXA Fix title, overlapping plots and axis labels in plot_ols_ridge_variance.py (#12296) 2018-10-09 21:44:57 +08:00
Hanmin Qin a3616f65dc MNT Use name instead of float to specify colors (#12199) 2018-10-01 16:32:42 +02:00
Olivier Grisel fc7d6e6986 [MRG] Fix FutureWarnings in logistic regression examples (#12114)
* Be more specific about logistic regression solver in examples

* Use early stopped SGD (faster) and plot cross-validated error for best models

* Fix LR solver in /plot_voting_probas.pyexamples/ensemble/plot_voting_probas.py

* Fix LR solver & scale data in plot_digits_classification_exercise.py

* Use saga solver in plot_logistic_l1_l2_sparsity.py

* Use LBFGS solver in plot_iris_logistic.py

* Use LBFGS in plot_logistic.py

* Use SAGA solver for Logistic Regression Path example

* Use LBFGS solver in plot_classifier_chain_yeast.py

* Use LBFGS solver in plot_rbm_logistic_classification.py

* typo

* typo

* Bump up pandas dependency to 0.17.1

* Bump up examples minimal deps to match pandas 0.17.1

* Fix figure layout for plot_digits_pipe.py

* Version numbers are not decimal numbers

* Set multinomial, no scaling to keep example simple, fix formatting of example doc

* Missing plt.tight_layout() in plot_voting_probas.py

* Missing plt.tight_layout() in plot_logistic.py
2018-09-24 18:22:40 +01:00
Hanmin Qin 8890b50606 [MRG+1] EXA Set cv=5 in examples (#11856)
* EXA Set cv=5 in examples

* small mistake

* [doc build]

* [doc build]

* cross_val*

* [doc build]

* [doc build]
2018-08-20 15:22:42 -04:00
Hanmin Qin 4d7d410ed2 EXA Use fetch_openml(returnX_y=True) (#11855) 2018-08-20 09:02:52 +10:00
Joel Nothman fc56da504d Deprecate fetch_mldata (#11466)
* API Deprecate fetch_mldata and update examples
* Use pytest's filterwarnings
* Rm unused import
* Remove broken doctest
* Refer user to openml URL
* DOC whatsnew tweak
2018-08-18 19:27:48 +03:00
ZJ Poh adddf00433 [MRG] np.ones -> np.full (#11628) 2018-07-23 09:49:01 +02:00
Tom Dupré la Tour 0fc7ce6bb8 [MRG+1] Add a stopping criterion in SGD, based on the score on a validation set (#9043) 2018-07-05 16:25:34 +02:00
cwitte 2ccc946157 [MRG+1] DOC changed plotting of SGD penalties to improve clarity (#10574) 2018-02-07 23:54:36 +11:00
Hristo cb41c52625 Remove unused variable alphas from the LARS example. (#9882) 2017-10-07 17:04:08 +02:00
syonekura 32fcc364ab [MRG+1] Setting max_iter/tol explicitly for SGD estimators in docs (#9776) 2017-10-04 17:28:32 +02:00
Hanmin Qin 32ac22870d [MRG+1] Fix warnings in lgtm.com (remove redundant code) (#9719) 2017-09-14 11:42:58 +02:00
Sebastin Santy e33e84dbf7 [MRG] FIX Examples use int / int without __future__.division (#9426) 2017-07-23 12:11:49 +10:00
Ramana Subramanyam c10c88622a Deprecate randomized_l1 (#9031) 2017-06-30 18:20:25 +02:00
Tom Dupré la Tour edeb3af217 Deprecate n_iter in SGDClassifier and implement max_iter (#5036) 2017-06-23 21:49:29 +02:00
plagree 1f6ac72df7 [MRG] DOC examples with correct notebook style (#9061)
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
2017-06-20 14:48:57 +02:00
Aarshay Jain 6986e9b5db [MRG + 1] 18 more examples with matplotlib 2.0 updates (#8983)
* updated plot_label_propagation_versus_svm_iris.py plot

* updated svm/plot_weighted_samples.py plot

* made semi_supervised/plot_label_propagation_versus_svm_iris.py pep8 compliant

* modified tree/plot_tree_regression.py [size and edgecolor]

* updated tree/plot_tree_regression_multioutput.py [size+color]

* fixed examples/semi_supervised/plot_label_propagation_versus_svm_iris.py for backward compatibility

* neural_networks/plot_mlp_alpha.py - matplotlib2 update

* examples/neural_networks/plot_mlp_alpha.py - pep8 fix

* examples/neighbors/plot_nearest_centroid.py - matplotlib2.0 + pep8 fix

* neighbors/plot_classification.py - matplotlib2.0 + pep8 fix

* examples/neighbors/plot_lof.py - matplotlib2.0 update

* examples/model_selection/plot_underfitting_overfitting.py - matplotlib2.0 + pep8

* examples/mixture/plot_concentration_prior.py - matplotlib2.0 + pep8

* examples/linear_model/plot_logistic_multinomial.py - matplotlib2.0 update

* linear_model/plot_sgd_iris.py - matplotlib2.0 + pep8 fix

* examples/linear_model/plot_sgd_weighted_samples.py - matplotlib2.0 + pep8

* examples/linear_model/plot_sgd_separating_hyperplane.py - matplotlib2.0 update

* examples/feature_selection/plot_permutation_test_for_classification.py - matplotlib + pe8

* examples/linear_model/plot_bayesian_ridge.py - matplotlib2.0 update

* examples/feature_selection/plot_feature_selection.py - matplotlib2.0 update

* examples/feature_selection/plot_f_test_vs_mi.py - matplotlib2.0 + pep8

* examples/feature_selection/plot_f_test_vs_mi.py - matplotlib2.0+ pep8 fix

* examples/model_selection/plot_underfitting_overfitting.py - error fixed

* blue -> black edgecolor fix for 2 examples
2017-06-07 13:23:12 +02:00
Naoya Kanai bd0fc236e0 [MRG+1] MAINT drop SciPy < 0.13 (#8854)
Remove sklearn.utils.fixes functions that are not needed for scipy >= 0.13 and keep deprecated wrappers in other modules.
2017-06-02 23:36:33 +02:00
Loïc Estève 719afba518 [MRG] Run more examples as part of the doc generation (#8851)
Also fix errors and flake8 violations of existing examples
2017-05-11 23:42:57 +02:00
Arthur Mensch 5147fd09c6 Add SAGA solver for LogisticRegression and Ridge (#8446) 2017-03-27 21:39:30 +02:00
David Robles 0ab5c678bb Save predictions in diabetes_y_pred (#8241)
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
2017-02-27 23:06:26 +01:00
Nelle Varoquaux 9b75a81b2d [MRG] FIX lasso/elasticnet example did not add noise to simulated data. (#8427)
The first argument of np.random.normal is the mean of the distribution, and
not the output shape. The example thus did not add noise but only an intercept
to the model.
2017-02-22 14:54:32 +01:00
akshay0724 b705cb811d [MRG] loss function plot y-label slightly confusing (#8283)
* Correct y label in plot

* Remove Space
2017-02-06 21:10:44 +11:00
Aman Dalmia 13cc121b30 [MRG] Remove DeprecationWarnings in examples due to using floats instead of ints (#8040) 2017-02-03 15:21:03 +01:00
Rishikesh 15fddab163 Cosmetic changes to rigde path example (#8260)
Change the name of ridge object clf to ridge and also
reinstantiate ridge in every iteration.

Issue: https://github.com/scikit-learn/scikit-learn/issues/8256
2017-02-01 13:13:12 +01:00
Andreas Mueller b6d39793d0 [MRG] make the ransac example slightly more terse, improve range of plot (#8258) 2017-02-01 08:31:07 +01:00
Sergey Feldman 67a85b8ed8 [MRG+2] Adding return_std options for models in linear_model/bayes.py (#7838)
* initial commit for return_std

* initial commit for return_std

* adding tests, examples, ARD predict_std

* adding tests, examples, ARD predict_std

* a smidge more documentation

* a smidge more documentation

* Missed a few PEP8 issues

* Changing predict_std to return_std #1

* Changing predict_std to return_std #2

* Changing predict_std to return_std #3

* Changing predict_std to return_std final

* adding better plots via polynomial regression

* trying to fix flake error

* fix to ARD plotting issue

* fixing some flakes

* Two blank lines part 1

* Two blank lines part 2

* More newlines!

* Even more newlines

* adding info to the doc string for the two plot files

* Rephrasing "polynomial" for Bayesian Ridge Regression

* Updating "polynomia" for ARD

* Adding more formal references

* Another asked-for improvement to doc string.

* Fixing flake8 errors

* Cleaning up the tests a smidge.

* A few more flakes

* requested fixes from Andy

* Mini bug fix

* Final pep8 fix

* pep8 fix round 2

* Fix beta_ to alpha_ in the comments
2016-12-01 10:52:18 -05:00
Deborah Gertrude Digges 3c18735503 [MRG+2] logit -> logistic in plot_logistic.py and minor visual improvements to the plot. (#7730)
* Small correction of logit->logistic

The function `1 / (1 + np.exp(-x))` is the logistic function. 
The logit function is the inverse of the logistic function : `log(x/(1-x))`

* Add axes ticks, legend and colors to the plot

* Fix flake8 errors

* Rename legend labels as per review

* Fix pep8 error
2016-10-25 10:19:57 +02:00
Ishank Gulati cee48cdf8f removed cv_ prefix (#6252) 2016-10-08 10:27:41 +09:00
Shota e2a2b4d403 Fix typos (#6942) 2016-06-27 18:13:49 +02:00
Gael Varoquaux 1837224751 Merge pull request #6613 from nelson-liu/correct_license_spelling
[MRG+1] DOC: fix spellings of 'license'
2016-06-15 13:58:59 +02:00
Saiwing Yeung c5fd5cbb7e DOC: fixed typos and one style issue in plot examples
The comment in a few example plots refer to "the mesh [x_min, m_max] x
[y_min, y_max]" when it should be "x_max".

Also fixed the spacing in plot_random_forest_embedding.py `[x_min,
x_max] x [y_min, y_max]` to `[x_min, x_max]x[y_min, y_max]` to comply
with the coding style of other files with similar code (like those in
the current pull request).
2016-04-25 11:59:40 +08:00
Nelson Liu d2aaf0f4bb doc: fix spellings of 'license' 2016-03-31 17:25:31 -07:00
Rémy Léone 9b7176dd9d [DOC] Fix broken links 2016-03-23 12:45:34 -07:00
MechCoder 7e79adca9d Huber regressor
Add gradient calculation in _huber_loss_and_gradient

Add tests to check the correctness of the loss and gradient

Fix for old scipy

Add parameter sigma for robust linear regression

Add gradient formula to robust _huber_loss_and_gradient

Add fit_intercept option and fix tests

Add docs to HuberRegressor and the helper functions

Add example demonstrating ridge_regression vs huber_regression

Add sample_weight implementation

Add scaling invariant huber test

Remove exp and add bounds to fmin_l_bfgs_b

Add sparse data support

Add more tests and refactoring of code

Add narrative docs

review huber regressor

Minor additions to docs and tests

Minor fixes that deals with dealing with NaN values in targets
and old verions of SciPy and NumPy

Add HuberRegressor to robust estimator

Refactored computation of gradient and make docs render properly

Temp

Remove float64 dtype conversion

trivial optimizations and add a note about R

Remove sample_weights special_casing

address @amueller comments
2016-02-25 16:31:08 -05:00
YenChenLin 2d8eb008d2 Fix broken link of Wainwright's paper 2016-02-18 01:09:20 +08:00
Kornel Kielczewski d3175db362 Ridge coefficients as a function of regularisation
- another perspective
2016-01-19 16:04:36 +01:00
MechCoder 936ea632e6 Make ridge path with ill-conditioned matrices clearer 2016-01-09 12:29:13 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Andreas Mueller 5b1aca08c2 MAINT Don't use deprecated 1d X (or deprecated matplotlib stuff) in examples. 2015-12-10 12:11:48 -05:00
Manoj Kumar 43e54541a1 Merge pull request #5251 from TomDLT/sag_multi
[MRG+1] add multinomial SAG solver for LogisticRegression
2015-12-04 13:43:08 -05:00
TomDLT 9f136ff293 ENH add multinomial SAG solver for LogisticRegression 2015-12-04 18:36:37 +01:00
kjell 50dfa8610a change comment, printed comment, and code behavior to all reflect computation of mean squared error 2015-12-03 13:17:58 -08:00
kjell 6f7e351886 residual sum of squares should be computed by summing the squared differences instead of taking the mean. 2015-12-03 10:48:02 -08:00
Raghav R V 654bddda54 FIX Explicitly specify the plot colors for each curve 2015-11-12 15:26:19 +01:00
Raghav R V f67e911124 DOC Modify documentation/examples for the new model_selection module 2015-10-29 16:49:23 +01:00