Commit Graph

2804 Commits

Author SHA1 Message Date
Hristo 0e19710fa4 Improve readability of outlier detection example. (#9973) 2017-10-24 09:41:15 +02:00
Zhenqing Hu 3593194b69 Python 2 fix for plot_stock_market.py error (#9965) 2017-10-22 20:48:29 +02:00
Vrishank Bhardwaj ed5a0cac6b [MRG+1] Update docstrings of KMeans.inertia_ (#9920)
[MRG+2] Update docstrings of KMeans.inertia_
2017-10-15 18:56:18 -07:00
Nathaniel Saul 675f9f3a7c DOC show plot and fix comments (#9925) 2017-10-15 23:27:35 +11:00
Loïc Estève 502261bd9d Fix example for matplotlib 2.1 change. (#9897) 2017-10-10 11:42:48 +02: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
Anthony Gitter 59bb32ff71 DOC Add average precision definitions and cross references (#9583) 2017-09-25 20:04:21 +10:00
Loïc Estève cceb9b22ac Fix plot_out_of_core_classification.py. (#9815)
Starting from empty ~/scikit_learn_data got AttributeError: module
'sklearn.externals.six.moves.urllib_request' has no attribute
'urlretrieve'.
2017-09-25 08:21:44 +02:00
Hanmin Qin e443c05ea3 hange alpha in plot_label_propagation_structure.py (#9788) 2017-09-19 09:40:29 +02:00
Loïc Estève 8b53659e41 plot_stock_market.py checks are based on dates rather than on hard-coded values 2017-09-18 11:17:17 +02:00
Joel Nothman 7425abcb00 FIX? Use ISO8601 dates and resolved URL for Google Finance 2017-09-18 11:11:39 +10:00
Joel Nothman fa8972bcdd FIX max date should use max, not min 2017-09-18 11:08:33 +10:00
Loïc Estève 7a2ce27a8f Add expected parameter to check min_date, max_date and len_data
rather than hardcoding the logic in the quotes_historical_google function.

Some minor variable renaming.
2017-09-15 15:59:58 +02:00
Loïc Estève 470c30050e Better treatment of empty data in plot_stock_market.py
Also use date rather than datetime because we do not need hour of day
2017-09-14 17:12:42 +02:00
Vrishank Bhardwaj 8fa7771d13 [MRG+1] Added exchange names to tickers in plot_stock_market.py (#9750) 2017-09-14 14:49:43 +02:00
Hanmin Qin 32ac22870d [MRG+1] Fix warnings in lgtm.com (remove redundant code) (#9719) 2017-09-14 11:42:58 +02:00
Loïc Estève 9684f468ae Improve error message in plot_stock_market.py 2017-09-14 11:23:05 +02:00
Loïc Estève fb66956be4 Improve error messages in plot_stock_market when Google finance misbehaves.
Also few cosmetic changes.
2017-09-14 10:02:32 +02:00
Joel Nothman 4814bc1fd6 DOC/FIX put the sort in the right place 2017-09-13 20:09:12 +10:00
Joel Nothman 8c82943af1 More verbose output in plot_stock_market for debugging 2017-09-13 10:55:04 +10:00
Nabarun Pal 274724534d [MRG] Removes duplicate variable definition (#9688) 2017-09-05 09:27:18 +10:00
Andreas Mueller 9b5561148f [MRG] Figure improvements (#9648)
* Example plots render poorly in dev

* flake8 + bias_variance

* title padding

* misc ensemble variance plotting

don't use rcParams to set size of a single figure,
put legend outside of plot

* semisupervised plotting fixes

use explicit kwargs in subplots_adjust, change hspace, don't change aspect ratio of imshow.
2017-09-01 10:29:05 +02:00
Joel Nothman 468d6e71aa Remove inappropriate warm_start (#9638) 2017-08-29 09:58:55 +10:00
Michael A. Alcorn a571b01ac8 ENH Implement Complement Naive Bayes (#8190) 2017-08-28 23:31:45 +10:00
Hanmin Qin cb16003751 DOC Improve the output of example plot_iris.py after matplotlib2.0 (#9541) 2017-08-16 09:01:28 +10:00
(Venkat) Raghav, Rajagopalan 312b1dfc74 ENH Early stopping for Gradient Boosting Classifier/Regressor (#7071) 2017-08-09 22:02:47 +02:00
tobycheese da415db476 DOC remove unnecessary line (#9504) 2017-08-07 08:48:07 +10:00
Andreas Mueller de26c30fad DOC Fixup of linear svm separating hyperplane plot (#9471)
* change data, don't regularize, call plt.show
2017-08-06 13:28:08 +10:00
Vathsala Achar 9927982c4e [MRG+1] DOC Simplifying margin plotting in SVM examples (#8501) (#8875)
* Simplifying margin plotting in SVM examples (#8501)

* updated to use contour levels on decision function

* separating unbalanced class now uses a red line to show the change in the decision boundary when the classes are weighted

* corrected the target variable from Y to y

* DOC Updates to SVM examples

* Fixing flake8 issues

* Altered make_blobs to move clusters to corners and be more compact

* Reverted changes converting Y to y

* Fixes for flake8 errors
2017-08-01 15:11:48 -04:00
Balakumaran Manoharan 04be1a9799 [MRG + 1] DOC Fix Sphinx errors (#9420)
* Fix Rouseeuw1984 broken link

* Change label vbgmm to bgmm
Previously modified with PR #6651

* Change tag name
Old refers to new tag added with PR #7388

* Remove prefix underscore to match tag

* Realign to fit 80 chars

* Link to metrics.rst.
pairwise metrics yet to be documented

* Remove tag as LSHForest is deprecated

* Remove all references to randomized_l1 and sphx_glr_auto_examples_linear_model_plot_sparse_recovery.py.
It is deprecated.

* Fix few Sphinx warnings

* Realign to 80 chars

* Changes based on PR review

* Remove unused ref in calibration

* Fix link ref in covariance.rst

* Fix linking issues

* Differentiate Rouseeuw1999 tag within file.

* Change all duplicate Rouseeuw1999 tags

* Remove numbers from tag Rousseeuw
2017-07-30 15:22:10 +10:00
hakaa1 8811d59464 [MRG+1] retry mechanism for plot_stock_market.py (#9437) 2017-07-25 13:48:57 +02:00
Adam Kleczewski 511bbc7237 [MRG+1] Chassifier chain example fix (#9408) 2017-07-25 10:28:01 +02:00
Andreas Mueller 2277068c88 remove depreated "plt.hold" that defaults to "on". (#9444) 2017-07-25 09:03:22 +10:00
Sebastin Santy e33e84dbf7 [MRG] FIX Examples use int / int without __future__.division (#9426) 2017-07-23 12:11:49 +10:00
Andreas Mueller 334850fa2b Note->Notes, fix underline in multioutput examples (#9416) 2017-07-20 14:01:30 +02:00
Gael Varoquaux 2a1d8ba8f9 MISC: typo in rst 2017-07-17 14:55:14 +02:00
Taehoon Lee 28ad450a43 DOC Fix typos (#9386) 2017-07-17 15:51:46 +10:00
Thomas Moreau cb1b6c4734 FIX t-SNE memory usage and many other optimizer issues (#9032)
Use a sparse matrix representation of the neighbors.
Re-factored the QuadTree implementation to avoid insertion errors.
Various fixes in the gradient descent schedule to get the Barnes Hut and exact solvers to behave more robustly and consistently.
2017-07-12 22:56:02 +02:00
Tom Dupré la Tour e55d0bcba5 FIX broken link in gallery and bad title rendering 2017-07-12 16:37:49 +02:00
Taehoon Lee 27bbdb570b Fix typos (#9320) 2017-07-12 18:05:21 +10:00
(Venkat) Raghav, Rajagopalan a08555a238 [MRG + 2] ENH Allow `cross_val_score`, `GridSearchCV` et al. to evaluate on multiple metrics (#7388)
* ENH cross_val_score now supports multiple metrics

* DOCFIX permutation_test_score

* ENH validate multiple metric scorers

* ENH Move validation of multimetric scoring param out

* ENH GridSearchCV and RandomizedSearchCV now support multiple metrics

* EXA Add an example demonstrating the multiple metric in GridSearchCV

* ENH Let check_multimetric_scoring tell if its multimetric or not

* FIX For single metric name of scorer should remain 'score'

* ENH validation_curve and learning_curve now support multiple metrics

* MNT move _aggregate_score_dicts helper into _validation.py

* TST More testing/ Fixing scores to the correct values

* EXA Add cross_val_score to multimetric example

* Rename to multiple_metric_evaluation.py

* MNT Remove scaffolding

* FIX doctest imports

* FIX wrap the scorer and unwrap the score when using _score() in rfe

* TST Cleanup the tests. Test for is_multimetric too

* TST Make sure it registers as single metric when scoring is of that type

* PEP8

* Don't use dict comprehension to make it work in python2.6

* ENH/FIX/TST grid_scores_ should not be available for multimetric evaluation

* FIX+TST delegated methods NA when multimetric is enabled...

TST Add general tests to GridSearchCV and RandomizedSearchCV

* ENH add option to disable delegation on multimetric scoring

* Remove old function from __all__

* flake8

* FIX revert disable_on_multimetric

* stash

* Fix incorrect rebase

* [ci skip]

* Make sure refit works as expected and remove irrelevant tests

* Allow passing standard scorers by name in multimetric scorers

* Fix example

* flake8

* Address reviews

* Fix indentation

* Ensure {'acc': 'accuracy'} and ['precision'] are valid inputs

* Test that for single metric, 'score' is a key

* Typos

* Fix incorrect rebase

* Compare multimetric grid search with multiple single metric searches

* Test X, y list and pandas input; Test multimetric for unsupervised grid search

* Fix tests; Unsupervised multimetric gs will not pass until #8117 is merged

* Make a plot of Precision vs ROC AUC for RandomForest varying the n_estimators

* Add example to grid_search.rst

* Use the classic tuning of C param in SVM instead of estimators in RF

* FIX Remove scoring arg in deafult scorer test

* flake8

* Search for min_samples_split in DTC; Also show f-score

* REVIEW Make check_multimetric_scoring private

* FIX Add more samples to see if 3% mismatch on 32 bit systems gets fixed

* REVIEW Plot best score; Shorten legends

* REVIEW/COSMIT multimetric --> multi-metric

* REVIEW Mark the best scores of P/R scores too

* Revert "FIX Add more samples to see if 3% mismatch on 32 bit systems gets fixed"

This reverts commit ba766d98353380a186fbc3dade211670ee72726d.

* ENH Use looping for iid testing

* FIX use param grid as scipy's stats dist in 0.12 do not accept seed

* ENH more looping less code; Use small non-noisy dataset

* FIX Use named arg after expanded args

* TST More testing of the refit parameter

* Test that in multimetric search refit to single metric, the delegated methods
  work as expected.
* Test that setting probability=False works with multimetric too
* Test refit=False gives sensible error

* COSMIT multimetric --> multi-metric

* REV Correct example doc

* COSMIT

* REVIEW Make tests stronger; Fix bugs in _check_multimetric_scorer

* REVIEW refit param: Raise for empty strings

* TST Invalid refit params

* REVIEW Use <scorer_name> alone; recall --> Recall

* REV specify when we expect scorers to not be None

* FLAKE8

* REVERT multimetrics in learning_curve and validation_curve

* REVIEW Simpler coding style

* COSMIT

* COSMIT

* REV Compress example a bit. Move comment to top

* FIX fit_grid_point's previous API must be preserved

* Flake8

* TST Use loop; Compare with single-metric

* REVIEW Use dict-comprehension instead of helper

* REVIEW Remove redundant test

* Fix tests incorrect braces

* COSMIT

* REVIEW Use regexp

* REV Simplify aggregation of score dicts

* FIX precision and accuracy test

* FIX doctest and flake8

* TST the best_* attributes multimetric with single metric

* Address @jnothman's review

* Address more comments \o/

* DOCFIXES

* Fix use the validated fit_param from fit's arguments

* Revert alpha to a lower value as before

* Using def instead of lambda

* Address @jnothman's review batch 1: Fix tests / Doc fixes

* Remove superfluous tests

* Remove more superfluous testing

* TST/FIX loop over refit and check found n_clusters

* Cosmetic touches

* Use zip instead of manually listing the keys

* Fix inverse_transform

* FIX bug in fit_grid_point; Allow only single score

TST if fit_grid_point works as intended

* ENH Use only ROC-AUC and F1-score

* Fix typos and flake8; Address Andy's reviews

MNT Add a comment on why we do such a transpose + some fixes

* ENH Better error messages for incorrect multimetric scoring values +...

ENH Avoid exception traceback while using incorrect scoring string

* Dict keys must be of string type only

* 1. Better error message for invalid scoring 2...
Internal functions return single score for single metric scoring

* Fix test failures and shuffle tests

* Avoid wrapping scorer as dict in learning_curve

* Remove doc example as asked for

* Some leftover ones

* Don't wrap scorer in validation_curve either

* Add a doc example and skip it as dict order fails doctest

* Import zip from six for python2.7 compat

* Make cross_val_score return a cv_results-like dict

* Add relevant sections to userguide

* Flake8 fixes

* Add whatsnew and fix broken links

* Use AUC and accuracy instead of f1

* Fix failing doctests cross_validation.rst

* DOC add the wrapper example for metrics that return multiple return values

* Address andy's comments

* Be less weird

* Address more of andy's comments

* Make a separate cross_validate function to return dict and a cross_val_score

* Update the docs to reflect the new cross_validate function

* Add cross_validate to toc-tree

* Add more tests on type of cross_validate return and time limits

* FIX failing doctests

* FIX ensure keys are not plural

* DOC fix

* Address some pending comments

* Remove the comment as it is irrelevant now

* Remove excess blank line

* Fix flake8 inconsistencies

* Allow fit_times to be 0 to conform with windows precision

* DOC specify how refit param is to be set in multiple metric case

* TST ensure cross_validate works for string single metrics + address @jnothman's reviews

* Doc fixes

* Remove the shape and transform parameter of _aggregate_score_dicts

* Address Joel's doc comments

* Fix broken doctest

* Fix the spurious file

* Address Andy's comments

* MNT Remove erroneous entry

* Address Andy's comments

* FIX broken links

* Update whats_new.rst

missing newline
2017-07-07 11:12:31 -04:00
Utkarsh Upadhyay 0dc22798e7 [MRG+1] Fix semi_supervised (#9239)
* Files for my dev environment with Docker

* Fixing label clamping (alpha=0 for hard clamping)

* Deprecating alpha, fixing its value to zero

* Correct way to deprecate alpha for LabelPropagation

The previous way was breaking the test
sklearn.tests.test_common.test_all_estimators

* Detailed info for LabelSpreading's alpha parameter

Based on the original paper.

* Minor changes in the deprecation message

* Improving "deprecated" doc string and raising DeprecationWarning

* Using a local "alpha" in "fit" to deprecate LabelPropagation's alpha

This solution isn't great, but it sets the correct value for alpha
without violating the restrictions imposed by the tests.

* Removal of my development files

* Using sphinx's "deprecated" tag (jnothman's suggestion)

* Deprecation warning: stating that the alpha's value will be ignored

* Use __init__ with alpha=None

* Update what's new

* Try fix RuntimeWarning in test_alpha_deprecation

* DOC Indent deprecation details

* DOC wording

* Update docs

* Change to the one true implementation.

* Add sanity-checked impl. of Label{Propagation,Spreading}

* Raise ValueError if alpha is invalid in LabelSpreading.

* Add a normalizing step before clamping to LabelPropagation.

* Fix flake8 errors.

* Remove duplicate imports.

* DOC Update What's New.

* Specify alpha's value in the error.

* Tidy up tests.

Add a test and add references, where needed.

* Add comment to non-regression test.

* Fix documentation.

* Move check for alpha into fit from __init__.

* Fix corner case of LabelSpreading with alpha=None.

* alpha -> self.variant

* Make Whats_new more explicit.

* Simplify impl. of Label{Propagation,Spreading}.

* variant -> _variant.
2017-07-04 08:20:52 +10:00
Roman Yurchak b46e6382da Custom token processor example (#7286) 2017-07-01 00:04:11 +02:00
Narine Kokhlikyan ae8223356b Add example on t-sne perplexity 2017-06-30 21:10:41 +02:00
Ramana Subramanyam c10c88622a Deprecate randomized_l1 (#9031) 2017-06-30 18:20:25 +02:00
Adam Kleczewski b413299676 [MRG+1] Classifier chain (#7602)
[MRG+2] Classifier chain
2017-06-28 22:34:19 -07:00
Andreas Mueller 5271a193c3 MRG Sphinx fixes (#9155) 2017-06-28 17:00:13 +02:00
Olivier Grisel 87b3165593 ENH more readable iris dots in example 2017-06-28 14:57:45 +02:00
Aarshay Jain a74d31a339 ENH 13 more examples fixed with matplotlib 2.0 (#9029) 2017-06-28 14:56:27 +02:00