diff --git a/.gitignore b/.gitignore
index 770f0b84f074a..2bbb3923b74f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ sklearn/**/*.html
dist/
MANIFEST
+doc/api/
doc/sg_execution_times.rst
doc/_build/
doc/auto_examples/
diff --git a/build_tools/circle/build_doc.sh b/build_tools/circle/build_doc.sh
index 35fee3ae50b65..0b0ca94116a9a 100755
--- a/build_tools/circle/build_doc.sh
+++ b/build_tools/circle/build_doc.sh
@@ -244,7 +244,7 @@ then
(
echo '
'
echo "$affected" | sed 's|.*|- & [dev, stable]
|'
- echo '
General: Home | API Reference | Examples
'
+ echo 'General: Home | API Reference | Examples
'
echo 'Sphinx Warnings in affected files'
echo "$warnings" | sed 's/\/home\/circleci\/project\//- /g'
echo '
'
diff --git a/doc/Makefile b/doc/Makefile
index 44f02585f6205..336c0d8f50eb9 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -50,6 +50,7 @@ clean:
-rm -rf auto_examples/
-rm -rf generated/*
-rm -rf modules/generated/
+ -rm -rf api/
# Default to SPHINX_NUMJOBS=1 for full documentation build. Using
# SPHINX_NUMJOBS!=1 may actually slow down the build, or cause weird issues in
diff --git a/doc/conf.py b/doc/conf.py
index c0846cb9ae29e..d9ce3d795f9f2 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -284,6 +284,7 @@
# redirects dictionary maps from old links to new links
redirects = {
"documentation": "index",
+ "modules/classes": "api/index",
"auto_examples/feature_selection/plot_permutation_test_for_classification": (
"auto_examples/model_selection/plot_permutation_tests_for_classification"
),
@@ -602,7 +603,7 @@ def filter_search_index(app, exception):
f.write(searchindex_text)
-def generate_min_dependency_table(app):
+def generate_min_dependency_table():
"""Generate min dependency table for docs."""
from sklearn._min_dependencies import dependent_packages
@@ -652,7 +653,7 @@ def generate_min_dependency_table(app):
f.write(output)
-def generate_min_dependency_substitutions(app):
+def generate_min_dependency_substitutions():
"""Generate min dependency substitutions for docs."""
from sklearn._min_dependencies import dependent_packages
@@ -669,6 +670,60 @@ def generate_min_dependency_substitutions(app):
f.write(output)
+def generate_api_reference():
+ from sklearn._api_reference import (
+ API_REFERENCE,
+ DEPRECATED_API_REFERENCE,
+ get_api_reference_rst,
+ get_deprecated_api_reference_rst,
+ )
+
+ # Create the directory if it does not already exist
+ api_dir = Path(".") / "api"
+ api_dir.mkdir(exist_ok=True)
+
+ # Write API reference for each module
+ for module in API_REFERENCE:
+ with (api_dir / f"{module}.rst").open("w") as f:
+ f.write(get_api_reference_rst(module))
+
+ # Write the API reference index page
+ with (api_dir / "index.rst").open("w") as f:
+ f.write(".. _api_ref:\n\n")
+ f.write("=============\n")
+ f.write("API Reference\n")
+ f.write("=============\n\n")
+ f.write(
+ "This is the class and function reference of scikit-learn. Please refer to "
+ "the :ref:`full user guide ` for further details, as the raw "
+ "specifications of classes and functions may not be enough to give full "
+ "guidelines on their uses. For reference on concepts repeated across the"
+ "API, see :ref:`glossary`.\n\n"
+ )
+
+ # Define the toctree
+ f.write(".. toctree::\n")
+ f.write(" :maxdepth: 2\n")
+ f.write(" :hidden:\n\n")
+ sorted_module_names = sorted(API_REFERENCE)
+ for module_name in sorted_module_names:
+ f.write(f" {module_name}\n")
+ f.write("\n")
+
+ # Write the module table
+ f.write(".. list-table::\n\n")
+ for module_name in sorted_module_names:
+ f.write(f" * - :mod:`{module_name}`\n")
+ f.write(f" - {API_REFERENCE[module_name]['short_summary']}\n\n")
+
+ # Write deprecated API
+ if DEPRECATED_API_REFERENCE:
+ f.write("Recently deprecated\n")
+ f.write("===================\n\n")
+ for ver in sorted(DEPRECATED_API_REFERENCE, key=parse, reverse=True):
+ f.write(get_deprecated_api_reference_rst(ver))
+
+
# Config for sphinx_issues
# we use the issues path for PRs since the issues URL will forward
@@ -684,8 +739,6 @@ def setup(app):
# do not run the examples when using linkcheck by using a small priority
# (default priority is 500 and sphinx-gallery using builder-inited event too)
app.connect("builder-inited", disable_plot_gallery_for_linkcheck, priority=50)
- app.connect("builder-inited", generate_min_dependency_table)
- app.connect("builder-inited", generate_min_dependency_substitutions)
# to hide/show the prompt in code examples:
app.connect("build-finished", make_carousel_thumbs)
@@ -822,3 +875,9 @@ def setup(app):
linkcheck_request_headers = {
"https://github.com/": {"Authorization": f"token {github_token}"},
}
+
+
+# Write the files in advance to avoid any potential conflict with other extensions
+generate_min_dependency_table()
+generate_min_dependency_substitutions()
+generate_api_reference()
diff --git a/doc/contents.rst b/doc/contents.rst
index a28634621d558..b0d6deeaf8837 100644
--- a/doc/contents.rst
+++ b/doc/contents.rst
@@ -20,5 +20,5 @@ Table Of Contents
user_guide
glossary
auto_examples/index
- modules/classes
+ api/index
developers/index
diff --git a/doc/make.bat b/doc/make.bat
index b7e269a6a7836..abe216331701a 100644
--- a/doc/make.bat
+++ b/doc/make.bat
@@ -31,6 +31,9 @@ if "%1" == "help" (
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
+ if exist api\ (
+ rmdir /q /s api
+ )
goto end
)
diff --git a/doc/modules/classes.rst b/doc/modules/classes.rst
deleted file mode 100644
index 55336389f93d5..0000000000000
--- a/doc/modules/classes.rst
+++ /dev/null
@@ -1,1904 +0,0 @@
-.. _api_ref:
-
-=============
-API Reference
-=============
-
-This is the class and function reference of scikit-learn. Please refer to
-the :ref:`full user guide ` for further details, as the class and
-function raw specifications may not be enough to give full guidelines on their
-uses.
-For reference on concepts repeated across the API, see :ref:`glossary`.
-
-:mod:`sklearn`: Settings and information tools
-==============================================
-
-.. automodule:: sklearn
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- config_context
- get_config
- set_config
- show_versions
-
-:mod:`sklearn.base`: Base classes and utility functions
-=======================================================
-
-.. automodule:: sklearn.base
- :no-members:
- :no-inherited-members:
-
-Base classes
-------------
-.. currentmodule:: sklearn
-
-.. autosummary::
- :nosignatures:
- :toctree: generated/
- :template: class.rst
-
- base.BaseEstimator
- base.BiclusterMixin
- base.ClassifierMixin
- base.ClusterMixin
- base.DensityMixin
- base.RegressorMixin
- base.TransformerMixin
- base.MetaEstimatorMixin
- base.OneToOneFeatureMixin
- base.OutlierMixin
- base.ClassNamePrefixFeaturesOutMixin
- feature_selection.SelectorMixin
-
-Functions
----------
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- base.clone
- base.is_classifier
- base.is_regressor
-
-.. _calibration_ref:
-
-:mod:`sklearn.calibration`: Probability Calibration
-===================================================
-
-.. automodule:: sklearn.calibration
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`calibration` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- calibration.CalibratedClassifierCV
-
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- calibration.calibration_curve
-
-.. _cluster_ref:
-
-:mod:`sklearn.cluster`: Clustering
-==================================
-
-.. automodule:: sklearn.cluster
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`clustering` and :ref:`biclustering` sections for
-further details.
-
-Classes
--------
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- cluster.AffinityPropagation
- cluster.AgglomerativeClustering
- cluster.Birch
- cluster.DBSCAN
- cluster.HDBSCAN
- cluster.FeatureAgglomeration
- cluster.KMeans
- cluster.BisectingKMeans
- cluster.MiniBatchKMeans
- cluster.MeanShift
- cluster.OPTICS
- cluster.SpectralClustering
- cluster.SpectralBiclustering
- cluster.SpectralCoclustering
-
-Functions
----------
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- cluster.affinity_propagation
- cluster.cluster_optics_dbscan
- cluster.cluster_optics_xi
- cluster.compute_optics_graph
- cluster.dbscan
- cluster.estimate_bandwidth
- cluster.k_means
- cluster.kmeans_plusplus
- cluster.mean_shift
- cluster.spectral_clustering
- cluster.ward_tree
-
-.. _compose_ref:
-
-:mod:`sklearn.compose`: Composite Estimators
-============================================
-
-.. automodule:: sklearn.compose
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`combining_estimators` section for further
-details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- compose.ColumnTransformer
- compose.TransformedTargetRegressor
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- compose.make_column_transformer
- compose.make_column_selector
-
-.. _covariance_ref:
-
-:mod:`sklearn.covariance`: Covariance Estimators
-================================================
-
-.. automodule:: sklearn.covariance
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`covariance` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- covariance.EmpiricalCovariance
- covariance.EllipticEnvelope
- covariance.GraphicalLasso
- covariance.GraphicalLassoCV
- covariance.LedoitWolf
- covariance.MinCovDet
- covariance.OAS
- covariance.ShrunkCovariance
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- covariance.empirical_covariance
- covariance.graphical_lasso
- covariance.ledoit_wolf
- covariance.ledoit_wolf_shrinkage
- covariance.oas
- covariance.shrunk_covariance
-
-.. _cross_decomposition_ref:
-
-:mod:`sklearn.cross_decomposition`: Cross decomposition
-=======================================================
-
-.. automodule:: sklearn.cross_decomposition
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`cross_decomposition` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- cross_decomposition.CCA
- cross_decomposition.PLSCanonical
- cross_decomposition.PLSRegression
- cross_decomposition.PLSSVD
-
-.. _datasets_ref:
-
-:mod:`sklearn.datasets`: Datasets
-=================================
-
-.. automodule:: sklearn.datasets
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`datasets` section for further details.
-
-Loaders
--------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- datasets.clear_data_home
- datasets.dump_svmlight_file
- datasets.fetch_20newsgroups
- datasets.fetch_20newsgroups_vectorized
- datasets.fetch_california_housing
- datasets.fetch_covtype
- datasets.fetch_kddcup99
- datasets.fetch_lfw_pairs
- datasets.fetch_lfw_people
- datasets.fetch_olivetti_faces
- datasets.fetch_openml
- datasets.fetch_rcv1
- datasets.fetch_species_distributions
- datasets.get_data_home
- datasets.load_breast_cancer
- datasets.load_diabetes
- datasets.load_digits
- datasets.load_files
- datasets.load_iris
- datasets.load_linnerud
- datasets.load_sample_image
- datasets.load_sample_images
- datasets.load_svmlight_file
- datasets.load_svmlight_files
- datasets.load_wine
-
-Samples generator
------------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- datasets.make_biclusters
- datasets.make_blobs
- datasets.make_checkerboard
- datasets.make_circles
- datasets.make_classification
- datasets.make_friedman1
- datasets.make_friedman2
- datasets.make_friedman3
- datasets.make_gaussian_quantiles
- datasets.make_hastie_10_2
- datasets.make_low_rank_matrix
- datasets.make_moons
- datasets.make_multilabel_classification
- datasets.make_regression
- datasets.make_s_curve
- datasets.make_sparse_coded_signal
- datasets.make_sparse_spd_matrix
- datasets.make_sparse_uncorrelated
- datasets.make_spd_matrix
- datasets.make_swiss_roll
-
-
-.. _decomposition_ref:
-
-:mod:`sklearn.decomposition`: Matrix Decomposition
-==================================================
-
-.. automodule:: sklearn.decomposition
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`decompositions` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- decomposition.DictionaryLearning
- decomposition.FactorAnalysis
- decomposition.FastICA
- decomposition.IncrementalPCA
- decomposition.KernelPCA
- decomposition.LatentDirichletAllocation
- decomposition.MiniBatchDictionaryLearning
- decomposition.MiniBatchSparsePCA
- decomposition.NMF
- decomposition.MiniBatchNMF
- decomposition.PCA
- decomposition.SparsePCA
- decomposition.SparseCoder
- decomposition.TruncatedSVD
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- decomposition.dict_learning
- decomposition.dict_learning_online
- decomposition.fastica
- decomposition.non_negative_factorization
- decomposition.sparse_encode
-
-.. _lda_ref:
-
-:mod:`sklearn.discriminant_analysis`: Discriminant Analysis
-===========================================================
-
-.. automodule:: sklearn.discriminant_analysis
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`lda_qda` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- discriminant_analysis.LinearDiscriminantAnalysis
- discriminant_analysis.QuadraticDiscriminantAnalysis
-
-.. _dummy_ref:
-
-:mod:`sklearn.dummy`: Dummy estimators
-======================================
-
-.. automodule:: sklearn.dummy
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`model_evaluation` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- dummy.DummyClassifier
- dummy.DummyRegressor
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
-.. _ensemble_ref:
-
-:mod:`sklearn.ensemble`: Ensemble Methods
-=========================================
-
-.. automodule:: sklearn.ensemble
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`ensemble` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- ensemble.AdaBoostClassifier
- ensemble.AdaBoostRegressor
- ensemble.BaggingClassifier
- ensemble.BaggingRegressor
- ensemble.ExtraTreesClassifier
- ensemble.ExtraTreesRegressor
- ensemble.GradientBoostingClassifier
- ensemble.GradientBoostingRegressor
- ensemble.IsolationForest
- ensemble.RandomForestClassifier
- ensemble.RandomForestRegressor
- ensemble.RandomTreesEmbedding
- ensemble.StackingClassifier
- ensemble.StackingRegressor
- ensemble.VotingClassifier
- ensemble.VotingRegressor
- ensemble.HistGradientBoostingRegressor
- ensemble.HistGradientBoostingClassifier
-
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
-
-.. _exceptions_ref:
-
-:mod:`sklearn.exceptions`: Exceptions and warnings
-==================================================
-
-.. automodule:: sklearn.exceptions
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- exceptions.ConvergenceWarning
- exceptions.DataConversionWarning
- exceptions.DataDimensionalityWarning
- exceptions.EfficiencyWarning
- exceptions.FitFailedWarning
- exceptions.InconsistentVersionWarning
- exceptions.NotFittedError
- exceptions.UndefinedMetricWarning
-
-
-:mod:`sklearn.experimental`: Experimental
-=========================================
-
-.. automodule:: sklearn.experimental
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
-
- experimental.enable_iterative_imputer
- experimental.enable_halving_search_cv
-
-
-.. _feature_extraction_ref:
-
-:mod:`sklearn.feature_extraction`: Feature Extraction
-=====================================================
-
-.. automodule:: sklearn.feature_extraction
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`feature_extraction` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- feature_extraction.DictVectorizer
- feature_extraction.FeatureHasher
-
-From images
------------
-
-.. automodule:: sklearn.feature_extraction.image
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- feature_extraction.image.extract_patches_2d
- feature_extraction.image.grid_to_graph
- feature_extraction.image.img_to_graph
- feature_extraction.image.reconstruct_from_patches_2d
-
- :template: class.rst
-
- feature_extraction.image.PatchExtractor
-
-.. _text_feature_extraction_ref:
-
-From text
----------
-
-.. automodule:: sklearn.feature_extraction.text
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- feature_extraction.text.CountVectorizer
- feature_extraction.text.HashingVectorizer
- feature_extraction.text.TfidfTransformer
- feature_extraction.text.TfidfVectorizer
-
-
-.. _feature_selection_ref:
-
-:mod:`sklearn.feature_selection`: Feature Selection
-===================================================
-
-.. automodule:: sklearn.feature_selection
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`feature_selection` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- feature_selection.GenericUnivariateSelect
- feature_selection.SelectPercentile
- feature_selection.SelectKBest
- feature_selection.SelectFpr
- feature_selection.SelectFdr
- feature_selection.SelectFromModel
- feature_selection.SelectFwe
- feature_selection.SequentialFeatureSelector
- feature_selection.RFE
- feature_selection.RFECV
- feature_selection.VarianceThreshold
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- feature_selection.chi2
- feature_selection.f_classif
- feature_selection.f_regression
- feature_selection.r_regression
- feature_selection.mutual_info_classif
- feature_selection.mutual_info_regression
-
-
-.. _gaussian_process_ref:
-
-:mod:`sklearn.gaussian_process`: Gaussian Processes
-===================================================
-
-.. automodule:: sklearn.gaussian_process
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`gaussian_process` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- gaussian_process.GaussianProcessClassifier
- gaussian_process.GaussianProcessRegressor
-
-Kernels
--------
-
-.. automodule:: sklearn.gaussian_process.kernels
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class_with_call.rst
-
- gaussian_process.kernels.CompoundKernel
- gaussian_process.kernels.ConstantKernel
- gaussian_process.kernels.DotProduct
- gaussian_process.kernels.ExpSineSquared
- gaussian_process.kernels.Exponentiation
- gaussian_process.kernels.Hyperparameter
- gaussian_process.kernels.Kernel
- gaussian_process.kernels.Matern
- gaussian_process.kernels.PairwiseKernel
- gaussian_process.kernels.Product
- gaussian_process.kernels.RBF
- gaussian_process.kernels.RationalQuadratic
- gaussian_process.kernels.Sum
- gaussian_process.kernels.WhiteKernel
-
-
-.. _impute_ref:
-
-:mod:`sklearn.impute`: Impute
-=============================
-
-.. automodule:: sklearn.impute
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`Impute` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- impute.SimpleImputer
- impute.IterativeImputer
- impute.MissingIndicator
- impute.KNNImputer
-
-
-.. _inspection_ref:
-
-:mod:`sklearn.inspection`: Inspection
-=====================================
-
-.. automodule:: sklearn.inspection
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- inspection.partial_dependence
- inspection.permutation_importance
-
-Plotting
---------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: display_only_from_estimator.rst
-
- inspection.DecisionBoundaryDisplay
- inspection.PartialDependenceDisplay
-
-.. _isotonic_ref:
-
-:mod:`sklearn.isotonic`: Isotonic regression
-============================================
-
-.. automodule:: sklearn.isotonic
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`isotonic` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- isotonic.IsotonicRegression
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- isotonic.check_increasing
- isotonic.isotonic_regression
-
-
-.. _kernel_approximation_ref:
-
-:mod:`sklearn.kernel_approximation`: Kernel Approximation
-=========================================================
-
-.. automodule:: sklearn.kernel_approximation
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`kernel_approximation` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- kernel_approximation.AdditiveChi2Sampler
- kernel_approximation.Nystroem
- kernel_approximation.PolynomialCountSketch
- kernel_approximation.RBFSampler
- kernel_approximation.SkewedChi2Sampler
-
-.. _kernel_ridge_ref:
-
-:mod:`sklearn.kernel_ridge`: Kernel Ridge Regression
-====================================================
-
-.. automodule:: sklearn.kernel_ridge
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`kernel_ridge` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- kernel_ridge.KernelRidge
-
-.. _linear_model_ref:
-
-:mod:`sklearn.linear_model`: Linear Models
-==========================================
-
-.. automodule:: sklearn.linear_model
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`linear_model` section for further details.
-
-The following subsections are only rough guidelines: the same estimator can
-fall into multiple categories, depending on its parameters.
-
-.. currentmodule:: sklearn
-
-Linear classifiers
-------------------
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.LogisticRegression
- linear_model.LogisticRegressionCV
- linear_model.PassiveAggressiveClassifier
- linear_model.Perceptron
- linear_model.RidgeClassifier
- linear_model.RidgeClassifierCV
- linear_model.SGDClassifier
- linear_model.SGDOneClassSVM
-
-Classical linear regressors
----------------------------
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.LinearRegression
- linear_model.Ridge
- linear_model.RidgeCV
- linear_model.SGDRegressor
-
-Regressors with variable selection
-----------------------------------
-
-The following estimators have built-in variable selection fitting
-procedures, but any estimator using a L1 or elastic-net penalty also
-performs variable selection: typically :class:`~linear_model.SGDRegressor`
-or :class:`~sklearn.linear_model.SGDClassifier` with an appropriate penalty.
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.ElasticNet
- linear_model.ElasticNetCV
- linear_model.Lars
- linear_model.LarsCV
- linear_model.Lasso
- linear_model.LassoCV
- linear_model.LassoLars
- linear_model.LassoLarsCV
- linear_model.LassoLarsIC
- linear_model.OrthogonalMatchingPursuit
- linear_model.OrthogonalMatchingPursuitCV
-
-Bayesian regressors
--------------------
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.ARDRegression
- linear_model.BayesianRidge
-
-Multi-task linear regressors with variable selection
-----------------------------------------------------
-
-These estimators fit multiple regression problems (or tasks) jointly, while
-inducing sparse coefficients. While the inferred coefficients may differ
-between the tasks, they are constrained to agree on the features that are
-selected (non-zero coefficients).
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.MultiTaskElasticNet
- linear_model.MultiTaskElasticNetCV
- linear_model.MultiTaskLasso
- linear_model.MultiTaskLassoCV
-
-Outlier-robust regressors
--------------------------
-
-Any estimator using the Huber loss would also be robust to outliers, e.g.
-:class:`~linear_model.SGDRegressor` with ``loss='huber'``.
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.HuberRegressor
- linear_model.QuantileRegressor
- linear_model.RANSACRegressor
- linear_model.TheilSenRegressor
-
-Generalized linear models (GLM) for regression
-----------------------------------------------
-
-These models allow for response variables to have error distributions other
-than a normal distribution:
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- linear_model.PoissonRegressor
- linear_model.TweedieRegressor
- linear_model.GammaRegressor
-
-
-Miscellaneous
--------------
-
-.. autosummary::
- :toctree: generated/
- :template: classes.rst
-
- linear_model.PassiveAggressiveRegressor
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- linear_model.enet_path
- linear_model.lars_path
- linear_model.lars_path_gram
- linear_model.lasso_path
- linear_model.orthogonal_mp
- linear_model.orthogonal_mp_gram
- linear_model.ridge_regression
-
-
-.. _manifold_ref:
-
-:mod:`sklearn.manifold`: Manifold Learning
-==========================================
-
-.. automodule:: sklearn.manifold
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`manifold` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated
- :template: class.rst
-
- manifold.Isomap
- manifold.LocallyLinearEmbedding
- manifold.MDS
- manifold.SpectralEmbedding
- manifold.TSNE
-
-.. autosummary::
- :toctree: generated
- :template: function.rst
-
- manifold.locally_linear_embedding
- manifold.smacof
- manifold.spectral_embedding
- manifold.trustworthiness
-
-
-.. _metrics_ref:
-
-:mod:`sklearn.metrics`: Metrics
-===============================
-
-See the :ref:`model_evaluation` section and the :ref:`metrics` section of the
-user guide for further details.
-
-.. automodule:: sklearn.metrics
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-Model Selection Interface
--------------------------
-See the :ref:`scoring_parameter` section of the user guide for further
-details.
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.check_scoring
- metrics.get_scorer
- metrics.get_scorer_names
- metrics.make_scorer
-
-Classification metrics
-----------------------
-
-See the :ref:`classification_metrics` section of the user guide for further
-details.
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.accuracy_score
- metrics.auc
- metrics.average_precision_score
- metrics.balanced_accuracy_score
- metrics.brier_score_loss
- metrics.class_likelihood_ratios
- metrics.classification_report
- metrics.cohen_kappa_score
- metrics.confusion_matrix
- metrics.dcg_score
- metrics.det_curve
- metrics.f1_score
- metrics.fbeta_score
- metrics.hamming_loss
- metrics.hinge_loss
- metrics.jaccard_score
- metrics.log_loss
- metrics.matthews_corrcoef
- metrics.multilabel_confusion_matrix
- metrics.ndcg_score
- metrics.precision_recall_curve
- metrics.precision_recall_fscore_support
- metrics.precision_score
- metrics.recall_score
- metrics.roc_auc_score
- metrics.roc_curve
- metrics.top_k_accuracy_score
- metrics.zero_one_loss
-
-Regression metrics
-------------------
-
-See the :ref:`regression_metrics` section of the user guide for further
-details.
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.explained_variance_score
- metrics.max_error
- metrics.mean_absolute_error
- metrics.mean_squared_error
- metrics.mean_squared_log_error
- metrics.median_absolute_error
- metrics.mean_absolute_percentage_error
- metrics.r2_score
- metrics.root_mean_squared_log_error
- metrics.root_mean_squared_error
- metrics.mean_poisson_deviance
- metrics.mean_gamma_deviance
- metrics.mean_tweedie_deviance
- metrics.d2_tweedie_score
- metrics.mean_pinball_loss
- metrics.d2_pinball_score
- metrics.d2_absolute_error_score
-
-Multilabel ranking metrics
---------------------------
-See the :ref:`multilabel_ranking_metrics` section of the user guide for further
-details.
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.coverage_error
- metrics.label_ranking_average_precision_score
- metrics.label_ranking_loss
-
-
-Clustering metrics
-------------------
-
-See the :ref:`clustering_evaluation` section of the user guide for further
-details.
-
-.. automodule:: sklearn.metrics.cluster
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.adjusted_mutual_info_score
- metrics.adjusted_rand_score
- metrics.calinski_harabasz_score
- metrics.davies_bouldin_score
- metrics.completeness_score
- metrics.cluster.contingency_matrix
- metrics.cluster.pair_confusion_matrix
- metrics.fowlkes_mallows_score
- metrics.homogeneity_completeness_v_measure
- metrics.homogeneity_score
- metrics.mutual_info_score
- metrics.normalized_mutual_info_score
- metrics.rand_score
- metrics.silhouette_score
- metrics.silhouette_samples
- metrics.v_measure_score
-
-Biclustering metrics
---------------------
-
-See the :ref:`biclustering_evaluation` section of the user guide for
-further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.consensus_score
-
-Distance metrics
-----------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- metrics.DistanceMetric
-
-Pairwise metrics
-----------------
-
-See the :ref:`metrics` section of the user guide for further details.
-
-.. automodule:: sklearn.metrics.pairwise
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- metrics.pairwise.additive_chi2_kernel
- metrics.pairwise.chi2_kernel
- metrics.pairwise.cosine_similarity
- metrics.pairwise.cosine_distances
- metrics.pairwise.distance_metrics
- metrics.pairwise.euclidean_distances
- metrics.pairwise.haversine_distances
- metrics.pairwise.kernel_metrics
- metrics.pairwise.laplacian_kernel
- metrics.pairwise.linear_kernel
- metrics.pairwise.manhattan_distances
- metrics.pairwise.nan_euclidean_distances
- metrics.pairwise.pairwise_kernels
- metrics.pairwise.polynomial_kernel
- metrics.pairwise.rbf_kernel
- metrics.pairwise.sigmoid_kernel
- metrics.pairwise.paired_euclidean_distances
- metrics.pairwise.paired_manhattan_distances
- metrics.pairwise.paired_cosine_distances
- metrics.pairwise.paired_distances
- metrics.pairwise_distances
- metrics.pairwise_distances_argmin
- metrics.pairwise_distances_argmin_min
- metrics.pairwise_distances_chunked
-
-
-Plotting
---------
-
-See the :ref:`visualizations` section of the user guide for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: display_all_class_methods.rst
-
- metrics.ConfusionMatrixDisplay
- metrics.DetCurveDisplay
- metrics.PrecisionRecallDisplay
- metrics.PredictionErrorDisplay
- metrics.RocCurveDisplay
- calibration.CalibrationDisplay
-
-.. _mixture_ref:
-
-:mod:`sklearn.mixture`: Gaussian Mixture Models
-===============================================
-
-.. automodule:: sklearn.mixture
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`mixture` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- mixture.BayesianGaussianMixture
- mixture.GaussianMixture
-
-.. _modelselection_ref:
-
-:mod:`sklearn.model_selection`: Model Selection
-===============================================
-
-.. automodule:: sklearn.model_selection
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`cross_validation`, :ref:`grid_search` and
-:ref:`learning_curve` sections for further details.
-
-Splitter Classes
-----------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- model_selection.GroupKFold
- model_selection.GroupShuffleSplit
- model_selection.KFold
- model_selection.LeaveOneGroupOut
- model_selection.LeavePGroupsOut
- model_selection.LeaveOneOut
- model_selection.LeavePOut
- model_selection.PredefinedSplit
- model_selection.RepeatedKFold
- model_selection.RepeatedStratifiedKFold
- model_selection.ShuffleSplit
- model_selection.StratifiedKFold
- model_selection.StratifiedShuffleSplit
- model_selection.StratifiedGroupKFold
- model_selection.TimeSeriesSplit
-
-Splitter Functions
-------------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- model_selection.check_cv
- model_selection.train_test_split
-
-.. _hyper_parameter_optimizers:
-
-Hyper-parameter optimizers
---------------------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- model_selection.GridSearchCV
- model_selection.HalvingGridSearchCV
- model_selection.ParameterGrid
- model_selection.ParameterSampler
- model_selection.RandomizedSearchCV
- model_selection.HalvingRandomSearchCV
-
-
-Model validation
-----------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- model_selection.cross_validate
- model_selection.cross_val_predict
- model_selection.cross_val_score
- model_selection.learning_curve
- model_selection.permutation_test_score
- model_selection.validation_curve
-
-Visualization
--------------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: display_only_from_estimator.rst
-
- model_selection.LearningCurveDisplay
- model_selection.ValidationCurveDisplay
-
-.. _multiclass_ref:
-
-:mod:`sklearn.multiclass`: Multiclass classification
-====================================================
-
-.. automodule:: sklearn.multiclass
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`multiclass_classification` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- multiclass.OneVsRestClassifier
- multiclass.OneVsOneClassifier
- multiclass.OutputCodeClassifier
-
-.. _multioutput_ref:
-
-:mod:`sklearn.multioutput`: Multioutput regression and classification
-=====================================================================
-
-.. automodule:: sklearn.multioutput
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`multilabel_classification`,
-:ref:`multiclass_multioutput_classification`, and
-:ref:`multioutput_regression` sections for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated
- :template: class.rst
-
- multioutput.ClassifierChain
- multioutput.MultiOutputRegressor
- multioutput.MultiOutputClassifier
- multioutput.RegressorChain
-
-.. _naive_bayes_ref:
-
-:mod:`sklearn.naive_bayes`: Naive Bayes
-=======================================
-
-.. automodule:: sklearn.naive_bayes
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`naive_bayes` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- naive_bayes.BernoulliNB
- naive_bayes.CategoricalNB
- naive_bayes.ComplementNB
- naive_bayes.GaussianNB
- naive_bayes.MultinomialNB
-
-
-.. _neighbors_ref:
-
-:mod:`sklearn.neighbors`: Nearest Neighbors
-===========================================
-
-.. automodule:: sklearn.neighbors
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`neighbors` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- neighbors.BallTree
- neighbors.KDTree
- neighbors.KernelDensity
- neighbors.KNeighborsClassifier
- neighbors.KNeighborsRegressor
- neighbors.KNeighborsTransformer
- neighbors.LocalOutlierFactor
- neighbors.RadiusNeighborsClassifier
- neighbors.RadiusNeighborsRegressor
- neighbors.RadiusNeighborsTransformer
- neighbors.NearestCentroid
- neighbors.NearestNeighbors
- neighbors.NeighborhoodComponentsAnalysis
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- neighbors.kneighbors_graph
- neighbors.radius_neighbors_graph
- neighbors.sort_graph_by_row_values
-
-.. _neural_network_ref:
-
-:mod:`sklearn.neural_network`: Neural network models
-====================================================
-
-.. automodule:: sklearn.neural_network
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`neural_networks_supervised` and :ref:`neural_networks_unsupervised` sections for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- neural_network.BernoulliRBM
- neural_network.MLPClassifier
- neural_network.MLPRegressor
-
-.. _pipeline_ref:
-
-:mod:`sklearn.pipeline`: Pipeline
-=================================
-
-.. automodule:: sklearn.pipeline
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`combining_estimators` section for further
-details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- pipeline.FeatureUnion
- pipeline.Pipeline
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- pipeline.make_pipeline
- pipeline.make_union
-
-.. _preprocessing_ref:
-
-:mod:`sklearn.preprocessing`: Preprocessing and Normalization
-=============================================================
-
-.. automodule:: sklearn.preprocessing
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`preprocessing` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- preprocessing.Binarizer
- preprocessing.FunctionTransformer
- preprocessing.KBinsDiscretizer
- preprocessing.KernelCenterer
- preprocessing.LabelBinarizer
- preprocessing.LabelEncoder
- preprocessing.MultiLabelBinarizer
- preprocessing.MaxAbsScaler
- preprocessing.MinMaxScaler
- preprocessing.Normalizer
- preprocessing.OneHotEncoder
- preprocessing.OrdinalEncoder
- preprocessing.PolynomialFeatures
- preprocessing.PowerTransformer
- preprocessing.QuantileTransformer
- preprocessing.RobustScaler
- preprocessing.SplineTransformer
- preprocessing.StandardScaler
- preprocessing.TargetEncoder
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- preprocessing.add_dummy_feature
- preprocessing.binarize
- preprocessing.label_binarize
- preprocessing.maxabs_scale
- preprocessing.minmax_scale
- preprocessing.normalize
- preprocessing.quantile_transform
- preprocessing.robust_scale
- preprocessing.scale
- preprocessing.power_transform
-
-
-.. _random_projection_ref:
-
-:mod:`sklearn.random_projection`: Random projection
-===================================================
-
-.. automodule:: sklearn.random_projection
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`random_projection` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- random_projection.GaussianRandomProjection
- random_projection.SparseRandomProjection
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- random_projection.johnson_lindenstrauss_min_dim
-
-
-.. _semi_supervised_ref:
-
-:mod:`sklearn.semi_supervised`: Semi-Supervised Learning
-========================================================
-
-.. automodule:: sklearn.semi_supervised
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`semi_supervised` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- semi_supervised.LabelPropagation
- semi_supervised.LabelSpreading
- semi_supervised.SelfTrainingClassifier
-
-
-.. _svm_ref:
-
-:mod:`sklearn.svm`: Support Vector Machines
-===========================================
-
-.. automodule:: sklearn.svm
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`svm` section for further details.
-
-Estimators
-----------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- svm.LinearSVC
- svm.LinearSVR
- svm.NuSVC
- svm.NuSVR
- svm.OneClassSVM
- svm.SVC
- svm.SVR
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- svm.l1_min_c
-
-.. _tree_ref:
-
-:mod:`sklearn.tree`: Decision Trees
-===================================
-
-.. automodule:: sklearn.tree
- :no-members:
- :no-inherited-members:
-
-**User guide:** See the :ref:`tree` section for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- tree.DecisionTreeClassifier
- tree.DecisionTreeRegressor
- tree.ExtraTreeClassifier
- tree.ExtraTreeRegressor
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- tree.export_graphviz
- tree.export_text
-
-Plotting
---------
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- tree.plot_tree
-
-.. _utils_ref:
-
-:mod:`sklearn.utils`: Utilities
-===============================
-
-.. automodule:: sklearn.utils
- :no-members:
- :no-inherited-members:
-
-**Developer guide:** See the :ref:`developers-utils` page for further details.
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- utils.Bunch
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.as_float_array
- utils.assert_all_finite
- utils.deprecated
- utils.estimator_html_repr
- utils.gen_batches
- utils.gen_even_slices
- utils.indexable
- utils.murmurhash3_32
- utils.resample
- utils._safe_indexing
- utils.safe_mask
- utils.safe_sqr
- utils.shuffle
-
-Input and parameter validation
-------------------------------
-
-.. automodule:: sklearn.utils.validation
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.check_X_y
- utils.check_array
- utils.check_scalar
- utils.check_consistent_length
- utils.check_random_state
- utils.validation.check_is_fitted
- utils.validation.check_memory
- utils.validation.check_symmetric
- utils.validation.column_or_1d
- utils.validation.has_fit_parameter
-
-Utilities used in meta-estimators
----------------------------------
-
-.. automodule:: sklearn.utils.metaestimators
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.metaestimators.available_if
-
-Utilities to handle weights based on class labels
--------------------------------------------------
-
-.. automodule:: sklearn.utils.class_weight
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.class_weight.compute_class_weight
- utils.class_weight.compute_sample_weight
-
-Utilities to deal with multiclass target in classifiers
--------------------------------------------------------
-
-.. automodule:: sklearn.utils.multiclass
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.multiclass.type_of_target
- utils.multiclass.is_multilabel
- utils.multiclass.unique_labels
-
-Utilities for optimal mathematical operations
----------------------------------------------
-
-.. automodule:: sklearn.utils.extmath
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.extmath.safe_sparse_dot
- utils.extmath.randomized_range_finder
- utils.extmath.randomized_svd
- utils.extmath.fast_logdet
- utils.extmath.density
- utils.extmath.weighted_mode
-
-Utilities to work with sparse matrices and arrays
--------------------------------------------------
-
-.. automodule:: sklearn.utils.sparsefuncs
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.sparsefuncs.incr_mean_variance_axis
- utils.sparsefuncs.inplace_column_scale
- utils.sparsefuncs.inplace_row_scale
- utils.sparsefuncs.inplace_swap_row
- utils.sparsefuncs.inplace_swap_column
- utils.sparsefuncs.mean_variance_axis
- utils.sparsefuncs.inplace_csr_column_scale
-
-.. automodule:: sklearn.utils.sparsefuncs_fast
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.sparsefuncs_fast.inplace_csr_row_normalize_l1
- utils.sparsefuncs_fast.inplace_csr_row_normalize_l2
-
-Utilities to work with graphs
------------------------------
-
-.. automodule:: sklearn.utils.graph
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.graph.single_source_shortest_path_length
-
-Utilities for random sampling
------------------------------
-
-.. automodule:: sklearn.utils.random
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.random.sample_without_replacement
-
-
-Utilities to operate on arrays
-------------------------------
-
-.. automodule:: sklearn.utils.arrayfuncs
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.arrayfuncs.min_pos
-
-Metadata routing
-----------------
-
-.. automodule:: sklearn.utils.metadata_routing
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.metadata_routing.get_routing_for_object
- utils.metadata_routing.process_routing
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- utils.metadata_routing.MetadataRouter
- utils.metadata_routing.MetadataRequest
- utils.metadata_routing.MethodMapping
-
-Scikit-learn object discovery
------------------------------
-
-.. automodule:: sklearn.utils.discovery
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.discovery.all_estimators
- utils.discovery.all_displays
- utils.discovery.all_functions
-
-Scikit-learn compatibility checker
-----------------------------------
-
-.. automodule:: sklearn.utils.estimator_checks
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.estimator_checks.check_estimator
- utils.estimator_checks.parametrize_with_checks
-
-Utilities for parallel computing
---------------------------------
-
-.. automodule:: sklearn.utils.parallel
- :no-members:
- :no-inherited-members:
-
-.. currentmodule:: sklearn
-
-.. autosummary::
- :toctree: generated/
- :template: function.rst
-
- utils.parallel.delayed
- utils.parallel_backend
- utils.register_parallel_backend
-
-.. autosummary::
- :toctree: generated/
- :template: class.rst
-
- utils.parallel.Parallel
-
-
-Recently deprecated
-===================
diff --git a/doc/modules/feature_extraction.rst b/doc/modules/feature_extraction.rst
index 7ac538a89849b..ffe8ea9d98e61 100644
--- a/doc/modules/feature_extraction.rst
+++ b/doc/modules/feature_extraction.rst
@@ -310,7 +310,7 @@ counting in a single class::
This model has many parameters, however the default values are quite
reasonable (please see the :ref:`reference documentation
-` for the details)::
+` for the details)::
>>> vectorizer = CountVectorizer()
>>> vectorizer
@@ -492,7 +492,7 @@ class::
TfidfTransformer(smooth_idf=False)
Again please see the :ref:`reference documentation
-` for the details on all the parameters.
+` for the details on all the parameters.
|details-start|
**Numeric example of a tf-idf matrix**
diff --git a/doc/templates/deprecated_class.rst b/doc/templates/deprecated_class.rst
deleted file mode 100644
index 5c31936f6fc36..0000000000000
--- a/doc/templates/deprecated_class.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-..
- The empty line below should not be removed. It is added such that the `rst_prolog`
- is added before the :mod: directive. Otherwise, the rendering will show as a
- paragraph instead of a header.
-
-:mod:`{{module}}`.{{objname}}
-{{ underline }}==============
-
-.. meta::
- :robots: noindex
-
-.. warning::
- **DEPRECATED**
-
-
-.. currentmodule:: {{ module }}
-
-.. autoclass:: {{ objname }}
-
- {% block methods %}
- .. automethod:: __init__
- {% endblock %}
-
-.. include:: {{module}}.{{objname}}.examples
-
-.. raw:: html
-
-
diff --git a/doc/templates/deprecated_class_with_call.rst b/doc/templates/deprecated_class_with_call.rst
deleted file mode 100644
index 072a31112be50..0000000000000
--- a/doc/templates/deprecated_class_with_call.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-..
- The empty line below should not be removed. It is added such that the `rst_prolog`
- is added before the :mod: directive. Otherwise, the rendering will show as a
- paragraph instead of a header.
-
-:mod:`{{module}}`.{{objname}}
-{{ underline }}===============
-
-.. meta::
- :robots: noindex
-
-.. warning::
- **DEPRECATED**
-
-
-.. currentmodule:: {{ module }}
-
-.. autoclass:: {{ objname }}
-
- {% block methods %}
- .. automethod:: __init__
- .. automethod:: __call__
- {% endblock %}
-
-.. include:: {{module}}.{{objname}}.examples
-
-.. raw:: html
-
-
diff --git a/doc/templates/deprecated_class_without_init.rst b/doc/templates/deprecated_class_without_init.rst
deleted file mode 100644
index a26afbead5451..0000000000000
--- a/doc/templates/deprecated_class_without_init.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-..
- The empty line below should not be removed. It is added such that the `rst_prolog`
- is added before the :mod: directive. Otherwise, the rendering will show as a
- paragraph instead of a header.
-
-:mod:`{{module}}`.{{objname}}
-{{ underline }}==============
-
-.. meta::
- :robots: noindex
-
-.. warning::
- **DEPRECATED**
-
-
-.. currentmodule:: {{ module }}
-
-.. autoclass:: {{ objname }}
-
-.. include:: {{module}}.{{objname}}.examples
-
-.. raw:: html
-
-
diff --git a/doc/templates/deprecated_function.rst b/doc/templates/deprecated_function.rst
deleted file mode 100644
index ead5abec27076..0000000000000
--- a/doc/templates/deprecated_function.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-..
- The empty line below should not be removed. It is added such that the `rst_prolog`
- is added before the :mod: directive. Otherwise, the rendering will show as a
- paragraph instead of a header.
-
-:mod:`{{module}}`.{{objname}}
-{{ underline }}====================
-
-.. meta::
- :robots: noindex
-
-.. warning::
- **DEPRECATED**
-
-
-.. currentmodule:: {{ module }}
-
-.. autofunction:: {{ objname }}
-
-.. include:: {{module}}.{{objname}}.examples
-
-.. raw:: html
-
-
diff --git a/doc/templates/generate_deprecated.sh b/doc/templates/generate_deprecated.sh
deleted file mode 100755
index a7301fb5dc419..0000000000000
--- a/doc/templates/generate_deprecated.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-for f in [^d]*; do (head -n2 < $f; echo '
-.. meta::
- :robots: noindex
-
-.. warning::
- **DEPRECATED**
-'; tail -n+3 $f) > deprecated_$f; done
diff --git a/doc/themes/scikit-learn-modern/nav.html b/doc/themes/scikit-learn-modern/nav.html
index 14d82e2e46e95..2ff3dadb15c6b 100644
--- a/doc/themes/scikit-learn-modern/nav.html
+++ b/doc/themes/scikit-learn-modern/nav.html
@@ -65,7 +65,7 @@
User Guide
- API
+ API
Examples
diff --git a/sklearn/_api_reference.py b/sklearn/_api_reference.py
new file mode 100644
index 0000000000000..fbfcf7d95887e
--- /dev/null
+++ b/sklearn/_api_reference.py
@@ -0,0 +1,1945 @@
+"""Configuration for the API reference documentation.
+
+CONFIGURING AN AUTOSUMMARY BLOCK
+================================
+
+An autosummary block is configured as a list of dictionaries, each containing "template"
+that maps to a template name available under `doc/templates/` or `None` if no custom
+template is needed, and "entries" that maps to a list of functions/classes/etc. that
+uses the corresponding template. For instance, we have the following translation:
+
+|---------------------------------------------| |--------------------------------------|
+| [ | | |
+| { | | .. autosummary:: |
+| "template": "class", | | :toctree: ../modules/generated/ |
+| "entries": [ | | :template: class.rst |
+| "ColumnTransformer", | | |
+| "TransformedTargetRegressor", | | ColumnTransformer |
+| ], | | TransformedTargetRegressor |
+| }, | | |
+| { | | :template: function.rst |
+| "template": "function", | | |
+| "entries": [ | | make_column_selector |
+| "make_column_transformer", | | make_column_transformer |
+| "make_column_selector", | | |
+| ], | | |
+| }, | | |
+| ], | | |
+|---------------------------------------------| |--------------------------------------|
+
+CONFIGURING API_REFERENCE
+=========================
+
+API_REFERENCE maps each module name to a dictionary that consists of the following
+components:
+
+short_summary (required)
+ The text to be printed on the index page; it has nothing to do the API reference
+ page of each module.
+description (required, `None` if not needed)
+ The additional description for the module to be placed under the module
+ docstring, before the sections start.
+sections (required)
+ A list of sections, each of which consists of:
+ - title (required, `None` if not needed): the section title, commonly it should
+ not be `None` except for the first section of a module,
+ - description (optional): the optional additional description for the section,
+ - autosummary (required): an autosummary block, assuming current module is the
+ current module name.
+
+Essentially, the rendered page would look like the following:
+
+|---------------------------------------------------------------------------------|
+| {{ module_name }} |
+| ================= |
+| {{ module_docstring }} |
+| {{ description }} |
+| |
+| {{ section_title_1 }} <-------------- Optional if one wants the first |
+| --------------------- section to directly follow |
+| {{ section_description_1 }} without a second-level heading. |
+| {{ section_autosummary_1 }} |
+| |
+| {{ section_title_2 }} |
+| --------------------- |
+| {{ section_description_2 }} |
+| {{ section_autosummary_2 }} |
+| |
+| More sections... |
+|---------------------------------------------------------------------------------|
+
+Hooks will be automatically generated for each module and each section. For a module,
+e.g., `sklearn.feature_extraction`, the hook would be `feature_extraction_ref`; for a
+section, e.g., "From text" under `sklearn.feature_extraction`, the hook would be
+`feature_extraction_ref-from-text`. However, note that a better way is to refer using
+the :mod: directive, e.g., :mod:`sklearn.feature_extraction` for the module and
+:mod:`sklearn.feature_extraction.text` for the section. Only in case that a section
+is not a particular submodule does the hook become useful, e.g., the "Loaders" section
+under `sklearn.datasets`.
+
+CONFIGURING DEPRECATED_API_REFERENCE
+====================================
+
+DEPRECATED_API_REFERENCE maps each deprecation target version to a corresponding
+autosummary block. It will be placed at the bottom of the API index page under the
+"Recently deprecated" section. Essentially, the rendered section would look like the
+following:
+
+|------------------------------------------|
+| To be removed in {{ version_1 }} |
+| -------------------------------- |
+| {{ autosummary_1 }} |
+| |
+| To be removed in {{ version_2 }} |
+| -------------------------------- |
+| {{ autosummary_2 }} |
+| |
+| More versions... |
+|------------------------------------------|
+
+Note that the autosummary here assumes that the current module is `sklearn`, i.e., if
+`sklearn.utils.Memory` is deprecated, one should put `utils.Memory` in the "entries"
+slot of the autosummary block.
+"""
+
+from io import StringIO
+
+
+def _get_guide(*refs, is_developer=False):
+ """Get the rst to refer to user/developer guide.
+
+ `refs` is several references that can be used in the :ref:`...` directive. Note
+ that the generated rst does not include any leading or trailing newlines.
+ """
+ if len(refs) == 1:
+ ref_desc = f":ref:`{refs[0]}` section"
+ elif len(refs) == 2:
+ ref_desc = f":ref:`{refs[0]}` and :ref:`{refs[1]}` sections"
+ else:
+ ref_desc = ", ".join(f":ref:`{ref}`" for ref in refs[:-1])
+ ref_desc += f", and :ref:`{refs[-1]}` sections"
+
+ guide_name = "Developer" if is_developer else "User"
+ return f"**{guide_name} guide.** See the {ref_desc} for further details."
+
+
+def _get_submodule(module_name, submodule_name):
+ """Get the submodule docstring and automatically add the hook.
+
+ `module_name` is e.g. `sklearn.feature_extraction`, and `submodule_name` is e.g.
+ `image`, so we get the docstring and hook for `sklearn.feature_extraction.image`
+ submodule. `module_name` is used to reset the current module because autosummary
+ automatically changes the current module.
+
+ Note that the generated string does not include any leading or trailing newlines,
+ so one must manually take care of that to ensure valid rst syntax.
+ """
+ lines = [
+ f".. automodule:: {module_name}.{submodule_name}",
+ " :no-members:",
+ " :no-inherited-members:\n",
+ f".. currentmodule:: {module_name}",
+ ]
+ return "\n\n" + "\n".join(lines) + "\n\n"
+
+
+API_REFERENCE = {
+ "sklearn": {
+ "short_summary": "Settings and information tools.",
+ "description": None,
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "config_context",
+ "get_config",
+ "set_config",
+ "show_versions",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.base": {
+ "short_summary": "Base classes and utility functions.",
+ "description": None,
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "BaseEstimator",
+ "BiclusterMixin",
+ "ClassifierMixin",
+ "ClusterMixin",
+ "DensityMixin",
+ "RegressorMixin",
+ "TransformerMixin",
+ "MetaEstimatorMixin",
+ "OneToOneFeatureMixin",
+ "OutlierMixin",
+ "ClassNamePrefixFeaturesOutMixin",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "clone",
+ "is_classifier",
+ "is_regressor",
+ ],
+ },
+ ],
+ }
+ ],
+ },
+ "sklearn.calibration": {
+ "short_summary": "Probability calibration.",
+ "description": _get_guide("calibration"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["CalibratedClassifierCV"],
+ },
+ {
+ "template": "function",
+ "entries": ["calibration_curve"],
+ },
+ ],
+ },
+ {
+ "title": "Visualization",
+ "autosummary": [
+ {
+ "template": "display_all_class_methods",
+ "entries": ["CalibrationDisplay"],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.cluster": {
+ "short_summary": "Clustering.",
+ "description": _get_guide("clustering", "biclustering"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "AffinityPropagation",
+ "AgglomerativeClustering",
+ "Birch",
+ "DBSCAN",
+ "HDBSCAN",
+ "FeatureAgglomeration",
+ "KMeans",
+ "BisectingKMeans",
+ "MiniBatchKMeans",
+ "MeanShift",
+ "OPTICS",
+ "SpectralClustering",
+ "SpectralBiclustering",
+ "SpectralCoclustering",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "affinity_propagation",
+ "cluster_optics_dbscan",
+ "cluster_optics_xi",
+ "compute_optics_graph",
+ "dbscan",
+ "estimate_bandwidth",
+ "k_means",
+ "kmeans_plusplus",
+ "mean_shift",
+ "spectral_clustering",
+ "ward_tree",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.compose": {
+ "short_summary": "Composite estimators.",
+ "description": _get_guide("combining_estimators"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "ColumnTransformer",
+ "TransformedTargetRegressor",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "make_column_transformer",
+ "make_column_selector",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.covariance": {
+ "short_summary": "Covariance estimation.",
+ "description": _get_guide("covariance"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "EmpiricalCovariance",
+ "EllipticEnvelope",
+ "GraphicalLasso",
+ "GraphicalLassoCV",
+ "LedoitWolf",
+ "MinCovDet",
+ "OAS",
+ "ShrunkCovariance",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "empirical_covariance",
+ "graphical_lasso",
+ "ledoit_wolf",
+ "ledoit_wolf_shrinkage",
+ "oas",
+ "shrunk_covariance",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.cross_decomposition": {
+ "short_summary": "Cross decomposition.",
+ "description": _get_guide("cross_decomposition"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "CCA",
+ "PLSCanonical",
+ "PLSRegression",
+ "PLSSVD",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.datasets": {
+ "short_summary": "Datasets.",
+ "description": _get_guide("datasets"),
+ "sections": [
+ {
+ "title": "Loaders",
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "clear_data_home",
+ "dump_svmlight_file",
+ "fetch_20newsgroups",
+ "fetch_20newsgroups_vectorized",
+ "fetch_california_housing",
+ "fetch_covtype",
+ "fetch_kddcup99",
+ "fetch_lfw_pairs",
+ "fetch_lfw_people",
+ "fetch_olivetti_faces",
+ "fetch_openml",
+ "fetch_rcv1",
+ "fetch_species_distributions",
+ "get_data_home",
+ "load_breast_cancer",
+ "load_diabetes",
+ "load_digits",
+ "load_files",
+ "load_iris",
+ "load_linnerud",
+ "load_sample_image",
+ "load_sample_images",
+ "load_svmlight_file",
+ "load_svmlight_files",
+ "load_wine",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Sample generators",
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "make_biclusters",
+ "make_blobs",
+ "make_checkerboard",
+ "make_circles",
+ "make_classification",
+ "make_friedman1",
+ "make_friedman2",
+ "make_friedman3",
+ "make_gaussian_quantiles",
+ "make_hastie_10_2",
+ "make_low_rank_matrix",
+ "make_moons",
+ "make_multilabel_classification",
+ "make_regression",
+ "make_s_curve",
+ "make_sparse_coded_signal",
+ "make_sparse_spd_matrix",
+ "make_sparse_uncorrelated",
+ "make_spd_matrix",
+ "make_swiss_roll",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.decomposition": {
+ "short_summary": "Matrix decomposition.",
+ "description": _get_guide("decompositions"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "DictionaryLearning",
+ "FactorAnalysis",
+ "FastICA",
+ "IncrementalPCA",
+ "KernelPCA",
+ "LatentDirichletAllocation",
+ "MiniBatchDictionaryLearning",
+ "MiniBatchSparsePCA",
+ "NMF",
+ "MiniBatchNMF",
+ "PCA",
+ "SparsePCA",
+ "SparseCoder",
+ "TruncatedSVD",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "dict_learning",
+ "dict_learning_online",
+ "fastica",
+ "non_negative_factorization",
+ "sparse_encode",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.discriminant_analysis": {
+ "short_summary": "Discriminant analysis.",
+ "description": _get_guide("lda_qda"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "LinearDiscriminantAnalysis",
+ "QuadraticDiscriminantAnalysis",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.dummy": {
+ "short_summary": "Dummy estimators.",
+ "description": _get_guide("model_evaluation"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "DummyClassifier",
+ "DummyRegressor",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.ensemble": {
+ "short_summary": "Ensemble methods.",
+ "description": _get_guide("ensemble"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "AdaBoostClassifier",
+ "AdaBoostRegressor",
+ "BaggingClassifier",
+ "BaggingRegressor",
+ "ExtraTreesClassifier",
+ "ExtraTreesRegressor",
+ "GradientBoostingClassifier",
+ "GradientBoostingRegressor",
+ "IsolationForest",
+ "RandomForestClassifier",
+ "RandomForestRegressor",
+ "RandomTreesEmbedding",
+ "StackingClassifier",
+ "StackingRegressor",
+ "VotingClassifier",
+ "VotingRegressor",
+ "HistGradientBoostingRegressor",
+ "HistGradientBoostingClassifier",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.exceptions": {
+ "short_summary": "Exceptions and warnings.",
+ "description": None,
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "DataConversionWarning",
+ "ConvergenceWarning",
+ "DataDimensionalityWarning",
+ "EfficiencyWarning",
+ "FitFailedWarning",
+ "InconsistentVersionWarning",
+ "NotFittedError",
+ "UndefinedMetricWarning",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.experimental": {
+ "short_summary": "Experimental tools.",
+ "description": None,
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": None,
+ "entries": [
+ "enable_iterative_imputer",
+ "enable_halving_search_cv",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.feature_extraction": {
+ "short_summary": "Feature extraction.",
+ "description": _get_guide("feature_extraction"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "DictVectorizer",
+ "FeatureHasher",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "From images",
+ "description": _get_submodule("sklearn.feature_extraction", "image"),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["image.PatchExtractor"],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "image.extract_patches_2d",
+ "image.grid_to_graph",
+ "image.img_to_graph",
+ "image.reconstruct_from_patches_2d",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "From text",
+ "description": _get_submodule("sklearn.feature_extraction", "text"),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "text.CountVectorizer",
+ "text.HashingVectorizer",
+ "text.TfidfTransformer",
+ "text.TfidfVectorizer",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.feature_selection": {
+ "short_summary": "Feature selection.",
+ "description": _get_guide("feature_selection"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "GenericUnivariateSelect",
+ "SelectPercentile",
+ "SelectKBest",
+ "SelectFpr",
+ "SelectFdr",
+ "SelectFromModel",
+ "SelectFwe",
+ "SequentialFeatureSelector",
+ "RFE",
+ "RFECV",
+ "VarianceThreshold",
+ "SelectorMixin",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "chi2",
+ "f_classif",
+ "f_regression",
+ "r_regression",
+ "mutual_info_classif",
+ "mutual_info_regression",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.gaussian_process": {
+ "short_summary": "Gaussian processes.",
+ "description": _get_guide("gaussian_process"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "GaussianProcessClassifier",
+ "GaussianProcessRegressor",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Kernels",
+ "description": _get_submodule("sklearn.gaussian_process", "kernels"),
+ "autosummary": [
+ {
+ "template": "class_with_call",
+ "entries": [
+ "kernels.CompoundKernel",
+ "kernels.ConstantKernel",
+ "kernels.DotProduct",
+ "kernels.ExpSineSquared",
+ "kernels.Exponentiation",
+ "kernels.Hyperparameter",
+ "kernels.Kernel",
+ "kernels.Matern",
+ "kernels.PairwiseKernel",
+ "kernels.Product",
+ "kernels.RBF",
+ "kernels.RationalQuadratic",
+ "kernels.Sum",
+ "kernels.WhiteKernel",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.impute": {
+ "short_summary": "Imputation.",
+ "description": _get_guide("impute"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "SimpleImputer",
+ "IterativeImputer",
+ "MissingIndicator",
+ "KNNImputer",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.inspection": {
+ "short_summary": "Inspection.",
+ "description": _get_guide("inspection"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "partial_dependence",
+ "permutation_importance",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Plotting",
+ "autosummary": [
+ {
+ "template": "display_only_from_estimator",
+ "entries": [
+ "DecisionBoundaryDisplay",
+ "PartialDependenceDisplay",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.isotonic": {
+ "short_summary": "Isotonic regression.",
+ "description": _get_guide("isotonic"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["IsotonicRegression"],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "check_increasing",
+ "isotonic_regression",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.kernel_approximation": {
+ "short_summary": "Isotonic regression.",
+ "description": _get_guide("kernel_approximation"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "AdditiveChi2Sampler",
+ "Nystroem",
+ "PolynomialCountSketch",
+ "RBFSampler",
+ "SkewedChi2Sampler",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.kernel_ridge": {
+ "short_summary": "Kernel ridge regression.",
+ "description": _get_guide("kernel_ridge"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["KernelRidge"],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.linear_model": {
+ "short_summary": "Generalized linear models.",
+ "description": (
+ _get_guide("linear_model")
+ + "\n\nThe following subsections are only rough guidelines: the same "
+ "estimator can fall into multiple categories, depending on its parameters."
+ ),
+ "sections": [
+ {
+ "title": "Linear classifiers",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "LogisticRegression",
+ "LogisticRegressionCV",
+ "PassiveAggressiveClassifier",
+ "Perceptron",
+ "RidgeClassifier",
+ "RidgeClassifierCV",
+ "SGDClassifier",
+ "SGDOneClassSVM",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Classical linear regressors",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "LinearRegression",
+ "Ridge",
+ "RidgeCV",
+ "SGDRegressor",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Regressors with variable selection",
+ "description": (
+ "The following estimators have built-in variable selection fitting "
+ "procedures, but any estimator using a L1 or elastic-net penalty "
+ "also performs variable selection: typically "
+ ":class:`~linear_model.SGDRegressor` or "
+ ":class:`~sklearn.linear_model.SGDClassifier` with an appropriate "
+ "penalty."
+ ),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "ElasticNet",
+ "ElasticNetCV",
+ "Lars",
+ "LarsCV",
+ "Lasso",
+ "LassoCV",
+ "LassoLars",
+ "LassoLarsCV",
+ "LassoLarsIC",
+ "OrthogonalMatchingPursuit",
+ "OrthogonalMatchingPursuitCV",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Bayesian regressors",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "ARDRegression",
+ "BayesianRidge",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Multi-task linear regressors with variable selection",
+ "description": (
+ "These estimators fit multiple regression problems (or tasks)"
+ " jointly, while inducing sparse coefficients. While the inferred"
+ " coefficients may differ between the tasks, they are constrained"
+ " to agree on the features that are selected (non-zero"
+ " coefficients)."
+ ),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "MultiTaskElasticNet",
+ "MultiTaskElasticNetCV",
+ "MultiTaskLasso",
+ "MultiTaskLassoCV",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Outlier-robust regressors",
+ "description": (
+ "Any estimator using the Huber loss would also be robust to "
+ "outliers, e.g., :class:`~linear_model.SGDRegressor` with "
+ "``loss='huber'``."
+ ),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "HuberRegressor",
+ "QuantileRegressor",
+ "RANSACRegressor",
+ "TheilSenRegressor",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Generalized linear models (GLM) for regression",
+ "description": (
+ "These models allow for response variables to have error "
+ "distributions other than a normal distribution."
+ ),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "PoissonRegressor",
+ "TweedieRegressor",
+ "GammaRegressor",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Miscellaneous",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["PassiveAggressiveRegressor"],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "enet_path",
+ "lars_path",
+ "lars_path_gram",
+ "lasso_path",
+ "orthogonal_mp",
+ "orthogonal_mp_gram",
+ "ridge_regression",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.manifold": {
+ "short_summary": "Manifold learning.",
+ "description": _get_guide("manifold"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "Isomap",
+ "LocallyLinearEmbedding",
+ "MDS",
+ "SpectralEmbedding",
+ "TSNE",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "locally_linear_embedding",
+ "smacof",
+ "spectral_embedding",
+ "trustworthiness",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.metrics": {
+ "short_summary": "Metrics.",
+ "description": _get_guide("model_evaluation", "metrics"),
+ "sections": [
+ {
+ "title": "Model selection interface",
+ "description": _get_guide("scoring_parameter"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "check_scoring",
+ "get_scorer",
+ "get_scorer_names",
+ "make_scorer",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Classification metrics",
+ "description": _get_guide("classification_metrics"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "accuracy_score",
+ "auc",
+ "average_precision_score",
+ "balanced_accuracy_score",
+ "brier_score_loss",
+ "class_likelihood_ratios",
+ "classification_report",
+ "cohen_kappa_score",
+ "confusion_matrix",
+ "dcg_score",
+ "det_curve",
+ "f1_score",
+ "fbeta_score",
+ "hamming_loss",
+ "hinge_loss",
+ "jaccard_score",
+ "log_loss",
+ "matthews_corrcoef",
+ "multilabel_confusion_matrix",
+ "ndcg_score",
+ "precision_recall_curve",
+ "precision_recall_fscore_support",
+ "precision_score",
+ "recall_score",
+ "roc_auc_score",
+ "roc_curve",
+ "top_k_accuracy_score",
+ "zero_one_loss",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Regression metrics",
+ "description": _get_guide("regression_metrics"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "explained_variance_score",
+ "max_error",
+ "mean_absolute_error",
+ "mean_squared_error",
+ "mean_squared_log_error",
+ "median_absolute_error",
+ "mean_absolute_percentage_error",
+ "r2_score",
+ "root_mean_squared_log_error",
+ "root_mean_squared_error",
+ "mean_poisson_deviance",
+ "mean_gamma_deviance",
+ "mean_tweedie_deviance",
+ "d2_tweedie_score",
+ "mean_pinball_loss",
+ "d2_pinball_score",
+ "d2_absolute_error_score",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Multilabel ranking metrics",
+ "description": _get_guide("multilabel_ranking_metrics"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "coverage_error",
+ "label_ranking_average_precision_score",
+ "label_ranking_loss",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Clustering metrics",
+ "description": (
+ _get_submodule("sklearn.metrics", "cluster")
+ + "\n\n"
+ + _get_guide("clustering_evaluation")
+ ),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "adjusted_mutual_info_score",
+ "adjusted_rand_score",
+ "calinski_harabasz_score",
+ "davies_bouldin_score",
+ "completeness_score",
+ "cluster.contingency_matrix",
+ "cluster.pair_confusion_matrix",
+ "fowlkes_mallows_score",
+ "homogeneity_completeness_v_measure",
+ "homogeneity_score",
+ "mutual_info_score",
+ "normalized_mutual_info_score",
+ "rand_score",
+ "silhouette_score",
+ "silhouette_samples",
+ "v_measure_score",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Biclustering metrics",
+ "description": _get_guide("biclustering_evaluation"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": ["consensus_score"],
+ },
+ ],
+ },
+ {
+ "title": "Distance metrics",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["DistanceMetric"],
+ },
+ ],
+ },
+ {
+ "title": "Pairwise metrics",
+ "description": (
+ _get_submodule("sklearn.metrics", "pairwise")
+ + "\n\n"
+ + _get_guide("metrics")
+ ),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "pairwise.additive_chi2_kernel",
+ "pairwise.chi2_kernel",
+ "pairwise.cosine_similarity",
+ "pairwise.cosine_distances",
+ "pairwise.distance_metrics",
+ "pairwise.euclidean_distances",
+ "pairwise.haversine_distances",
+ "pairwise.kernel_metrics",
+ "pairwise.laplacian_kernel",
+ "pairwise.linear_kernel",
+ "pairwise.manhattan_distances",
+ "pairwise.nan_euclidean_distances",
+ "pairwise.pairwise_kernels",
+ "pairwise.polynomial_kernel",
+ "pairwise.rbf_kernel",
+ "pairwise.sigmoid_kernel",
+ "pairwise.paired_euclidean_distances",
+ "pairwise.paired_manhattan_distances",
+ "pairwise.paired_cosine_distances",
+ "pairwise.paired_distances",
+ "pairwise_distances",
+ "pairwise_distances_argmin",
+ "pairwise_distances_argmin_min",
+ "pairwise_distances_chunked",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Plotting",
+ "description": _get_guide("visualizations"),
+ "autosummary": [
+ {
+ "template": "display_all_class_methods",
+ "entries": [
+ "ConfusionMatrixDisplay",
+ "DetCurveDisplay",
+ "PrecisionRecallDisplay",
+ "PredictionErrorDisplay",
+ "RocCurveDisplay",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.mixture": {
+ "short_summary": "Gaussian mixture models.",
+ "description": _get_guide("mixture"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "BayesianGaussianMixture",
+ "GaussianMixture",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.model_selection": {
+ "short_summary": "Model selection.",
+ "description": _get_guide("cross_validation", "grid_search", "learning_curve"),
+ "sections": [
+ {
+ "title": "Splitters",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "GroupKFold",
+ "GroupShuffleSplit",
+ "KFold",
+ "LeaveOneGroupOut",
+ "LeavePGroupsOut",
+ "LeaveOneOut",
+ "LeavePOut",
+ "PredefinedSplit",
+ "RepeatedKFold",
+ "RepeatedStratifiedKFold",
+ "ShuffleSplit",
+ "StratifiedKFold",
+ "StratifiedShuffleSplit",
+ "StratifiedGroupKFold",
+ "TimeSeriesSplit",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "check_cv",
+ "train_test_split",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Hyper-parameter optimizers",
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "GridSearchCV",
+ "HalvingGridSearchCV",
+ "ParameterGrid",
+ "ParameterSampler",
+ "RandomizedSearchCV",
+ "HalvingRandomSearchCV",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Model validation",
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "cross_validate",
+ "cross_val_predict",
+ "cross_val_score",
+ "learning_curve",
+ "permutation_test_score",
+ "validation_curve",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Visualization",
+ "autosummary": [
+ {
+ "template": "display_only_from_estimator",
+ "entries": [
+ "LearningCurveDisplay",
+ "ValidationCurveDisplay",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.multiclass": {
+ "short_summary": "Multiclass classification.",
+ "description": _get_guide("multiclass_classification"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "OneVsRestClassifier",
+ "OneVsOneClassifier",
+ "OutputCodeClassifier",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.multioutput": {
+ "short_summary": "Multioutput regression and classification.",
+ "description": _get_guide(
+ "multilabel_classification",
+ "multiclass_multioutput_classification",
+ "multioutput_regression",
+ ),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "ClassifierChain",
+ "MultiOutputRegressor",
+ "MultiOutputClassifier",
+ "RegressorChain",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.naive_bayes": {
+ "short_summary": "Naive Bayes.",
+ "description": _get_guide("naive_bayes"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "BernoulliNB",
+ "CategoricalNB",
+ "ComplementNB",
+ "GaussianNB",
+ "MultinomialNB",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.neighbors": {
+ "short_summary": "Nearest neighbors.",
+ "description": _get_guide("neighbors"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "BallTree",
+ "KDTree",
+ "KernelDensity",
+ "KNeighborsClassifier",
+ "KNeighborsRegressor",
+ "KNeighborsTransformer",
+ "LocalOutlierFactor",
+ "RadiusNeighborsClassifier",
+ "RadiusNeighborsRegressor",
+ "RadiusNeighborsTransformer",
+ "NearestCentroid",
+ "NearestNeighbors",
+ "NeighborhoodComponentsAnalysis",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "kneighbors_graph",
+ "radius_neighbors_graph",
+ "sort_graph_by_row_values",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.neural_network": {
+ "short_summary": "Neural network models.",
+ "description": _get_guide(
+ "neural_networks_supervised", "neural_networks_unsupervised"
+ ),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "BernoulliRBM",
+ "MLPClassifier",
+ "MLPRegressor",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.pipeline": {
+ "short_summary": "Pipeline.",
+ "description": _get_guide("combining_estimators"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "FeatureUnion",
+ "Pipeline",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "make_pipeline",
+ "make_union",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.preprocessing": {
+ "short_summary": "Preprocessing and normalization.",
+ "description": _get_guide("preprocessing"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "Binarizer",
+ "FunctionTransformer",
+ "KBinsDiscretizer",
+ "KernelCenterer",
+ "LabelBinarizer",
+ "LabelEncoder",
+ "MultiLabelBinarizer",
+ "MaxAbsScaler",
+ "MinMaxScaler",
+ "Normalizer",
+ "OneHotEncoder",
+ "OrdinalEncoder",
+ "PolynomialFeatures",
+ "PowerTransformer",
+ "QuantileTransformer",
+ "RobustScaler",
+ "SplineTransformer",
+ "StandardScaler",
+ "TargetEncoder",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "add_dummy_feature",
+ "binarize",
+ "label_binarize",
+ "maxabs_scale",
+ "minmax_scale",
+ "normalize",
+ "quantile_transform",
+ "robust_scale",
+ "scale",
+ "power_transform",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.random_projection": {
+ "short_summary": "Random projection.",
+ "description": _get_guide("random_projection"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "GaussianRandomProjection",
+ "SparseRandomProjection",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": ["johnson_lindenstrauss_min_dim"],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.semi_supervised": {
+ "short_summary": "Semi-supervised learning.",
+ "description": _get_guide("semi_supervised"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "LabelPropagation",
+ "LabelSpreading",
+ "SelfTrainingClassifier",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.svm": {
+ "short_summary": "Support vector machines.",
+ "description": _get_guide("svm"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "LinearSVC",
+ "LinearSVR",
+ "NuSVC",
+ "NuSVR",
+ "OneClassSVM",
+ "SVC",
+ "SVR",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": ["l1_min_c"],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.tree": {
+ "short_summary": "Decision trees.",
+ "description": _get_guide("tree"),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "DecisionTreeClassifier",
+ "DecisionTreeRegressor",
+ "ExtraTreeClassifier",
+ "ExtraTreeRegressor",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Exporting",
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "export_graphviz",
+ "export_text",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Plotting",
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": ["plot_tree"],
+ },
+ ],
+ },
+ ],
+ },
+ "sklearn.utils": {
+ "short_summary": "Utilities.",
+ "description": _get_guide("developers-utils", is_developer=True),
+ "sections": [
+ {
+ "title": None,
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["Bunch"],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "as_float_array",
+ "assert_all_finite",
+ "deprecated",
+ "estimator_html_repr",
+ "gen_batches",
+ "gen_even_slices",
+ "indexable",
+ "murmurhash3_32",
+ "resample",
+ "_safe_indexing",
+ "safe_mask",
+ "safe_sqr",
+ "shuffle",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Input and parameter validation",
+ "description": _get_submodule("sklearn.utils", "validation"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "check_X_y",
+ "check_array",
+ "check_scalar",
+ "check_consistent_length",
+ "check_random_state",
+ "validation.check_is_fitted",
+ "validation.check_memory",
+ "validation.check_symmetric",
+ "validation.column_or_1d",
+ "validation.has_fit_parameter",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Meta-estimators",
+ "description": _get_submodule("sklearn.utils", "metaestimators"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": ["metaestimators.available_if"],
+ },
+ ],
+ },
+ {
+ "title": "Weight handling based on class labels",
+ "description": _get_submodule("sklearn.utils", "class_weight"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "class_weight.compute_class_weight",
+ "class_weight.compute_sample_weight",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Dealing with multiclass target in classifiers",
+ "description": _get_submodule("sklearn.utils", "multiclass"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "multiclass.type_of_target",
+ "multiclass.is_multilabel",
+ "multiclass.unique_labels",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Optimal mathematical operations",
+ "description": _get_submodule("sklearn.utils", "extmath"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "extmath.safe_sparse_dot",
+ "extmath.randomized_range_finder",
+ "extmath.randomized_svd",
+ "extmath.fast_logdet",
+ "extmath.density",
+ "extmath.weighted_mode",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Working with sparse matrices and arrays",
+ "description": _get_submodule("sklearn.utils", "sparsefuncs"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "sparsefuncs.incr_mean_variance_axis",
+ "sparsefuncs.inplace_column_scale",
+ "sparsefuncs.inplace_row_scale",
+ "sparsefuncs.inplace_swap_row",
+ "sparsefuncs.inplace_swap_column",
+ "sparsefuncs.mean_variance_axis",
+ "sparsefuncs.inplace_csr_column_scale",
+ ],
+ },
+ ],
+ },
+ {
+ "title": None,
+ "description": _get_submodule("sklearn.utils", "sparsefuncs_fast"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "sparsefuncs_fast.inplace_csr_row_normalize_l1",
+ "sparsefuncs_fast.inplace_csr_row_normalize_l2",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Working with graphs",
+ "description": _get_submodule("sklearn.utils", "graph"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": ["graph.single_source_shortest_path_length"],
+ },
+ ],
+ },
+ {
+ "title": "Random sampling",
+ "description": _get_submodule("sklearn.utils", "random"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": ["random.sample_without_replacement"],
+ },
+ ],
+ },
+ {
+ "title": "Auxiliary functions that operate on arrays",
+ "description": _get_submodule("sklearn.utils", "arrayfuncs"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": ["arrayfuncs.min_pos"],
+ },
+ ],
+ },
+ {
+ "title": "Metadata routing",
+ "description": (
+ _get_submodule("sklearn.utils", "metadata_routing")
+ + "\n\n"
+ + _get_guide("metadata_routing")
+ ),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": [
+ "metadata_routing.MetadataRouter",
+ "metadata_routing.MetadataRequest",
+ "metadata_routing.MethodMapping",
+ ],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "metadata_routing.get_routing_for_object",
+ "metadata_routing.process_routing",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Discovering scikit-learn objects",
+ "description": _get_submodule("sklearn.utils", "discovery"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "discovery.all_estimators",
+ "discovery.all_displays",
+ "discovery.all_functions",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "API compatibility checkers",
+ "description": _get_submodule("sklearn.utils", "estimator_checks"),
+ "autosummary": [
+ {
+ "template": "function",
+ "entries": [
+ "estimator_checks.check_estimator",
+ "estimator_checks.parametrize_with_checks",
+ ],
+ },
+ ],
+ },
+ {
+ "title": "Parallel computing",
+ "description": _get_submodule("sklearn.utils", "parallel"),
+ "autosummary": [
+ {
+ "template": "class",
+ "entries": ["parallel.Parallel"],
+ },
+ {
+ "template": "function",
+ "entries": [
+ "parallel.delayed",
+ "parallel_backend",
+ "register_parallel_backend",
+ ],
+ },
+ ],
+ },
+ ],
+ },
+}
+
+
+DEPRECATED_API_REFERENCE = {} # type: ignore
+
+
+def _write_autosummary_rst(autosummary, f):
+ """Write the autosummary rst to a text stream."""
+ f.write(".. autosummary::\n")
+ f.write(" :toctree: ../modules/generated/\n")
+ for autosummary_item in autosummary:
+ if autosummary_item["template"] is not None:
+ f.write(f" :template: {autosummary_item['template']}.rst\n")
+ f.write("\n")
+ # Sort the entries in alphabetical order
+ for entry in sorted(autosummary_item["entries"]):
+ f.write(f" {entry}\n")
+ f.write("\n")
+
+
+def get_api_reference_rst(module_name):
+ """Get the API reference rst for a module."""
+ output = StringIO()
+
+ module_info = API_REFERENCE[module_name]
+ if module_name == "sklearn":
+ subname = None
+ else:
+ assert module_name.startswith("sklearn.")
+ subname = module_name[8:]
+
+ # Print the cross-reference hook
+ if subname is not None:
+ output.write(f".. _{subname}_ref:\n\n")
+
+ # Print the top-level heading
+ output.write(f"{module_name}\n")
+ output.write("=" * len(module_name) + "\n\n")
+
+ # Print the module docstring
+ output.write(f".. automodule:: {module_name}\n")
+ output.write(" :no-members:\n")
+ output.write(" :no-inherited-members:\n\n")
+
+ # Print the additional description if it exists
+ if module_info["description"] is not None:
+ output.write(module_info["description"] + "\n\n")
+
+ for section in module_info["sections"]:
+ # Print the cross-reference hook
+ section_title = section["title"]
+ if section_title is not None and subname is not None:
+ section_refname = section_title.lower().replace(" ", "-")
+ output.write(f".. _{subname}_ref-{section_refname}:\n\n")
+
+ # Print the title if it exists
+ if section_title is not None:
+ output.write(section_title + "\n")
+ output.write("-" * len(section_title) + "\n\n")
+
+ # Print the additional description if it exists
+ section_description = section.get("description", None)
+ if section_description is not None:
+ output.write(section_description + "\n\n")
+
+ # Print the autosummary
+ _write_autosummary_rst(section["autosummary"], output)
+
+ return output.getvalue()
+
+
+def get_deprecated_api_reference_rst(version):
+ """Print the deprecated API reference for a version."""
+ output = StringIO()
+
+ output.write(f"To be removed in {version}\n")
+ output.write("-" * (len(version) + 17) + "\n\n")
+
+ # Print the autosummary
+ _write_autosummary_rst(DEPRECATED_API_REFERENCE[version], output)
+
+ return output.getvalue()
diff --git a/sklearn/base.py b/sklearn/base.py
index e73ae4c8a180e..436c7aa1146f2 100644
--- a/sklearn/base.py
+++ b/sklearn/base.py
@@ -1,4 +1,7 @@
-"""Base classes for all estimators."""
+"""
+The :mod:`sklearn.base` module includes base classes for all estimators and various
+utility functions.
+"""
# Author: Gael Varoquaux
# License: BSD 3 clause
diff --git a/sklearn/calibration.py b/sklearn/calibration.py
index e13f705b08c08..94f3778a2a3df 100644
--- a/sklearn/calibration.py
+++ b/sklearn/calibration.py
@@ -1,4 +1,7 @@
-"""Calibration of predicted probabilities."""
+"""
+The :mod:`sklearn.calibration` module includes methods for calibrating predicted
+probabilities.
+"""
# Author: Alexandre Gramfort
# Balazs Kegl
diff --git a/sklearn/compose/__init__.py b/sklearn/compose/__init__.py
index 7b137cdf9e07f..88073d1a9d244 100644
--- a/sklearn/compose/__init__.py
+++ b/sklearn/compose/__init__.py
@@ -1,8 +1,8 @@
-"""Meta-estimators for building composite models with transformers
-
-In addition to its current contents, this module will eventually be home to
-refurbished versions of Pipeline and FeatureUnion.
-
+"""
+The :mod:`sklearn.compose` module includes meta-estimators for building composite
+models with transformers. In addition to its current contents, this module will
+eventually be home to refurbished versions of :class:`~sklearn.pipeline.Pipeline` and
+:class:`~sklearn.pipeline.FeatureUnion`.
"""
from ._column_transformer import (
diff --git a/sklearn/cross_decomposition/__init__.py b/sklearn/cross_decomposition/__init__.py
index 47b78783caf9c..5c24c802ca6e6 100644
--- a/sklearn/cross_decomposition/__init__.py
+++ b/sklearn/cross_decomposition/__init__.py
@@ -1,3 +1,8 @@
+"""
+The :mod:`sklearn.cross_decomposition` module includes algorithms for cross
+decomposition techniques.
+"""
+
from ._pls import CCA, PLSSVD, PLSCanonical, PLSRegression
__all__ = ["PLSCanonical", "PLSRegression", "PLSSVD", "CCA"]
diff --git a/sklearn/discriminant_analysis.py b/sklearn/discriminant_analysis.py
index 46cb96ddd2886..613c899de48e6 100644
--- a/sklearn/discriminant_analysis.py
+++ b/sklearn/discriminant_analysis.py
@@ -1,5 +1,6 @@
"""
-Linear Discriminant Analysis and Quadratic Discriminant Analysis
+The :mod:`sklearn.discriminant_analysis` module includes linear discriminant analysis
+and quadratic discriminant analysis.
"""
# Authors: Clemens Brunner
diff --git a/sklearn/dummy.py b/sklearn/dummy.py
index 17812fe1b3d05..97a358ad1b449 100644
--- a/sklearn/dummy.py
+++ b/sklearn/dummy.py
@@ -1,3 +1,8 @@
+"""
+The :mod:`sklearn.dummy` module includes dummy estimators that implement simple rules
+of thumb.
+"""
+
# Author: Mathieu Blondel
# Arnaud Joly
# Maheshakya Wijewardena
diff --git a/sklearn/experimental/__init__.py b/sklearn/experimental/__init__.py
index 0effaf5b05fa0..3b38fe326520b 100644
--- a/sklearn/experimental/__init__.py
+++ b/sklearn/experimental/__init__.py
@@ -2,6 +2,8 @@
The :mod:`sklearn.experimental` module provides importable modules that enable
the use of experimental features or estimators.
-The features and estimators that are experimental aren't subject to
-deprecation cycles. Use them at your own risks!
+.. warning::
+
+ The features and estimators that are experimental aren't subject to
+ deprecation cycles. Use them at your own risks!
"""
diff --git a/sklearn/gaussian_process/kernels.py b/sklearn/gaussian_process/kernels.py
index 3b995c48b1f71..7e8e827fd1256 100644
--- a/sklearn/gaussian_process/kernels.py
+++ b/sklearn/gaussian_process/kernels.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.gaussian_process.kernels` module implements a set of kernels that
+The :mod:`sklearn.gaussian_process.kernels` submodule implements a set of kernels that
can be combined by operators and used in Gaussian processes.
"""
diff --git a/sklearn/impute/__init__.py b/sklearn/impute/__init__.py
index e305bc2a657dc..7c346f9b63eb3 100644
--- a/sklearn/impute/__init__.py
+++ b/sklearn/impute/__init__.py
@@ -1,4 +1,7 @@
-"""Transformers for missing value imputation"""
+"""
+The :mod:`sklearn.impute` module includes transformers for missing value imputation.
+"""
+
import typing
from ._base import MissingIndicator, SimpleImputer
diff --git a/sklearn/isotonic.py b/sklearn/isotonic.py
index 04456b1763791..3377d3791375e 100644
--- a/sklearn/isotonic.py
+++ b/sklearn/isotonic.py
@@ -1,3 +1,8 @@
+"""
+The :mod:`sklearn.isotonic` module implements isotonic regression for obtaining
+monotonic fit to data.
+"""
+
# Authors: Fabian Pedregosa
# Alexandre Gramfort
# Nelle Varoquaux
diff --git a/sklearn/kernel_ridge.py b/sklearn/kernel_ridge.py
index 23890f3a68cd7..03781917d9eb3 100644
--- a/sklearn/kernel_ridge.py
+++ b/sklearn/kernel_ridge.py
@@ -1,4 +1,4 @@
-"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression."""
+"""The :mod:`sklearn.kernel_ridge` module implements kernel ridge regression."""
# Authors: Mathieu Blondel
# Jan Hendrik Metzen
diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py
index 740c08fe7a2f6..1004eae0dff3f 100644
--- a/sklearn/metrics/pairwise.py
+++ b/sklearn/metrics/pairwise.py
@@ -1,3 +1,8 @@
+"""
+The :mod:`sklearn.metrics.pairwise` submodule implements metrics for pairwise
+distances and affinity of sets of samples.
+"""
+
# Authors: Alexandre Gramfort
# Mathieu Blondel
# Robert Layton
diff --git a/sklearn/model_selection/__init__.py b/sklearn/model_selection/__init__.py
index d7d316d95ada4..eeefe5098c621 100644
--- a/sklearn/model_selection/__init__.py
+++ b/sklearn/model_selection/__init__.py
@@ -1,3 +1,8 @@
+"""
+The :mod:`sklearn.model_selection` module includes tools for model selection, such as
+cross validation, hyper-parameter tuning, and dataset splitting.
+"""
+
import typing
from ._plot import LearningCurveDisplay, ValidationCurveDisplay
diff --git a/sklearn/multiclass.py b/sklearn/multiclass.py
index 07b19115f0912..76b1aa914c1e3 100644
--- a/sklearn/multiclass.py
+++ b/sklearn/multiclass.py
@@ -1,11 +1,9 @@
"""
-Multiclass classification strategies
-====================================
+The :mod:`sklearn.multiclass` module implements multiclass learning algorithms:
-This module implements multiclass learning algorithms:
- - one-vs-the-rest / one-vs-all
- - one-vs-one
- - error correcting output codes
+- one-vs-the-rest / one-vs-all
+- one-vs-one
+- error correcting output codes
The estimators provided in this module are meta-estimators: they require a base
estimator to be provided in their constructor. For example, it is possible to
diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py
index 1e1c2b646ca82..cd71bbdab24c4 100644
--- a/sklearn/multioutput.py
+++ b/sklearn/multioutput.py
@@ -1,5 +1,6 @@
"""
-This module implements multioutput regression and classification.
+The :mod:`sklearn.multioutput` module implements multioutput regression and
+classification.
The estimators provided in this module are meta-estimators: they require
a base estimator to be provided in their constructor. The meta-estimator
diff --git a/sklearn/neural_network/__init__.py b/sklearn/neural_network/__init__.py
index 0b321b605de0b..40f9abf0496ae 100644
--- a/sklearn/neural_network/__init__.py
+++ b/sklearn/neural_network/__init__.py
@@ -1,6 +1,9 @@
"""
The :mod:`sklearn.neural_network` module includes models based on neural
networks.
+
+**User guide.** See the :ref:`neural_networks_supervised` and
+:ref:`neural_networks_unsupervised` sections for further details.
"""
# License: BSD 3 clause
diff --git a/sklearn/random_projection.py b/sklearn/random_projection.py
index c8c0193ac9b0b..37bc9a5900aa9 100644
--- a/sklearn/random_projection.py
+++ b/sklearn/random_projection.py
@@ -1,11 +1,13 @@
-"""Random Projection transformers.
+"""
+The :mod:`sklearn.random_projection` modules implements random projection
+transformers.
-Random Projections are a simple and computationally efficient way to
+Random projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
-The dimensions and distribution of Random Projections matrices are
+The dimensions and distribution of random projections matrices are
controlled so as to preserve the pairwise distances between any two
samples of the dataset.
@@ -20,8 +22,8 @@
much lower dimension in such a way that distances between the points are
nearly preserved. The map used for the embedding is at least Lipschitz,
and can even be taken to be an orthogonal projection.
-
"""
+
# Authors: Olivier Grisel ,
# Arnaud Joly
# License: BSD 3 clause
diff --git a/sklearn/utils/arrayfuncs.pyx b/sklearn/utils/arrayfuncs.pyx
index 94b221460884c..f200548cfb9a6 100644
--- a/sklearn/utils/arrayfuncs.pyx
+++ b/sklearn/utils/arrayfuncs.pyx
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.arrayfuncs` module includes a small collection of auxiliary
+The :mod:`sklearn.utils.arrayfuncs` submodule includes a small collection of auxiliary
functions that operate on arrays.
"""
diff --git a/sklearn/utils/class_weight.py b/sklearn/utils/class_weight.py
index 55802f780ed41..dd7f381b3e265 100644
--- a/sklearn/utils/class_weight.py
+++ b/sklearn/utils/class_weight.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.class_weight` module includes utilities for handling
+The :mod:`sklearn.utils.class_weight` submodule includes utilities for handling
weights based on class labels.
"""
diff --git a/sklearn/utils/discovery.py b/sklearn/utils/discovery.py
index c1fdca3beafb2..b4c4224a7dcca 100644
--- a/sklearn/utils/discovery.py
+++ b/sklearn/utils/discovery.py
@@ -1,6 +1,6 @@
"""
-The :mod:`sklearn.utils.discovery` module includes utilities to discover
-objects (i.e. estimators, displays, functions) from the `sklearn` package.
+The :mod:`sklearn.utils.discovery` submodule includes utilities to discover
+scikit-learn objects (i.e., estimators, displays, and functions).
"""
import inspect
diff --git a/sklearn/utils/estimator_checks.py b/sklearn/utils/estimator_checks.py
index 564bd6928a5a6..1f36ee3e3a46b 100644
--- a/sklearn/utils/estimator_checks.py
+++ b/sklearn/utils/estimator_checks.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.estimator_checks` module includes various utilities to
+The :mod:`sklearn.utils.estimator_checks` submodule includes various utilities to
check the compatibility of estimators with the scikit-learn API.
"""
diff --git a/sklearn/utils/extmath.py b/sklearn/utils/extmath.py
index faf3c94ad5483..66bd0fadf91bc 100644
--- a/sklearn/utils/extmath.py
+++ b/sklearn/utils/extmath.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.extmath` module includes utilities to perform
+The :mod:`sklearn.utils.extmath` submodule includes utilities to perform
optimal mathematical operations in scikit-learn that are not available in SciPy.
"""
# Authors: Gael Varoquaux
diff --git a/sklearn/utils/graph.py b/sklearn/utils/graph.py
index 06b2e152101a9..a2614be626083 100644
--- a/sklearn/utils/graph.py
+++ b/sklearn/utils/graph.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.graph` module includes graph utilities and algorithms.
+The :mod:`sklearn.utils.graph` submodule includes graph utilities and algorithms.
"""
# Authors: Aric Hagberg
diff --git a/sklearn/utils/metadata_routing.py b/sklearn/utils/metadata_routing.py
index bb98d2f08b93e..6ebc6a2e0b197 100644
--- a/sklearn/utils/metadata_routing.py
+++ b/sklearn/utils/metadata_routing.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.metadata_routing` module includes utilities to route
+The :mod:`sklearn.utils.metadata_routing` submodule includes utilities to route
metadata within scikit-learn estimators.
"""
diff --git a/sklearn/utils/metaestimators.py b/sklearn/utils/metaestimators.py
index 639e000dd77a7..fe25edc05af59 100644
--- a/sklearn/utils/metaestimators.py
+++ b/sklearn/utils/metaestimators.py
@@ -1,5 +1,6 @@
"""
-The :mod:`sklearn.utils.metaestimators` module includes utilities for meta-estimators.
+The :mod:`sklearn.utils.metaestimators` submodule includes utilities for
+meta-estimators.
"""
# Author: Joel Nothman
diff --git a/sklearn/utils/multiclass.py b/sklearn/utils/multiclass.py
index a4b23427e5b70..2a09f78a0f1b1 100644
--- a/sklearn/utils/multiclass.py
+++ b/sklearn/utils/multiclass.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.multiclass` module includes utilities to handle
+The :mod:`sklearn.utils.multiclass` submodule includes utilities to handle
multiclass/multioutput target in classifiers.
"""
diff --git a/sklearn/utils/parallel.py b/sklearn/utils/parallel.py
index d0dc2ec2be030..63f5de4a31dd6 100644
--- a/sklearn/utils/parallel.py
+++ b/sklearn/utils/parallel.py
@@ -1,5 +1,6 @@
"""
-The :mod:`sklearn.utils.parallel` customizes `joblib` tools for scikit-learn usage.
+The :mod:`sklearn.utils.parallel` submodule customizes the :mod:`joblib` tools for
+scikit-learn usage.
"""
import functools
diff --git a/sklearn/utils/random.py b/sklearn/utils/random.py
index 1dfe8d83a94b3..5ff3fca3dfa31 100644
--- a/sklearn/utils/random.py
+++ b/sklearn/utils/random.py
@@ -1,5 +1,5 @@
"""
-The mod:`sklearn.utils.random` module includes utilities for random sampling.
+The :mod:`sklearn.utils.random` submodule includes utilities for random sampling.
"""
# Author: Hamzeh Alsalhi
diff --git a/sklearn/utils/sparsefuncs.py b/sklearn/utils/sparsefuncs.py
index a46e9e4d9ed93..7e5241f425e28 100644
--- a/sklearn/utils/sparsefuncs.py
+++ b/sklearn/utils/sparsefuncs.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.sparsefuncs` module includes a collection of utilities to
+The :mod:`sklearn.utils.sparsefuncs` submodule includes a collection of utilities to
work with sparse matrices and arrays.
"""
diff --git a/sklearn/utils/sparsefuncs_fast.pyx b/sklearn/utils/sparsefuncs_fast.pyx
index 00c8fc9542e18..99bfa867cb2fb 100644
--- a/sklearn/utils/sparsefuncs_fast.pyx
+++ b/sklearn/utils/sparsefuncs_fast.pyx
@@ -1,6 +1,6 @@
"""
-The :mod:`sklearn.utils.sparsefuncs_fast` module includes a collection of utilities to
-work with sparse matrices and arrays written in Cython.
+The :mod:`sklearn.utils.sparsefuncs_fast` submodule includes a collection of utilities
+to work with sparse matrices and arrays written in Cython.
"""
# Authors: Mathieu Blondel
diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py
index bb9feb7fef289..a1e510aaa62d6 100644
--- a/sklearn/utils/validation.py
+++ b/sklearn/utils/validation.py
@@ -1,5 +1,5 @@
"""
-The :mod:`sklearn.utils.validation` module includes functions to validate
+The :mod:`sklearn.utils.validation` submodule includes functions to validate
input and parameters within scikit-learn estimators.
"""