1.. _api_ref: 2 3============= 4API Reference 5============= 6 7This is the class and function reference of scikit-learn. Please refer to 8the :ref:`full user guide <user_guide>` for further details, as the class and 9function raw specifications may not be enough to give full guidelines on their 10uses. 11For reference on concepts repeated across the API, see :ref:`glossary`. 12 13 14:mod:`sklearn.base`: Base classes and utility functions 15======================================================= 16 17.. automodule:: sklearn.base 18 :no-members: 19 :no-inherited-members: 20 21Base classes 22------------ 23.. currentmodule:: sklearn 24 25.. autosummary:: 26 :nosignatures: 27 :toctree: generated/ 28 :template: class.rst 29 30 base.BaseEstimator 31 base.BiclusterMixin 32 base.ClassifierMixin 33 base.ClusterMixin 34 base.DensityMixin 35 base.RegressorMixin 36 base.TransformerMixin 37 feature_selection.SelectorMixin 38 39Functions 40--------- 41.. currentmodule:: sklearn 42 43.. autosummary:: 44 :toctree: generated/ 45 :template: function.rst 46 47 base.clone 48 base.is_classifier 49 base.is_regressor 50 config_context 51 get_config 52 set_config 53 show_versions 54 55.. _calibration_ref: 56 57:mod:`sklearn.calibration`: Probability Calibration 58=================================================== 59 60.. automodule:: sklearn.calibration 61 :no-members: 62 :no-inherited-members: 63 64**User guide:** See the :ref:`calibration` section for further details. 65 66.. currentmodule:: sklearn 67 68.. autosummary:: 69 :toctree: generated/ 70 :template: class.rst 71 72 calibration.CalibratedClassifierCV 73 74 75.. autosummary:: 76 :toctree: generated/ 77 :template: function.rst 78 79 calibration.calibration_curve 80 81.. _cluster_ref: 82 83:mod:`sklearn.cluster`: Clustering 84================================== 85 86.. automodule:: sklearn.cluster 87 :no-members: 88 :no-inherited-members: 89 90**User guide:** See the :ref:`clustering` and :ref:`biclustering` sections for 91further details. 92 93Classes 94------- 95.. currentmodule:: sklearn 96 97.. autosummary:: 98 :toctree: generated/ 99 :template: class.rst 100 101 cluster.AffinityPropagation 102 cluster.AgglomerativeClustering 103 cluster.Birch 104 cluster.DBSCAN 105 cluster.FeatureAgglomeration 106 cluster.KMeans 107 cluster.MiniBatchKMeans 108 cluster.MeanShift 109 cluster.OPTICS 110 cluster.SpectralClustering 111 cluster.SpectralBiclustering 112 cluster.SpectralCoclustering 113 114Functions 115--------- 116.. autosummary:: 117 :toctree: generated/ 118 :template: function.rst 119 120 cluster.affinity_propagation 121 cluster.cluster_optics_dbscan 122 cluster.cluster_optics_xi 123 cluster.compute_optics_graph 124 cluster.dbscan 125 cluster.estimate_bandwidth 126 cluster.k_means 127 cluster.kmeans_plusplus 128 cluster.mean_shift 129 cluster.spectral_clustering 130 cluster.ward_tree 131 132.. _compose_ref: 133 134:mod:`sklearn.compose`: Composite Estimators 135============================================ 136 137.. automodule:: sklearn.compose 138 :no-members: 139 :no-inherited-members: 140 141**User guide:** See the :ref:`combining_estimators` section for further 142details. 143 144.. currentmodule:: sklearn 145 146.. autosummary:: 147 :toctree: generated 148 :template: class.rst 149 150 compose.ColumnTransformer 151 compose.TransformedTargetRegressor 152 153.. autosummary:: 154 :toctree: generated/ 155 :template: function.rst 156 157 compose.make_column_transformer 158 compose.make_column_selector 159 160.. _covariance_ref: 161 162:mod:`sklearn.covariance`: Covariance Estimators 163================================================ 164 165.. automodule:: sklearn.covariance 166 :no-members: 167 :no-inherited-members: 168 169**User guide:** See the :ref:`covariance` section for further details. 170 171.. currentmodule:: sklearn 172 173.. autosummary:: 174 :toctree: generated/ 175 :template: class.rst 176 177 covariance.EmpiricalCovariance 178 covariance.EllipticEnvelope 179 covariance.GraphicalLasso 180 covariance.GraphicalLassoCV 181 covariance.LedoitWolf 182 covariance.MinCovDet 183 covariance.OAS 184 covariance.ShrunkCovariance 185 186.. autosummary:: 187 :toctree: generated/ 188 :template: function.rst 189 190 covariance.empirical_covariance 191 covariance.graphical_lasso 192 covariance.ledoit_wolf 193 covariance.oas 194 covariance.shrunk_covariance 195 196.. _cross_decomposition_ref: 197 198:mod:`sklearn.cross_decomposition`: Cross decomposition 199======================================================= 200 201.. automodule:: sklearn.cross_decomposition 202 :no-members: 203 :no-inherited-members: 204 205**User guide:** See the :ref:`cross_decomposition` section for further details. 206 207.. currentmodule:: sklearn 208 209.. autosummary:: 210 :toctree: generated/ 211 :template: class.rst 212 213 cross_decomposition.CCA 214 cross_decomposition.PLSCanonical 215 cross_decomposition.PLSRegression 216 cross_decomposition.PLSSVD 217 218.. _datasets_ref: 219 220:mod:`sklearn.datasets`: Datasets 221================================= 222 223.. automodule:: sklearn.datasets 224 :no-members: 225 :no-inherited-members: 226 227**User guide:** See the :ref:`datasets` section for further details. 228 229Loaders 230------- 231 232.. currentmodule:: sklearn 233 234.. autosummary:: 235 :toctree: generated/ 236 :template: function.rst 237 238 datasets.clear_data_home 239 datasets.dump_svmlight_file 240 datasets.fetch_20newsgroups 241 datasets.fetch_20newsgroups_vectorized 242 datasets.fetch_california_housing 243 datasets.fetch_covtype 244 datasets.fetch_kddcup99 245 datasets.fetch_lfw_pairs 246 datasets.fetch_lfw_people 247 datasets.fetch_olivetti_faces 248 datasets.fetch_openml 249 datasets.fetch_rcv1 250 datasets.fetch_species_distributions 251 datasets.get_data_home 252 datasets.load_boston 253 datasets.load_breast_cancer 254 datasets.load_diabetes 255 datasets.load_digits 256 datasets.load_files 257 datasets.load_iris 258 datasets.load_linnerud 259 datasets.load_sample_image 260 datasets.load_sample_images 261 datasets.load_svmlight_file 262 datasets.load_svmlight_files 263 datasets.load_wine 264 265Samples generator 266----------------- 267 268.. currentmodule:: sklearn 269 270.. autosummary:: 271 :toctree: generated/ 272 :template: function.rst 273 274 datasets.make_biclusters 275 datasets.make_blobs 276 datasets.make_checkerboard 277 datasets.make_circles 278 datasets.make_classification 279 datasets.make_friedman1 280 datasets.make_friedman2 281 datasets.make_friedman3 282 datasets.make_gaussian_quantiles 283 datasets.make_hastie_10_2 284 datasets.make_low_rank_matrix 285 datasets.make_moons 286 datasets.make_multilabel_classification 287 datasets.make_regression 288 datasets.make_s_curve 289 datasets.make_sparse_coded_signal 290 datasets.make_sparse_spd_matrix 291 datasets.make_sparse_uncorrelated 292 datasets.make_spd_matrix 293 datasets.make_swiss_roll 294 295 296.. _decomposition_ref: 297 298:mod:`sklearn.decomposition`: Matrix Decomposition 299================================================== 300 301.. automodule:: sklearn.decomposition 302 :no-members: 303 :no-inherited-members: 304 305**User guide:** See the :ref:`decompositions` section for further details. 306 307.. currentmodule:: sklearn 308 309.. autosummary:: 310 :toctree: generated/ 311 :template: class.rst 312 313 decomposition.DictionaryLearning 314 decomposition.FactorAnalysis 315 decomposition.FastICA 316 decomposition.IncrementalPCA 317 decomposition.KernelPCA 318 decomposition.LatentDirichletAllocation 319 decomposition.MiniBatchDictionaryLearning 320 decomposition.MiniBatchSparsePCA 321 decomposition.NMF 322 decomposition.PCA 323 decomposition.SparsePCA 324 decomposition.SparseCoder 325 decomposition.TruncatedSVD 326 327.. autosummary:: 328 :toctree: generated/ 329 :template: function.rst 330 331 decomposition.dict_learning 332 decomposition.dict_learning_online 333 decomposition.fastica 334 decomposition.non_negative_factorization 335 decomposition.sparse_encode 336 337.. _lda_ref: 338 339:mod:`sklearn.discriminant_analysis`: Discriminant Analysis 340=========================================================== 341 342.. automodule:: sklearn.discriminant_analysis 343 :no-members: 344 :no-inherited-members: 345 346**User guide:** See the :ref:`lda_qda` section for further details. 347 348.. currentmodule:: sklearn 349 350.. autosummary:: 351 :toctree: generated 352 :template: class.rst 353 354 discriminant_analysis.LinearDiscriminantAnalysis 355 discriminant_analysis.QuadraticDiscriminantAnalysis 356 357.. _dummy_ref: 358 359:mod:`sklearn.dummy`: Dummy estimators 360====================================== 361 362.. automodule:: sklearn.dummy 363 :no-members: 364 :no-inherited-members: 365 366**User guide:** See the :ref:`model_evaluation` section for further details. 367 368.. currentmodule:: sklearn 369 370.. autosummary:: 371 :toctree: generated/ 372 :template: class.rst 373 374 dummy.DummyClassifier 375 dummy.DummyRegressor 376 377.. autosummary:: 378 :toctree: generated/ 379 :template: function.rst 380 381.. _ensemble_ref: 382 383:mod:`sklearn.ensemble`: Ensemble Methods 384========================================= 385 386.. automodule:: sklearn.ensemble 387 :no-members: 388 :no-inherited-members: 389 390**User guide:** See the :ref:`ensemble` section for further details. 391 392.. currentmodule:: sklearn 393 394.. autosummary:: 395 :toctree: generated/ 396 :template: class.rst 397 398 ensemble.AdaBoostClassifier 399 ensemble.AdaBoostRegressor 400 ensemble.BaggingClassifier 401 ensemble.BaggingRegressor 402 ensemble.ExtraTreesClassifier 403 ensemble.ExtraTreesRegressor 404 ensemble.GradientBoostingClassifier 405 ensemble.GradientBoostingRegressor 406 ensemble.IsolationForest 407 ensemble.RandomForestClassifier 408 ensemble.RandomForestRegressor 409 ensemble.RandomTreesEmbedding 410 ensemble.StackingClassifier 411 ensemble.StackingRegressor 412 ensemble.VotingClassifier 413 ensemble.VotingRegressor 414 ensemble.HistGradientBoostingRegressor 415 ensemble.HistGradientBoostingClassifier 416 417 418.. autosummary:: 419 :toctree: generated/ 420 :template: function.rst 421 422 423.. _exceptions_ref: 424 425:mod:`sklearn.exceptions`: Exceptions and warnings 426================================================== 427 428.. automodule:: sklearn.exceptions 429 :no-members: 430 :no-inherited-members: 431 432.. currentmodule:: sklearn 433 434.. autosummary:: 435 :toctree: generated/ 436 :template: class.rst 437 438 exceptions.ConvergenceWarning 439 exceptions.DataConversionWarning 440 exceptions.DataDimensionalityWarning 441 exceptions.EfficiencyWarning 442 exceptions.FitFailedWarning 443 exceptions.NotFittedError 444 exceptions.UndefinedMetricWarning 445 446 447:mod:`sklearn.experimental`: Experimental 448========================================= 449 450.. automodule:: sklearn.experimental 451 :no-members: 452 :no-inherited-members: 453 454.. currentmodule:: sklearn 455 456.. autosummary:: 457 :toctree: generated/ 458 459 experimental.enable_hist_gradient_boosting 460 experimental.enable_iterative_imputer 461 experimental.enable_halving_search_cv 462 463 464.. _feature_extraction_ref: 465 466:mod:`sklearn.feature_extraction`: Feature Extraction 467===================================================== 468 469.. automodule:: sklearn.feature_extraction 470 :no-members: 471 :no-inherited-members: 472 473**User guide:** See the :ref:`feature_extraction` section for further details. 474 475.. currentmodule:: sklearn 476 477.. autosummary:: 478 :toctree: generated/ 479 :template: class.rst 480 481 feature_extraction.DictVectorizer 482 feature_extraction.FeatureHasher 483 484From images 485----------- 486 487.. automodule:: sklearn.feature_extraction.image 488 :no-members: 489 :no-inherited-members: 490 491.. currentmodule:: sklearn 492 493.. autosummary:: 494 :toctree: generated/ 495 :template: function.rst 496 497 feature_extraction.image.extract_patches_2d 498 feature_extraction.image.grid_to_graph 499 feature_extraction.image.img_to_graph 500 feature_extraction.image.reconstruct_from_patches_2d 501 502 :template: class.rst 503 504 feature_extraction.image.PatchExtractor 505 506.. _text_feature_extraction_ref: 507 508From text 509--------- 510 511.. automodule:: sklearn.feature_extraction.text 512 :no-members: 513 :no-inherited-members: 514 515.. currentmodule:: sklearn 516 517.. autosummary:: 518 :toctree: generated/ 519 :template: class.rst 520 521 feature_extraction.text.CountVectorizer 522 feature_extraction.text.HashingVectorizer 523 feature_extraction.text.TfidfTransformer 524 feature_extraction.text.TfidfVectorizer 525 526 527.. _feature_selection_ref: 528 529:mod:`sklearn.feature_selection`: Feature Selection 530=================================================== 531 532.. automodule:: sklearn.feature_selection 533 :no-members: 534 :no-inherited-members: 535 536**User guide:** See the :ref:`feature_selection` section for further details. 537 538.. currentmodule:: sklearn 539 540.. autosummary:: 541 :toctree: generated/ 542 :template: class.rst 543 544 feature_selection.GenericUnivariateSelect 545 feature_selection.SelectPercentile 546 feature_selection.SelectKBest 547 feature_selection.SelectFpr 548 feature_selection.SelectFdr 549 feature_selection.SelectFromModel 550 feature_selection.SelectFwe 551 feature_selection.SequentialFeatureSelector 552 feature_selection.RFE 553 feature_selection.RFECV 554 feature_selection.VarianceThreshold 555 556.. autosummary:: 557 :toctree: generated/ 558 :template: function.rst 559 560 feature_selection.chi2 561 feature_selection.f_classif 562 feature_selection.f_regression 563 feature_selection.r_regression 564 feature_selection.mutual_info_classif 565 feature_selection.mutual_info_regression 566 567 568.. _gaussian_process_ref: 569 570:mod:`sklearn.gaussian_process`: Gaussian Processes 571=================================================== 572 573.. automodule:: sklearn.gaussian_process 574 :no-members: 575 :no-inherited-members: 576 577**User guide:** See the :ref:`gaussian_process` section for further details. 578 579.. currentmodule:: sklearn 580 581.. autosummary:: 582 :toctree: generated/ 583 :template: class.rst 584 585 gaussian_process.GaussianProcessClassifier 586 gaussian_process.GaussianProcessRegressor 587 588Kernels: 589 590.. autosummary:: 591 :toctree: generated/ 592 :template: class_with_call.rst 593 594 gaussian_process.kernels.CompoundKernel 595 gaussian_process.kernels.ConstantKernel 596 gaussian_process.kernels.DotProduct 597 gaussian_process.kernels.ExpSineSquared 598 gaussian_process.kernels.Exponentiation 599 gaussian_process.kernels.Hyperparameter 600 gaussian_process.kernels.Kernel 601 gaussian_process.kernels.Matern 602 gaussian_process.kernels.PairwiseKernel 603 gaussian_process.kernels.Product 604 gaussian_process.kernels.RBF 605 gaussian_process.kernels.RationalQuadratic 606 gaussian_process.kernels.Sum 607 gaussian_process.kernels.WhiteKernel 608 609 610.. _impute_ref: 611 612:mod:`sklearn.impute`: Impute 613============================= 614 615.. automodule:: sklearn.impute 616 :no-members: 617 :no-inherited-members: 618 619**User guide:** See the :ref:`Impute` section for further details. 620 621.. currentmodule:: sklearn 622 623.. autosummary:: 624 :toctree: generated/ 625 :template: class.rst 626 627 impute.SimpleImputer 628 impute.IterativeImputer 629 impute.MissingIndicator 630 impute.KNNImputer 631 632 633.. _inspection_ref: 634 635:mod:`sklearn.inspection`: Inspection 636===================================== 637 638.. automodule:: sklearn.inspection 639 :no-members: 640 :no-inherited-members: 641 642.. currentmodule:: sklearn 643 644.. autosummary:: 645 :toctree: generated/ 646 :template: function.rst 647 648 inspection.partial_dependence 649 inspection.permutation_importance 650 651Plotting 652-------- 653 654.. currentmodule:: sklearn 655 656.. autosummary:: 657 :toctree: generated/ 658 :template: class.rst 659 660 inspection.PartialDependenceDisplay 661 662.. autosummary:: 663 :toctree: generated/ 664 :template: function.rst 665 666 inspection.plot_partial_dependence 667 668.. _isotonic_ref: 669 670:mod:`sklearn.isotonic`: Isotonic regression 671============================================ 672 673.. automodule:: sklearn.isotonic 674 :no-members: 675 :no-inherited-members: 676 677**User guide:** See the :ref:`isotonic` section for further details. 678 679.. currentmodule:: sklearn 680 681.. autosummary:: 682 :toctree: generated/ 683 :template: class.rst 684 685 isotonic.IsotonicRegression 686 687.. autosummary:: 688 :toctree: generated 689 :template: function.rst 690 691 isotonic.check_increasing 692 isotonic.isotonic_regression 693 694 695.. _kernel_approximation_ref: 696 697:mod:`sklearn.kernel_approximation`: Kernel Approximation 698========================================================= 699 700.. automodule:: sklearn.kernel_approximation 701 :no-members: 702 :no-inherited-members: 703 704**User guide:** See the :ref:`kernel_approximation` section for further details. 705 706.. currentmodule:: sklearn 707 708.. autosummary:: 709 :toctree: generated/ 710 :template: class.rst 711 712 kernel_approximation.AdditiveChi2Sampler 713 kernel_approximation.Nystroem 714 kernel_approximation.PolynomialCountSketch 715 kernel_approximation.RBFSampler 716 kernel_approximation.SkewedChi2Sampler 717 718.. _kernel_ridge_ref: 719 720:mod:`sklearn.kernel_ridge`: Kernel Ridge Regression 721==================================================== 722 723.. automodule:: sklearn.kernel_ridge 724 :no-members: 725 :no-inherited-members: 726 727**User guide:** See the :ref:`kernel_ridge` section for further details. 728 729.. currentmodule:: sklearn 730 731.. autosummary:: 732 :toctree: generated/ 733 :template: class.rst 734 735 kernel_ridge.KernelRidge 736 737.. _linear_model_ref: 738 739:mod:`sklearn.linear_model`: Linear Models 740========================================== 741 742.. automodule:: sklearn.linear_model 743 :no-members: 744 :no-inherited-members: 745 746**User guide:** See the :ref:`linear_model` section for further details. 747 748The following subsections are only rough guidelines: the same estimator can 749fall into multiple categories, depending on its parameters. 750 751.. currentmodule:: sklearn 752 753Linear classifiers 754------------------ 755.. autosummary:: 756 :toctree: generated/ 757 :template: class.rst 758 759 linear_model.LogisticRegression 760 linear_model.LogisticRegressionCV 761 linear_model.PassiveAggressiveClassifier 762 linear_model.Perceptron 763 linear_model.RidgeClassifier 764 linear_model.RidgeClassifierCV 765 linear_model.SGDClassifier 766 linear_model.SGDOneClassSVM 767 768Classical linear regressors 769--------------------------- 770 771.. autosummary:: 772 :toctree: generated/ 773 :template: class.rst 774 775 linear_model.LinearRegression 776 linear_model.Ridge 777 linear_model.RidgeCV 778 linear_model.SGDRegressor 779 780Regressors with variable selection 781---------------------------------- 782 783The following estimators have built-in variable selection fitting 784procedures, but any estimator using a L1 or elastic-net penalty also 785performs variable selection: typically :class:`~linear_model.SGDRegressor` 786or :class:`~sklearn.linear_model.SGDClassifier` with an appropriate penalty. 787 788.. autosummary:: 789 :toctree: generated/ 790 :template: class.rst 791 792 linear_model.ElasticNet 793 linear_model.ElasticNetCV 794 linear_model.Lars 795 linear_model.LarsCV 796 linear_model.Lasso 797 linear_model.LassoCV 798 linear_model.LassoLars 799 linear_model.LassoLarsCV 800 linear_model.LassoLarsIC 801 linear_model.OrthogonalMatchingPursuit 802 linear_model.OrthogonalMatchingPursuitCV 803 804Bayesian regressors 805------------------- 806 807.. autosummary:: 808 :toctree: generated/ 809 :template: class.rst 810 811 linear_model.ARDRegression 812 linear_model.BayesianRidge 813 814Multi-task linear regressors with variable selection 815---------------------------------------------------- 816 817These estimators fit multiple regression problems (or tasks) jointly, while 818inducing sparse coefficients. While the inferred coefficients may differ 819between the tasks, they are constrained to agree on the features that are 820selected (non-zero coefficients). 821 822.. autosummary:: 823 :toctree: generated/ 824 :template: class.rst 825 826 linear_model.MultiTaskElasticNet 827 linear_model.MultiTaskElasticNetCV 828 linear_model.MultiTaskLasso 829 linear_model.MultiTaskLassoCV 830 831Outlier-robust regressors 832------------------------- 833 834Any estimator using the Huber loss would also be robust to outliers, e.g. 835:class:`~linear_model.SGDRegressor` with ``loss='huber'``. 836 837.. autosummary:: 838 :toctree: generated/ 839 :template: class.rst 840 841 linear_model.HuberRegressor 842 linear_model.QuantileRegressor 843 linear_model.RANSACRegressor 844 linear_model.TheilSenRegressor 845 846Generalized linear models (GLM) for regression 847---------------------------------------------- 848 849These models allow for response variables to have error distributions other 850than a normal distribution: 851 852.. autosummary:: 853 :toctree: generated/ 854 :template: class.rst 855 856 linear_model.PoissonRegressor 857 linear_model.TweedieRegressor 858 linear_model.GammaRegressor 859 860 861Miscellaneous 862------------- 863 864.. autosummary:: 865 :toctree: generated/ 866 :template: function.rst 867 868 linear_model.PassiveAggressiveRegressor 869 linear_model.enet_path 870 linear_model.lars_path 871 linear_model.lars_path_gram 872 linear_model.lasso_path 873 linear_model.orthogonal_mp 874 linear_model.orthogonal_mp_gram 875 linear_model.ridge_regression 876 877 878.. _manifold_ref: 879 880:mod:`sklearn.manifold`: Manifold Learning 881========================================== 882 883.. automodule:: sklearn.manifold 884 :no-members: 885 :no-inherited-members: 886 887**User guide:** See the :ref:`manifold` section for further details. 888 889.. currentmodule:: sklearn 890 891.. autosummary:: 892 :toctree: generated 893 :template: class.rst 894 895 manifold.Isomap 896 manifold.LocallyLinearEmbedding 897 manifold.MDS 898 manifold.SpectralEmbedding 899 manifold.TSNE 900 901.. autosummary:: 902 :toctree: generated 903 :template: function.rst 904 905 manifold.locally_linear_embedding 906 manifold.smacof 907 manifold.spectral_embedding 908 manifold.trustworthiness 909 910 911.. _metrics_ref: 912 913:mod:`sklearn.metrics`: Metrics 914=============================== 915 916See the :ref:`model_evaluation` section and the :ref:`metrics` section of the 917user guide for further details. 918 919.. automodule:: sklearn.metrics 920 :no-members: 921 :no-inherited-members: 922 923.. currentmodule:: sklearn 924 925Model Selection Interface 926------------------------- 927See the :ref:`scoring_parameter` section of the user guide for further 928details. 929 930.. autosummary:: 931 :toctree: generated/ 932 :template: function.rst 933 934 metrics.check_scoring 935 metrics.get_scorer 936 metrics.make_scorer 937 938Classification metrics 939---------------------- 940 941See the :ref:`classification_metrics` section of the user guide for further 942details. 943 944.. autosummary:: 945 :toctree: generated/ 946 :template: function.rst 947 948 metrics.accuracy_score 949 metrics.auc 950 metrics.average_precision_score 951 metrics.balanced_accuracy_score 952 metrics.brier_score_loss 953 metrics.classification_report 954 metrics.cohen_kappa_score 955 metrics.confusion_matrix 956 metrics.dcg_score 957 metrics.det_curve 958 metrics.f1_score 959 metrics.fbeta_score 960 metrics.hamming_loss 961 metrics.hinge_loss 962 metrics.jaccard_score 963 metrics.log_loss 964 metrics.matthews_corrcoef 965 metrics.multilabel_confusion_matrix 966 metrics.ndcg_score 967 metrics.precision_recall_curve 968 metrics.precision_recall_fscore_support 969 metrics.precision_score 970 metrics.recall_score 971 metrics.roc_auc_score 972 metrics.roc_curve 973 metrics.top_k_accuracy_score 974 metrics.zero_one_loss 975 976Regression metrics 977------------------ 978 979See the :ref:`regression_metrics` section of the user guide for further 980details. 981 982.. autosummary:: 983 :toctree: generated/ 984 :template: function.rst 985 986 metrics.explained_variance_score 987 metrics.max_error 988 metrics.mean_absolute_error 989 metrics.mean_squared_error 990 metrics.mean_squared_log_error 991 metrics.median_absolute_error 992 metrics.mean_absolute_percentage_error 993 metrics.r2_score 994 metrics.mean_poisson_deviance 995 metrics.mean_gamma_deviance 996 metrics.mean_tweedie_deviance 997 metrics.d2_tweedie_score 998 metrics.mean_pinball_loss 999 1000Multilabel ranking metrics 1001-------------------------- 1002See the :ref:`multilabel_ranking_metrics` section of the user guide for further 1003details. 1004 1005.. autosummary:: 1006 :toctree: generated/ 1007 :template: function.rst 1008 1009 metrics.coverage_error 1010 metrics.label_ranking_average_precision_score 1011 metrics.label_ranking_loss 1012 1013 1014Clustering metrics 1015------------------ 1016 1017See the :ref:`clustering_evaluation` section of the user guide for further 1018details. 1019 1020.. automodule:: sklearn.metrics.cluster 1021 :no-members: 1022 :no-inherited-members: 1023 1024.. currentmodule:: sklearn 1025 1026.. autosummary:: 1027 :toctree: generated/ 1028 :template: function.rst 1029 1030 metrics.adjusted_mutual_info_score 1031 metrics.adjusted_rand_score 1032 metrics.calinski_harabasz_score 1033 metrics.davies_bouldin_score 1034 metrics.completeness_score 1035 metrics.cluster.contingency_matrix 1036 metrics.cluster.pair_confusion_matrix 1037 metrics.fowlkes_mallows_score 1038 metrics.homogeneity_completeness_v_measure 1039 metrics.homogeneity_score 1040 metrics.mutual_info_score 1041 metrics.normalized_mutual_info_score 1042 metrics.rand_score 1043 metrics.silhouette_score 1044 metrics.silhouette_samples 1045 metrics.v_measure_score 1046 1047Biclustering metrics 1048-------------------- 1049 1050See the :ref:`biclustering_evaluation` section of the user guide for 1051further details. 1052 1053.. currentmodule:: sklearn 1054 1055.. autosummary:: 1056 :toctree: generated/ 1057 :template: function.rst 1058 1059 metrics.consensus_score 1060 1061Distance metrics 1062---------------- 1063 1064.. currentmodule:: sklearn 1065 1066.. autosummary:: 1067 :toctree: generated/ 1068 :template: class.rst 1069 1070 metrics.DistanceMetric 1071 1072Pairwise metrics 1073---------------- 1074 1075See the :ref:`metrics` section of the user guide for further details. 1076 1077.. automodule:: sklearn.metrics.pairwise 1078 :no-members: 1079 :no-inherited-members: 1080 1081.. currentmodule:: sklearn 1082 1083.. autosummary:: 1084 :toctree: generated/ 1085 :template: function.rst 1086 1087 metrics.pairwise.additive_chi2_kernel 1088 metrics.pairwise.chi2_kernel 1089 metrics.pairwise.cosine_similarity 1090 metrics.pairwise.cosine_distances 1091 metrics.pairwise.distance_metrics 1092 metrics.pairwise.euclidean_distances 1093 metrics.pairwise.haversine_distances 1094 metrics.pairwise.kernel_metrics 1095 metrics.pairwise.laplacian_kernel 1096 metrics.pairwise.linear_kernel 1097 metrics.pairwise.manhattan_distances 1098 metrics.pairwise.nan_euclidean_distances 1099 metrics.pairwise.pairwise_kernels 1100 metrics.pairwise.polynomial_kernel 1101 metrics.pairwise.rbf_kernel 1102 metrics.pairwise.sigmoid_kernel 1103 metrics.pairwise.paired_euclidean_distances 1104 metrics.pairwise.paired_manhattan_distances 1105 metrics.pairwise.paired_cosine_distances 1106 metrics.pairwise.paired_distances 1107 metrics.pairwise_distances 1108 metrics.pairwise_distances_argmin 1109 metrics.pairwise_distances_argmin_min 1110 metrics.pairwise_distances_chunked 1111 1112 1113Plotting 1114-------- 1115 1116See the :ref:`visualizations` section of the user guide for further details. 1117 1118.. currentmodule:: sklearn 1119 1120.. autosummary:: 1121 :toctree: generated/ 1122 :template: function.rst 1123 1124 metrics.plot_confusion_matrix 1125 metrics.plot_det_curve 1126 metrics.plot_precision_recall_curve 1127 metrics.plot_roc_curve 1128 1129.. autosummary:: 1130 :toctree: generated/ 1131 :template: class.rst 1132 1133 metrics.ConfusionMatrixDisplay 1134 metrics.DetCurveDisplay 1135 metrics.PrecisionRecallDisplay 1136 metrics.RocCurveDisplay 1137 calibration.CalibrationDisplay 1138 1139.. _mixture_ref: 1140 1141:mod:`sklearn.mixture`: Gaussian Mixture Models 1142=============================================== 1143 1144.. automodule:: sklearn.mixture 1145 :no-members: 1146 :no-inherited-members: 1147 1148**User guide:** See the :ref:`mixture` section for further details. 1149 1150.. currentmodule:: sklearn 1151 1152.. autosummary:: 1153 :toctree: generated/ 1154 :template: class.rst 1155 1156 mixture.BayesianGaussianMixture 1157 mixture.GaussianMixture 1158 1159.. _modelselection_ref: 1160 1161:mod:`sklearn.model_selection`: Model Selection 1162=============================================== 1163 1164.. automodule:: sklearn.model_selection 1165 :no-members: 1166 :no-inherited-members: 1167 1168**User guide:** See the :ref:`cross_validation`, :ref:`grid_search` and 1169:ref:`learning_curve` sections for further details. 1170 1171Splitter Classes 1172---------------- 1173 1174.. currentmodule:: sklearn 1175 1176.. autosummary:: 1177 :toctree: generated/ 1178 :template: class.rst 1179 1180 model_selection.GroupKFold 1181 model_selection.GroupShuffleSplit 1182 model_selection.KFold 1183 model_selection.LeaveOneGroupOut 1184 model_selection.LeavePGroupsOut 1185 model_selection.LeaveOneOut 1186 model_selection.LeavePOut 1187 model_selection.PredefinedSplit 1188 model_selection.RepeatedKFold 1189 model_selection.RepeatedStratifiedKFold 1190 model_selection.ShuffleSplit 1191 model_selection.StratifiedKFold 1192 model_selection.StratifiedShuffleSplit 1193 model_selection.StratifiedGroupKFold 1194 model_selection.TimeSeriesSplit 1195 1196Splitter Functions 1197------------------ 1198 1199.. currentmodule:: sklearn 1200 1201.. autosummary:: 1202 :toctree: generated/ 1203 :template: function.rst 1204 1205 model_selection.check_cv 1206 model_selection.train_test_split 1207 1208.. _hyper_parameter_optimizers: 1209 1210Hyper-parameter optimizers 1211-------------------------- 1212 1213.. currentmodule:: sklearn 1214 1215.. autosummary:: 1216 :toctree: generated/ 1217 :template: class.rst 1218 1219 model_selection.GridSearchCV 1220 model_selection.HalvingGridSearchCV 1221 model_selection.ParameterGrid 1222 model_selection.ParameterSampler 1223 model_selection.RandomizedSearchCV 1224 model_selection.HalvingRandomSearchCV 1225 1226 1227Model validation 1228---------------- 1229 1230.. currentmodule:: sklearn 1231 1232.. autosummary:: 1233 :toctree: generated/ 1234 :template: function.rst 1235 1236 model_selection.cross_validate 1237 model_selection.cross_val_predict 1238 model_selection.cross_val_score 1239 model_selection.learning_curve 1240 model_selection.permutation_test_score 1241 model_selection.validation_curve 1242 1243.. _multiclass_ref: 1244 1245:mod:`sklearn.multiclass`: Multiclass classification 1246==================================================== 1247 1248.. automodule:: sklearn.multiclass 1249 :no-members: 1250 :no-inherited-members: 1251 1252**User guide:** See the :ref:`multiclass_classification` section for further details. 1253 1254.. currentmodule:: sklearn 1255 1256.. autosummary:: 1257 :toctree: generated 1258 :template: class.rst 1259 1260 multiclass.OneVsRestClassifier 1261 multiclass.OneVsOneClassifier 1262 multiclass.OutputCodeClassifier 1263 1264.. _multioutput_ref: 1265 1266:mod:`sklearn.multioutput`: Multioutput regression and classification 1267===================================================================== 1268 1269.. automodule:: sklearn.multioutput 1270 :no-members: 1271 :no-inherited-members: 1272 1273**User guide:** See the :ref:`multilabel_classification`, 1274:ref:`multiclass_multioutput_classification`, and 1275:ref:`multioutput_regression` sections for further details. 1276 1277.. currentmodule:: sklearn 1278 1279.. autosummary:: 1280 :toctree: generated 1281 :template: class.rst 1282 1283 multioutput.ClassifierChain 1284 multioutput.MultiOutputRegressor 1285 multioutput.MultiOutputClassifier 1286 multioutput.RegressorChain 1287 1288.. _naive_bayes_ref: 1289 1290:mod:`sklearn.naive_bayes`: Naive Bayes 1291======================================= 1292 1293.. automodule:: sklearn.naive_bayes 1294 :no-members: 1295 :no-inherited-members: 1296 1297**User guide:** See the :ref:`naive_bayes` section for further details. 1298 1299.. currentmodule:: sklearn 1300 1301.. autosummary:: 1302 :toctree: generated/ 1303 :template: class.rst 1304 1305 naive_bayes.BernoulliNB 1306 naive_bayes.CategoricalNB 1307 naive_bayes.ComplementNB 1308 naive_bayes.GaussianNB 1309 naive_bayes.MultinomialNB 1310 1311 1312.. _neighbors_ref: 1313 1314:mod:`sklearn.neighbors`: Nearest Neighbors 1315=========================================== 1316 1317.. automodule:: sklearn.neighbors 1318 :no-members: 1319 :no-inherited-members: 1320 1321**User guide:** See the :ref:`neighbors` section for further details. 1322 1323.. currentmodule:: sklearn 1324 1325.. autosummary:: 1326 :toctree: generated/ 1327 :template: class.rst 1328 1329 neighbors.BallTree 1330 neighbors.KDTree 1331 neighbors.KernelDensity 1332 neighbors.KNeighborsClassifier 1333 neighbors.KNeighborsRegressor 1334 neighbors.KNeighborsTransformer 1335 neighbors.LocalOutlierFactor 1336 neighbors.RadiusNeighborsClassifier 1337 neighbors.RadiusNeighborsRegressor 1338 neighbors.RadiusNeighborsTransformer 1339 neighbors.NearestCentroid 1340 neighbors.NearestNeighbors 1341 neighbors.NeighborhoodComponentsAnalysis 1342 1343.. autosummary:: 1344 :toctree: generated/ 1345 :template: function.rst 1346 1347 neighbors.kneighbors_graph 1348 neighbors.radius_neighbors_graph 1349 1350.. _neural_network_ref: 1351 1352:mod:`sklearn.neural_network`: Neural network models 1353==================================================== 1354 1355.. automodule:: sklearn.neural_network 1356 :no-members: 1357 :no-inherited-members: 1358 1359**User guide:** See the :ref:`neural_networks_supervised` and :ref:`neural_networks_unsupervised` sections for further details. 1360 1361.. currentmodule:: sklearn 1362 1363.. autosummary:: 1364 :toctree: generated/ 1365 :template: class.rst 1366 1367 neural_network.BernoulliRBM 1368 neural_network.MLPClassifier 1369 neural_network.MLPRegressor 1370 1371.. _pipeline_ref: 1372 1373:mod:`sklearn.pipeline`: Pipeline 1374================================= 1375 1376.. automodule:: sklearn.pipeline 1377 :no-members: 1378 :no-inherited-members: 1379 1380**User guide:** See the :ref:`combining_estimators` section for further 1381details. 1382 1383.. currentmodule:: sklearn 1384 1385.. autosummary:: 1386 :toctree: generated/ 1387 :template: class.rst 1388 1389 pipeline.FeatureUnion 1390 pipeline.Pipeline 1391 1392.. autosummary:: 1393 :toctree: generated/ 1394 :template: function.rst 1395 1396 pipeline.make_pipeline 1397 pipeline.make_union 1398 1399.. _preprocessing_ref: 1400 1401:mod:`sklearn.preprocessing`: Preprocessing and Normalization 1402============================================================= 1403 1404.. automodule:: sklearn.preprocessing 1405 :no-members: 1406 :no-inherited-members: 1407 1408**User guide:** See the :ref:`preprocessing` section for further details. 1409 1410.. currentmodule:: sklearn 1411 1412.. autosummary:: 1413 :toctree: generated/ 1414 :template: class.rst 1415 1416 preprocessing.Binarizer 1417 preprocessing.FunctionTransformer 1418 preprocessing.KBinsDiscretizer 1419 preprocessing.KernelCenterer 1420 preprocessing.LabelBinarizer 1421 preprocessing.LabelEncoder 1422 preprocessing.MultiLabelBinarizer 1423 preprocessing.MaxAbsScaler 1424 preprocessing.MinMaxScaler 1425 preprocessing.Normalizer 1426 preprocessing.OneHotEncoder 1427 preprocessing.OrdinalEncoder 1428 preprocessing.PolynomialFeatures 1429 preprocessing.PowerTransformer 1430 preprocessing.QuantileTransformer 1431 preprocessing.RobustScaler 1432 preprocessing.SplineTransformer 1433 preprocessing.StandardScaler 1434 1435.. autosummary:: 1436 :toctree: generated/ 1437 :template: function.rst 1438 1439 preprocessing.add_dummy_feature 1440 preprocessing.binarize 1441 preprocessing.label_binarize 1442 preprocessing.maxabs_scale 1443 preprocessing.minmax_scale 1444 preprocessing.normalize 1445 preprocessing.quantile_transform 1446 preprocessing.robust_scale 1447 preprocessing.scale 1448 preprocessing.power_transform 1449 1450 1451.. _random_projection_ref: 1452 1453:mod:`sklearn.random_projection`: Random projection 1454=================================================== 1455 1456.. automodule:: sklearn.random_projection 1457 :no-members: 1458 :no-inherited-members: 1459 1460**User guide:** See the :ref:`random_projection` section for further details. 1461 1462.. currentmodule:: sklearn 1463 1464.. autosummary:: 1465 :toctree: generated/ 1466 :template: class.rst 1467 1468 random_projection.GaussianRandomProjection 1469 random_projection.SparseRandomProjection 1470 1471.. autosummary:: 1472 :toctree: generated/ 1473 :template: function.rst 1474 1475 random_projection.johnson_lindenstrauss_min_dim 1476 1477 1478.. _semi_supervised_ref: 1479 1480:mod:`sklearn.semi_supervised`: Semi-Supervised Learning 1481======================================================== 1482 1483.. automodule:: sklearn.semi_supervised 1484 :no-members: 1485 :no-inherited-members: 1486 1487**User guide:** See the :ref:`semi_supervised` section for further details. 1488 1489.. currentmodule:: sklearn 1490 1491.. autosummary:: 1492 :toctree: generated/ 1493 :template: class.rst 1494 1495 semi_supervised.LabelPropagation 1496 semi_supervised.LabelSpreading 1497 semi_supervised.SelfTrainingClassifier 1498 1499 1500.. _svm_ref: 1501 1502:mod:`sklearn.svm`: Support Vector Machines 1503=========================================== 1504 1505.. automodule:: sklearn.svm 1506 :no-members: 1507 :no-inherited-members: 1508 1509**User guide:** See the :ref:`svm` section for further details. 1510 1511Estimators 1512---------- 1513 1514.. currentmodule:: sklearn 1515 1516.. autosummary:: 1517 :toctree: generated/ 1518 :template: class.rst 1519 1520 svm.LinearSVC 1521 svm.LinearSVR 1522 svm.NuSVC 1523 svm.NuSVR 1524 svm.OneClassSVM 1525 svm.SVC 1526 svm.SVR 1527 1528.. autosummary:: 1529 :toctree: generated/ 1530 :template: function.rst 1531 1532 svm.l1_min_c 1533 1534.. _tree_ref: 1535 1536:mod:`sklearn.tree`: Decision Trees 1537=================================== 1538 1539.. automodule:: sklearn.tree 1540 :no-members: 1541 :no-inherited-members: 1542 1543**User guide:** See the :ref:`tree` section for further details. 1544 1545.. currentmodule:: sklearn 1546 1547.. autosummary:: 1548 :toctree: generated/ 1549 :template: class.rst 1550 1551 tree.DecisionTreeClassifier 1552 tree.DecisionTreeRegressor 1553 tree.ExtraTreeClassifier 1554 tree.ExtraTreeRegressor 1555 1556.. autosummary:: 1557 :toctree: generated/ 1558 :template: function.rst 1559 1560 tree.export_graphviz 1561 tree.export_text 1562 1563Plotting 1564-------- 1565 1566.. currentmodule:: sklearn 1567 1568.. autosummary:: 1569 :toctree: generated/ 1570 :template: function.rst 1571 1572 tree.plot_tree 1573 1574.. _utils_ref: 1575 1576:mod:`sklearn.utils`: Utilities 1577=============================== 1578 1579.. automodule:: sklearn.utils 1580 :no-members: 1581 :no-inherited-members: 1582 1583**Developer guide:** See the :ref:`developers-utils` page for further details. 1584 1585.. currentmodule:: sklearn 1586 1587.. autosummary:: 1588 :toctree: generated/ 1589 :template: function.rst 1590 1591 utils.arrayfuncs.min_pos 1592 utils.as_float_array 1593 utils.assert_all_finite 1594 utils.Bunch 1595 utils.check_X_y 1596 utils.check_array 1597 utils.check_scalar 1598 utils.check_consistent_length 1599 utils.check_random_state 1600 utils.class_weight.compute_class_weight 1601 utils.class_weight.compute_sample_weight 1602 utils.deprecated 1603 utils.estimator_checks.check_estimator 1604 utils.estimator_checks.parametrize_with_checks 1605 utils.estimator_html_repr 1606 utils.extmath.safe_sparse_dot 1607 utils.extmath.randomized_range_finder 1608 utils.extmath.randomized_svd 1609 utils.extmath.fast_logdet 1610 utils.extmath.density 1611 utils.extmath.weighted_mode 1612 utils.gen_batches 1613 utils.gen_even_slices 1614 utils.graph.single_source_shortest_path_length 1615 utils.indexable 1616 utils.metaestimators.if_delegate_has_method 1617 utils.metaestimators.available_if 1618 utils.multiclass.type_of_target 1619 utils.multiclass.is_multilabel 1620 utils.multiclass.unique_labels 1621 utils.murmurhash3_32 1622 utils.resample 1623 utils._safe_indexing 1624 utils.safe_mask 1625 utils.safe_sqr 1626 utils.shuffle 1627 utils.sparsefuncs.incr_mean_variance_axis 1628 utils.sparsefuncs.inplace_column_scale 1629 utils.sparsefuncs.inplace_row_scale 1630 utils.sparsefuncs.inplace_swap_row 1631 utils.sparsefuncs.inplace_swap_column 1632 utils.sparsefuncs.mean_variance_axis 1633 utils.sparsefuncs.inplace_csr_column_scale 1634 utils.sparsefuncs_fast.inplace_csr_row_normalize_l1 1635 utils.sparsefuncs_fast.inplace_csr_row_normalize_l2 1636 utils.random.sample_without_replacement 1637 utils.validation.check_is_fitted 1638 utils.validation.check_memory 1639 utils.validation.check_symmetric 1640 utils.validation.column_or_1d 1641 utils.validation.has_fit_parameter 1642 utils.all_estimators 1643 1644Utilities from joblib: 1645 1646.. autosummary:: 1647 :toctree: generated/ 1648 :template: function.rst 1649 1650 utils.parallel_backend 1651 utils.register_parallel_backend 1652 1653 1654Recently deprecated 1655=================== 1656 1657To be removed in 1.0 (renaming of 0.25) 1658--------------------------------------- 1659