8000 Merge pull request #5566 from rvraghav93/mod_sel_doc · scikit-learn/scikit-learn@99530a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99530a3

Browse files
committed
Merge pull request #5566 from rvraghav93/mod_sel_doc
[MRG +1] DOC Modify documentation/examples for the new model_selection module
2 parents ee53acc + f67e911 commit 99530a3

File tree

55 files changed

+364
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+364
-268
lines changed

doc/developers/contributing.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ adheres to the scikit-learn interface and standards by running
794794

795795
The main motivation to make a class compatible to the scikit-learn estimator
796796
interface might be that you want to use it together with model assessment and
797-
selection tools such as :class:`grid_search.GridSearchCV`.
797+
selection tools such as :class:`model_selection.GridSearchCV`.
798798

799799
For this to work, you need to implement the following interface.
800800
If a dependency on scikit-learn is okay for your code,
@@ -856,7 +856,7 @@ implement the interface is::
856856

857857
Parameters and init
858858
-------------------
859-
As :class:`grid_search.GridSearchCV` uses ``set_params``
859+
As :class:`model_selection.GridSearchCV` uses ``set_params``
860860
to apply parameter setting to estimators,
861861
it is essential that calling ``set_params`` has the same effect
862862
as setting parameters using the ``__init__`` method.
@@ -874,9 +874,8 @@ trailing ``_`` is used to check if the estimator has been fitted.
874874

875875
Cloning
876876
-------
877-
For using :class:`grid_search.GridSearch` or any functionality of the
878-
:mod:`cross_validation` module, an estimator must support the ``base.clone``
879-
function to replicate an estimator.
877+
For use with the :mod:`model_selection` module,
878+
an estimator must support the ``base.clone`` function to replicate an estimator.
880879
This can be done by providing a ``get_params`` method.
881880
If ``get_params`` is present, then ``clone(estimator)`` will be an instance of
882881
``type(estimator)`` on which ``set_params`` has been called with clones of
@@ -901,8 +900,8 @@ accepts an optional ``y``.
901900
Estimator types
902901
---------------
903902
Some common functionality depends on the kind of estimator passed.
904-
For example, cross-validation in :class:`grid_search.GridSearchCV` and
905-
:func:`cross_validation.cross_val_score` defaults to being stratified when used
903+
For example, cross-validation in :class:`model_selection.GridSearchCV` and
904+
:func:`model_selection.cross_val_score` defaults to being stratified when used
906905
on a classifier, but not otherwise. Similarly, scorers for average precision
907906
that take a continuous prediction need to call ``decision_function`` for classifiers,
908907
but ``predict`` for regressors. This distinction between classifiers and regressors

doc/model_selection.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ Model selection and evaluation
1111
modules/grid_search
1212
modules/model_evaluation
1313
modules/model_persistence
14-
modules/learning_curve

doc/modules/classes.rst

Lines changed: 53 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -144,45 +144,76 @@ Classes
144144
covariance.graph_lasso
145145

146146

147-
.. _cross_validation_ref:
148-
149-
:mod:`sklearn.cross_validation`: Cross Validation
150-
=================================================
147+
:mod:`sklearn.model_selection`: Model Selection
148+
===============================================
151149

152-
.. automodule:: sklearn.cross_validation
150+
.. automodule:: sklearn.model_selection
153151
:no-members:
154152
:no-inherited-members:
155153

156-
**User guide:** See the :ref:`cross_validation` section for further details.
154+
**User guide:** See the :ref:`cross_validation`, :ref:`grid_search` and
155+
:ref:`learning_curve` sections for further details.
156+
157+
Splitter Classes
158+
----------------
159+
160+
.. currentmodule:: sklearn
161+
162+
.. autosummary::
163+
:toctree: generated/
164+
:template: class.rst
165+
166+
model_selection.KFold
167+
model_selection.LabelKFold
168+
model_selection.StratifiedKFold
169+
model_selection.LeaveOneLabelOut
170+
model_selection.LeavePLabelOut
171+
model_selection.LeaveOneOut
172+
model_selection.LeavePOut
173+
model_selection.ShuffleSplit
174+
model_selection.LabelShuffleSplit
175+
model_selection.StratifiedShuffleSplit
176+
model_selection.PredefinedSplit
177+
178+
Splitter Functions
179+
------------------
180+
181+
.. currentmodule:: sklearn
182+
183+
.. autosummary::
184+
:toctree: generated/
185+
:template: function.rst
186+
187+
model_selection.train_test_split
188+
189+
Hyper-parameter optimizers
190+
--------------------------
157191

158192
.. currentmodule:: sklearn
159193

160194
.. autosummary::
161195
:toctree: generated/
162196
:template: class.rst
163197

164-
cross_validation.KFold
165-
cross_validation.LabelKFold
166-
cross_validation.LabelShuffleSplit
167-
cross_validation.LeaveOneLabelOut
168-
cross_validation.LeaveOneOut
169-
cross_validation.LeavePLabelOut
170-
cross_validation.LeavePOut
171-
cross_validation.PredefinedSplit
172-
cross_validation.ShuffleSplit
173-
cross_validation.StratifiedKFold
174-
cross_validation.StratifiedShuffleSplit
198+
model_selection.GridSearchCV
199+
model_selection.RandomizedSearchCV
200+
model_selection.ParameterGrid
201+
model_selection.ParameterSampler
202+
203+
Model validation
204+
----------------
175205

206+
.. currentmodule:: sklearn
176207

177208
.. autosummary::
178209
:toctree: generated/
179210
:template: function.rst
180211

181-
cross_validation.train_test_split
182-
cross_validation.cross_val_score
183-
cross_validation.cross_val_predict
184-
cross_validation.permutation_test_score
185-
cross_validation.check_cv
212+
model_selection.cross_val_score
213+
model_selection.cross_val_predict
214+
model_selection.permutation_test_score
215+
model_selection.learning_curve
216+
model_selection.validation_curve
186217

187218
.. _datasets_ref:
188219

@@ -547,29 +578,6 @@ Kernels:
547578
gaussian_process.kernels.CompoundKernel
548579
gaussian_process.kernels.Hyperparameter
549580

550-
.. _grid_search_ref:
551-
552-
:mod:`sklearn.grid_search`: Grid Search
553-
=======================================
554-
555-
.. automodule:: sklearn.grid_search
556-
:no-members:
557-
:no-inherited-members:
558-
559-
**User guide:** See the :ref:`grid_search` section for further details.
560-
561-
.. currentmodule:: sklearn
562-
563-
.. autosummary::
564-
:toctree: generated/
565-
:template: class.rst
566-
567-
grid_search.GridSearchCV
568-
grid_search.ParameterGrid
569-
grid_search.ParameterSampler
570-
grid_search.RandomizedSearchCV
571-
572-
573581
.. _isotonic_ref:
574582

575583
:mod:`sklearn.isotonic`: Isotonic regression
@@ -658,24 +666,6 @@ Kernels:
658666
discriminant_analysis.QuadraticDiscriminantAnalysis
659667

660668

661-
.. _learning_curve_ref:
662-
663-
:mod:`sklearn.learning_curve` Learning curve evaluation
664-
=======================================================
665-
666-
.. automodule:: sklearn.learning_curve
667-
:no-members:
668-
:no-inherited-members:
669-
670-
.. currentmodule:: sklearn
671-
672-
.. autosummary::
673-
:toctree: generated/
674-
:template: function.rst
675-
676-
learning_curve.learning_curve
677-
learning_curve.validation_curve
678-
679669
.. _linear_model_ref:
680670

681671
:mod:`sklearn.linear_model`: Generalized Linear Models

0 commit comments

Comments
 (0)
0