8000 DOC Modify documentation/examples for the new model_selection module · scikit-learn/scikit-learn@cff6258 · GitHub
[go: up one dir, main page]

Skip to content

Commit cff6258

Browse files
committed
DOC Modify documentation/examples for the new model_selection module
1 parent 3f8743f commit cff6258

File tree

55 files changed

+385
-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

+385
-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: 74 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
=============
23
API Reference
34
=============
@@ -144,45 +145,96 @@ Classes
144145
covariance.graph_lasso
145146

146147

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

152-
.. automodule:: sklearn.cross_validation
151+
.. automodule:: sklearn.model_selection
153152
:no-members:
154153
:no-inherited-members:
155154

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

158193
.. currentmodule:: sklearn
159194

160195
.. autosummary::
161196
:toctree: generated/
162197
:template: class.rst
163198

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
199+
model_selection.GridSearchCV
200+
model_selection.RandomizedSearchCV
175201

202+
Parameter search utilites
203+
-------------------------
204+
205+
.. currentmodule:: sklearn
206+
207+
.. autosummary::
208+
:toctree: generated/
209+
:template: class.rst
210+
211+
model_selection.ParameterGrid
212+
model_selection.ParameterSampler
213+
214+
Scorers
215+
-------
216+
217+
.. currentmodule:: sklearn
176218

177219
.. autosummary::
178220
:toctree: generated/
179221
:template: function.rst
180222

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
223+
model_selection.cross_val_score
224+
model_selection.cross_val_predict
225+
model_selection.permutation_test_score
226+
model_selection.check_cv
227+
228+
Diagnostic utilities to evaluate the Bias-Variance trade-off
229+
------------------------------------------------------------
230+
231+
.. currentmodule:: sklearn
232+
233+
.. autosummary::
234+
:toctree: generated/
235+
:template: function.rst
236+
model_selection.learning_curve
237+
model_selection.validation_curve
186238

187239
.. _datasets_ref:
188240

@@ -545,29 +597,6 @@ Kernels:
545597
gaussian_process.kernels.CompoundKernel
546598
gaussian_process.kernels.Hyperparameter
547599

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

573602
:mod:`sklearn.isotonic`: Isotonic regression
@@ -656,24 +685,6 @@ Kernels:
656685
discriminant_analysis.QuadraticDiscriminantAnalysis
657686

658687

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

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

0 commit comments

Comments
 (0)
0