├── CITATION.cff ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── COPYING ├── Makefile ├── README.rst ├── SECURITY.md ├── bench_num_threads.parquet ├── doc ├── Makefile ├── README.md ├── about.rst ├── api │ ├── deprecated.rst.template │ ├── index.rst.template │ └── module.rst.template ├── api_reference.py ├── binder │ └── requirements.txt ├── common_pitfalls.rst ├── communication_team.rst ├── communication_team_emeritus.rst ├── computing.rst ├── computing │ ├── computational_performance.rst │ ├── parallelism.rst │ └── scaling_strategies.rst ├── conf.py ├── conftest.py ├── contributor_experience_team.rst ├── contributor_experience_team_emeritus.rst ├── data_transforms.rst ├── datasets.rst ├── datasets │ ├── loading_other_datasets.rst │ ├── real_world.rst │ ├── sample_generators.rst │ └── toy_dataset.rst ├── developers │ ├── advanced_installation.rst │ ├── bug_triaging.rst │ ├── contributing.rst │ ├── cython.rst │ ├── develop.rst │ ├── index.rst │ ├── maintainer.rst.template │ ├── minimal_reproducer.rst │ ├── performance.rst │ ├── plotting.rst │ ├── tips.rst │ └── utilities.rst ├── dispatching.rst ├── documentation_team.rst ├── faq.rst ├── getting_started.rst ├── glossary.rst ├── governance.rst ├── images │ ├── Tidelift-logo-on-light.svg │ ├── axa-small.png │ ├── axa.png │ ├── bcg.png │ ├── beta_divergence.png │ ├── bnp-small.png │ ├── bnp.png │ ├── cds-logo.png │ ├── chanel-small.png │ ├── chanel.png │ ├── columbia-small.png │ ├── columbia.png │ ├── czi-small.png │ ├── czi.png │ ├── dataiku-small.png │ ├── dataiku.png │ ├── digicosme.png │ ├── dysco.png │ ├── fnrs-logo-small.png │ ├── fujitsu.png │ ├── generated-doc-ci.png │ ├── google-small.png │ ├── grid_search_cross_validation.png │ ├── grid_search_workflow.png │ ├── huggingface_logo-noborder.png │ ├── inria-logo.jpg │ ├── inria-small.png │ ├── intel-small.png │ ├── intel.png │ ├── iris.pdf │ ├── iris.svg │ ├── last_digit.png │ ├── lda_model_graph.png │ ├── logo_APHP.png │ ├── logo_APHP_text.png │ ├── microsoft-small.png │ ├── microsoft.png │ ├── ml_map.README.rst │ ├── ml_map.svg │ ├── multi_org_chart.png │ ├── multilayerperceptron_network.png │ ├── no_image.png │ ├── nvidia-small.png │ ├── nvidia.png │ ├── nyu_short_color.png │ ├── permuted_non_predictive_feature.png │ ├── permuted_predictive_feature.png │ ├── plot_digits_classification.png │ ├── plot_face_recognition_1.png │ ├── plot_face_recognition_2.png │ ├── png-logo-inria-la-fondation.png │ ├── probabl.png │ ├── quansight-labs-small.png │ ├── quansight-labs.png │ ├── rbm_graph.png │ ├── scikit-learn-logo-notext.png │ ├── scikit-learn-logo-small.png │ ├── sloan_banner.png │ ├── sloan_logo-small.png │ ├── sydney-primary.jpeg │ ├── sydney-stacked-small.png │ ├── target_encoder_cross_validation.svg │ ├── telecom-small.png │ ├── telecom.png │ ├── visual-studio-build-tools-selection.png │ ├── wellcome-trust-small.png │ └── wellcome-trust.png ├── index.rst.template ├── inspection.rst ├── install.rst ├── install_instructions_conda.rst ├── js │ └── scripts │ │ ├── api-search.js │ │ ├── dropdown.js │ │ ├── sg_plotly_resize.js │ │ ├── vendor │ │ └── svg-pan-zoom.min.js │ │ └── version-switcher.js ├── jupyter-lite.json ├── jupyter_lite_config.json ├── logos │ ├── 1280px-scikit-learn-logo.png │ ├── README.md │ ├── brand_colors │ │ ├── colorswatch_29ABE2_cyan.png │ │ ├── colorswatch_9B4600_brown.png │ │ └── colorswatch_F7931E_orange.png │ ├── brand_guidelines │ │ └── scikitlearn_logo_clearspace_updated.png │ ├── favicon.ico │ ├── identity.pdf │ ├── scikit-learn-logo-notext.png │ ├── scikit-learn-logo-small.png │ ├── scikit-learn-logo-thumb.png │ ├── scikit-learn-logo-without-subtitle.svg │ ├── scikit-learn-logo.bmp │ ├── scikit-learn-logo.png │ └── scikit-learn-logo.svg ├── machine_learning_map.rst ├── maintainers.rst ├── maintainers_emeritus.rst ├── make.bat ├── metadata_routing.rst ├── min_dependency_substitutions.rst.template ├── min_dependency_table.rst.template ├── model_persistence.rst ├── model_selection.rst ├── modules │ ├── array_api.rst │ ├── biclustering.rst │ ├── calibration.rst │ ├── classification_threshold.rst │ ├── clustering.rst │ ├── compose.rst │ ├── covariance.rst │ ├── cross_decomposition.rst │ ├── cross_validation.rst │ ├── decomposition.rst │ ├── density.rst │ ├── ensemble.rst │ ├── feature_extraction.rst │ ├── feature_selection.rst │ ├── gaussian_process.rst │ ├── glm_data │ │ ├── lasso_enet_coordinate_descent.png │ │ └── poisson_gamma_tweedie_distributions.png │ ├── grid_search.rst │ ├── impute.rst │ ├── isotonic.rst │ ├── kernel_approximation.rst │ ├── kernel_ridge.rst │ ├── lda_qda.rst │ ├── learning_curve.rst │ ├── linear_model.rst │ ├── manifold.rst │ ├── metrics.rst │ ├── mixture.rst │ ├── model_evaluation.rst │ ├── multiclass.rst │ ├── naive_bayes.rst │ ├── neighbors.rst │ ├── neural_networks_supervised.rst │ ├── neural_networks_unsupervised.rst │ ├── outlier_detection.rst │ ├── partial_dependence.rst │ ├── permutation_importance.rst │ ├── pipeline.rst │ ├── preprocessing.rst │ ├── preprocessing_targets.rst │ ├── random_projection.rst │ ├── semi_supervised.rst │ ├── sgd.rst │ ├── svm.rst │ ├── tree.rst │ └── unsupervised_reduction.rst ├── presentations.rst ├── related_projects.rst ├── roadmap.rst ├── scss │ ├── api-search.scss │ ├── api.scss │ ├── colors.scss │ ├── custom.scss │ └── index.scss ├── sphinxext │ ├── MANIFEST.in │ ├── allow_nan_estimators.py │ ├── autoshortsummary.py │ ├── doi_role.py │ ├── dropdown_anchors.py │ ├── github_link.py │ ├── override_pst_pagetoc.py │ └── sphinx_issues.py ├── supervised_learning.rst ├── support.rst ├── templates │ ├── base.rst │ ├── index.html │ ├── numpydoc_docstring.rst │ └── redirects.html ├── testimonials │ ├── README.txt │ ├── images │ │ ├── Makefile │ │ ├── aweber.png │ │ ├── bestofmedia-logo.png │ │ ├── betaworks.png │ │ ├── birchbox.jpg │ │ ├── bnp_paribas_cardif.png │ │ ├── booking.png │ │ ├── change-logo.png │ │ ├── dataiku_logo.png │ │ ├── datapublica.png │ │ ├── datarobot.png │ │ ├── evernote.png │ │ ├── howaboutwe.png │ │ ├── huggingface.png │ │ ├── infonea.jpg │ │ ├── inria.png │ │ ├── jpmorgan.png │ │ ├── lovely.png │ │ ├── machinalis.png │ │ ├── mars.png │ │ ├── okcupid.png │ │ ├── ottogroup_logo.png │ │ ├── peerindex.png │ │ ├── phimeca.png │ │ ├── rangespan.png │ │ ├── solido_logo.png │ │ ├── spotify.png │ │ ├── telecomparistech.jpg │ │ ├── yhat.png │ │ └── zopa.png │ └── testimonials.rst ├── unsupervised_learning.rst ├── user_guide.rst ├── visualizations.rst ├── whats_new.rst └── whats_new │ ├── _contributors.rst │ ├── changelog_legend.inc │ ├── older_versions.rst │ ├── upcoming_changes │ ├── README.md │ ├── array-api │ │ ├── 29519.feature.rst │ │ ├── 29978.feature.rst │ │ └── 30395.feature.rst │ ├── sklearn.covariance │ │ └── 30483.fix.rst │ ├── sklearn.datasets │ │ └── 30196.enhancement.rst │ ├── sklearn.decomposition │ │ └── 30443.feature.rst │ ├── sklearn.ensemble │ │ └── 30649.fix.rst │ ├── sklearn.inspection │ │ ├── 26202.enhancement.rst │ │ └── 30409.api.rst │ ├── sklearn.linear_model │ │ ├── 30057.fix.rst │ │ ├── 30521.fix.rst │ │ └── 30644.fix.rst │ ├── sklearn.metrics │ │ ├── 29288.enhancement.rst │ │ ├── 29288.fix.rst │ │ └── 29727.fix.rst │ ├── sklearn.mixture │ │ ├── 30414.efficiency.rst │ │ └── 30415.efficiency.rst │ ├── sklearn.multioutput │ │ └── 30152.enhancement.rst │ ├── sklearn.neural_network │ │ └── 30155.feature.rst │ ├── sklearn.pipeline │ │ └── 30406.enhancement.rst │ ├── sklearn.preprocessing │ │ ├── 29907.enhancement.rst │ │ └── 29907.fix.rst │ ├── sklearn.svm │ │ └── 30057.fix.rst │ ├── sklearn.utils │ │ ├── 29907.enhancement.rst │ │ ├── 30057.enhancement.rst │ │ ├── 30380.enhancement.rst │ │ └── 30775.fix.rst │ └── towncrier_template.rst.jinja2 │ ├── v0.13.rst │ ├── v0.14.rst │ ├── v0.15.rst │ ├── v0.16.rst │ ├── v0.17.rst │ ├── v0.18.rst │ ├── v0.19.rst │ ├── v0.20.rst │ ├── v0.21.rst │ ├── v0.22.rst │ ├── v0.23.rst │ ├── v0.24.rst │ ├── v1.0.rst │ ├── v1.1.rst │ ├── v1.2.rst │ ├── v1.3.rst │ ├── v1.4.rst │ ├── v1.5.rst │ ├── v1.6.rst │ └── v1.7.rst ├── examples ├── README.txt ├── applications │ ├── README.txt │ ├── plot_cyclical_feature_engineering.py │ ├── plot_digits_denoising.py │ ├── plot_face_recognition.py │ ├── plot_model_complexity_influence.py │ ├── plot_out_of_core_classification.py │ ├── plot_outlier_detection_wine.py │ ├── plot_prediction_latency.py │ ├── plot_species_distribution_modeling.py │ ├── plot_stock_market.py │ ├── plot_time_series_lagged_features.py │ ├── plot_tomography_l1_reconstruction.py │ ├── plot_topics_extraction_with_nmf_lda.py │ └── wikipedia_principal_eigenvector.py ├── bicluster │ ├── README.txt │ ├── plot_bicluster_newsgroups.py │ ├── plot_spectral_biclustering.py │ └── plot_spectral_coclustering.py ├── calibration │ ├── README.txt │ ├── plot_calibration.py │ ├── plot_calibration_curve.py │ ├── plot_calibration_multiclass.py │ └── plot_compare_calibration.py ├── classification │ ├── README.txt │ ├── plot_classification_probability.py │ ├── plot_classifier_comparison.py │ ├── plot_digits_classification.py │ ├── plot_lda.py │ └── plot_lda_qda.py ├── cluster │ ├── README.txt │ ├── plot_adjusted_for_chance_measures.py │ ├── plot_affinity_propagation.py │ ├── plot_agglomerative_clustering.py │ ├── plot_agglomerative_clustering_metrics.py │ ├── plot_agglomerative_dendrogram.py │ ├── plot_birch_vs_minibatchkmeans.py │ ├── plot_bisect_kmeans.py │ ├── plot_cluster_comparison.py │ ├── plot_coin_segmentation.py │ ├── plot_coin_ward_segmentation.py │ ├── plot_dbscan.py │ ├── plot_dict_face_patches.py │ ├── plot_digits_agglomeration.py │ ├── plot_digits_linkage.py │ ├── plot_face_compress.py │ ├── plot_feature_agglomeration_vs_univariate_selection.py │ ├── plot_hdbscan.py │ ├── plot_inductive_clustering.py │ ├── plot_kmeans_assumptions.py │ ├── plot_kmeans_digits.py │ ├── plot_kmeans_plusplus.py │ ├── plot_kmeans_silhouette_analysis.py │ ├── plot_kmeans_stability_low_dim_dense.py │ ├── plot_linkage_comparison.py │ ├── plot_mean_shift.py │ ├── plot_mini_batch_kmeans.py │ ├── plot_optics.py │ ├── plot_segmentation_toy.py │ └── plot_ward_structured_vs_unstructured.py ├── compose │ ├── README.txt │ ├── plot_column_transformer.py │ ├── plot_column_transformer_mixed_types.py │ ├── plot_compare_reduction.py │ ├── plot_digits_pipe.py │ ├── plot_feature_union.py │ └── plot_transformed_target.py ├── covariance │ ├── README.txt │ ├── plot_covariance_estimation.py │ ├── plot_lw_vs_oas.py │ ├── plot_mahalanobis_distances.py │ ├── plot_robust_vs_empirical_covariance.py │ └── plot_sparse_cov.py ├── cross_decomposition │ ├── README.txt │ ├── plot_compare_cross_decomposition.py │ └── plot_pcr_vs_pls.py ├── datasets │ ├── README.txt │ └── plot_random_multilabel_dataset.py ├── decomposition │ ├── README.txt │ ├── plot_faces_decomposition.py │ ├── plot_ica_blind_source_separation.py │ ├── plot_ica_vs_pca.py │ ├── plot_image_denoising.py │ ├── plot_incremental_pca.py │ ├── plot_kernel_pca.py │ ├── plot_pca_iris.py │ ├── plot_pca_vs_fa_model_selection.py │ ├── plot_pca_vs_lda.py │ ├── plot_sparse_coding.py │ └── plot_varimax_fa.py ├── developing_estimators │ ├── README.txt │ └── sklearn_is_fitted.py ├── ensemble │ ├── README.txt │ ├── plot_adaboost_multiclass.py │ ├── plot_adaboost_regression.py │ ├── plot_adaboost_twoclass.py │ ├── plot_bias_variance.py │ ├── plot_ensemble_oob.py │ ├── plot_feature_transformation.py │ ├── plot_forest_hist_grad_boosting_comparison.py │ ├── plot_forest_importances.py │ ├── plot_forest_iris.py │ ├── plot_gradient_boosting_categorical.py │ ├── plot_gradient_boosting_early_stopping.py │ ├── plot_gradient_boosting_oob.py │ ├── plot_gradient_boosting_quantile.py │ ├── plot_gradient_boosting_regression.py │ ├── plot_gradient_boosting_regularization.py │ ├── plot_hgbt_regression.py │ ├── plot_isolation_forest.py │ ├── plot_monotonic_constraints.py │ ├── plot_random_forest_embedding.py │ ├── plot_random_forest_regression_multioutput.py │ ├── plot_stack_predictors.py │ ├── plot_voting_decision_regions.py │ ├── plot_voting_probas.py │ └── plot_voting_regressor.py ├── feature_selection │ ├── README.txt │ ├── plot_f_test_vs_mi.py │ ├── plot_feature_selection.py │ ├── plot_feature_selection_pipeline.py │ ├── plot_rfe_digits.py │ ├── plot_rfe_with_cross_validation.py │ └── plot_select_from_model_diabetes.py ├── frozen │ ├── README.txt │ └── plot_frozen_examples.py ├── gaussian_process │ ├── README.txt │ ├── plot_compare_gpr_krr.py │ ├── plot_gpc.py │ ├── plot_gpc_iris.py │ ├── plot_gpc_isoprobability.py │ ├── plot_gpc_xor.py │ ├── plot_gpr_co2.py │ ├── plot_gpr_noisy.py │ ├── plot_gpr_noisy_targets.py │ ├── plot_gpr_on_structured_data.py │ └── plot_gpr_prior_posterior.py ├── impute │ ├── README.txt │ ├── plot_iterative_imputer_variants_comparison.py │ └── plot_missing_values.py ├── inspection │ ├── README.txt │ ├── plot_causal_interpretation.py │ ├── plot_linear_model_coefficient_interpretation.py │ ├── plot_partial_dependence.py │ ├── plot_permutation_importance.py │ └── plot_permutation_importance_multicollinear.py ├── kernel_approximation │ ├── README.txt │ └── plot_scalable_poly_kernels.py ├── linear_model │ ├── README.txt │ ├── plot_ard.py │ ├── plot_bayesian_ridge_curvefit.py │ ├── plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py │ ├── plot_huber_vs_ridge.py │ ├── plot_lasso_and_elasticnet.py │ ├── plot_lasso_dense_vs_sparse_data.py │ ├── plot_lasso_lars_ic.py │ ├── plot_lasso_lasso_lars_elasticnet_path.py │ ├── plot_lasso_model_selection.py │ ├── plot_logistic.py │ ├── plot_logistic_l1_l2_sparsity.py │ ├── plot_logistic_multinomial.py │ ├── plot_logistic_path.py │ ├── plot_multi_task_lasso_support.py │ ├── plot_nnls.py │ ├── plot_ols.py │ ├── plot_ols_ridge_variance.py │ ├── plot_omp.py │ ├── plot_poisson_regression_non_normal_loss.py │ ├── plot_polynomial_interpolation.py │ ├── plot_quantile_regression.py │ ├── plot_ransac.py │ ├── plot_ridge_coeffs.py │ ├── plot_ridge_path.py │ ├── plot_robust_fit.py │ ├── plot_sgd_comparison.py │ ├── plot_sgd_early_stopping.py │ ├── plot_sgd_iris.py │ ├── plot_sgd_loss_functions.py │ ├── plot_sgd_penalties.py │ ├── plot_sgd_separating_hyperplane.py │ ├── plot_sgd_weighted_samples.py │ ├── plot_sgdocsvm_vs_ocsvm.py │ ├── plot_sparse_logistic_regression_20newsgroups.py │ ├── plot_sparse_logistic_regression_mnist.py │ ├── plot_theilsen.py │ └── plot_tweedie_regression_insurance_claims.py ├── manifold │ ├── README.txt │ ├── plot_compare_methods.py │ ├── plot_lle_digits.py │ ├── plot_manifold_sphere.py │ ├── plot_mds.py │ ├── plot_swissroll.py │ └── plot_t_sne_perplexity.py ├── miscellaneous │ ├── README.txt │ ├── plot_anomaly_comparison.py │ ├── plot_display_object_visualization.py │ ├── plot_estimator_representation.py │ ├── plot_isotonic_regression.py │ ├── plot_johnson_lindenstrauss_bound.py │ ├── plot_kernel_approximation.py │ ├── plot_kernel_ridge_regression.py │ ├── plot_metadata_routing.py │ ├── plot_multilabel.py │ ├── plot_multioutput_face_completion.py │ ├── plot_outlier_detection_bench.py │ ├── plot_partial_dependence_visualization_api.py │ ├── plot_pipeline_display.py │ ├── plot_roc_curve_visualization_api.py │ └── plot_set_output.py ├── mixture │ ├── README.txt │ ├── plot_concentration_prior.py │ ├── plot_gmm.py │ ├── plot_gmm_covariances.py │ ├── plot_gmm_init.py │ ├── plot_gmm_pdf.py │ ├── plot_gmm_selection.py │ └── plot_gmm_sin.py ├── model_selection │ ├── README.txt │ ├── plot_confusion_matrix.py │ ├── plot_cost_sensitive_learning.py │ ├── plot_cv_indices.py │ ├── plot_cv_predict.py │ ├── plot_det.py │ ├── plot_grid_search_digits.py │ ├── plot_grid_search_refit_callable.py │ ├── plot_grid_search_stats.py │ ├── plot_grid_search_text_feature_extraction.py │ ├── plot_learning_curve.py │ ├── plot_likelihood_ratios.py │ ├── plot_multi_metric_evaluation.py │ ├── plot_nested_cross_validation_iris.py │ ├── plot_permutation_tests_for_classification.py │ ├── plot_precision_recall.py │ ├── plot_randomized_search.py │ ├── plot_roc.py │ ├── plot_roc_crossval.py │ ├── plot_successive_halving_heatmap.py │ ├── plot_successive_halving_iterations.py │ ├── plot_train_error_vs_test_error.py │ ├── plot_tuned_decision_threshold.py │ └── plot_underfitting_overfitting.py ├── multiclass │ ├── README.txt │ └── plot_multiclass_overview.py ├── multioutput │ ├── README.txt │ └── plot_classifier_chain_yeast.py ├── neighbors │ ├── README.txt │ ├── approximate_nearest_neighbors.py │ ├── plot_caching_nearest_neighbors.py │ ├── plot_classification.py │ ├── plot_digits_kde_sampling.py │ ├── plot_kde_1d.py │ ├── plot_lof_novelty_detection.py │ ├── plot_lof_outlier_detection.py │ ├── plot_nca_classification.py │ ├── plot_nca_dim_reduction.py │ ├── plot_nca_illustration.py │ ├── plot_nearest_centroid.py │ ├── plot_regression.py │ └── plot_species_kde.py ├── neural_networks │ ├── README.txt │ ├── plot_mlp_alpha.py │ ├── plot_mlp_training_curves.py │ ├── plot_mnist_filters.py │ └── plot_rbm_logistic_classification.py ├── preprocessing │ ├── README.txt │ ├── plot_all_scaling.py │ ├── plot_discretization.py │ ├── plot_discretization_classification.py │ ├── plot_discretization_strategies.py │ ├── plot_map_data_to_normal.py │ ├── plot_scaling_importance.py │ ├── plot_target_encoder.py │ └── plot_target_encoder_cross_val.py ├── release_highlights │ ├── README.txt │ ├── plot_release_highlights_0_22_0.py │ ├── plot_release_highlights_0_23_0.py │ ├── plot_release_highlights_0_24_0.py │ ├── plot_release_highlights_1_0_0.py │ ├── plot_release_highlights_1_1_0.py │ ├── plot_release_highlights_1_2_0.py │ ├── plot_release_highlights_1_3_0.py │ ├── plot_release_highlights_1_4_0.py │ ├── plot_release_highlights_1_5_0.py │ └── plot_release_highlights_1_6_0.py ├── semi_supervised │ ├── README.txt │ ├── plot_label_propagation_digits.py │ ├── plot_label_propagation_digits_active_learning.py │ ├── plot_label_propagation_structure.py │ ├── plot_self_training_varying_threshold.py │ ├── plot_semi_supervised_newsgroups.py │ └── plot_semi_supervised_versus_svm_iris.py ├── svm │ ├── README.txt │ ├── plot_custom_kernel.py │ ├── plot_iris_svc.py │ ├── plot_linearsvc_support_vectors.py │ ├── plot_oneclass.py │ ├── plot_rbf_parameters.py │ ├── plot_separating_hyperplane.py │ ├── plot_separating_hyperplane_unbalanced.py │ ├── plot_svm_anova.py │ ├── plot_svm_kernels.py │ ├── plot_svm_margin.py │ ├── plot_svm_regression.py │ ├── plot_svm_scale_c.py │ ├── plot_svm_tie_breaking.py │ └── plot_weighted_samples.py ├── text │ ├── README.txt │ ├── plot_document_classification_20newsgroups.py │ ├── plot_document_clustering.py │ └── plot_hashing_vs_dict_vectorizer.py └── tree │ ├── README.txt │ ├── plot_cost_complexity_pruning.py │ ├── plot_iris_dtc.py │ ├── plot_tree_regression.py │ └── plot_unveil_tree_structure.py ├── meson.build ├── pyproject.toml ├── setup.cfg └── sklearn ├── __check_build ├── __init__.py ├── _check_build.pyx └── meson.build ├── __init__.py ├── _build_utils ├── __init__.py ├── tempita.py └── version.py ├── _config.py ├── _distributor_init.py ├── _isotonic.pyx ├── _loss ├── __init__.py ├── _loss.pxd ├── _loss.pyx.tp ├── link.py ├── loss.py ├── meson.build └── tests │ ├── __init__.py │ ├── test_link.py │ └── test_loss.py ├── _min_dependencies.py ├── base.py ├── calibration.py ├── cluster ├── __init__.py ├── _affinity_propagation.py ├── _agglomerative.py ├── _bicluster.py ├── _birch.py ├── _bisect_k_means.py ├── _dbscan.py ├── _dbscan_inner.pyx ├── _feature_agglomeration.py ├── _hdbscan │ ├── __init__.py │ ├── _linkage.pyx │ ├── _reachability.pyx │ ├── _tree.pxd │ ├── _tree.pyx │ ├── hdbscan.py │ ├── meson.build │ └── tests │ │ ├── __init__.py │ │ └── test_reachibility.py ├── _hierarchical_fast.pxd ├── _hierarchical_fast.pyx ├── _k_means_common.pxd ├── _k_means_common.pyx ├── _k_means_elkan.pyx ├── _k_means_lloyd.pyx ├── _k_means_minibatch.pyx ├── _kmeans.py ├── _mean_shift.py ├── _optics.py ├── _spectral.py ├── meson.build └── tests │ ├── __init__.py │ ├── common.py │ ├── test_affinity_propagation.py │ ├── test_bicluster.py │ ├── test_birch.py │ ├── test_bisect_k_means.py │ ├── test_dbscan.py │ ├── test_feature_agglomeration.py │ ├── test_hdbscan.py │ ├── test_hierarchical.py │ ├── test_k_means.py │ ├── test_mean_shift.py │ ├── test_optics.py │ └── test_spectral.py ├── compose ├── __init__.py ├── _column_transformer.py ├── _target.py └── tests │ ├── __init__.py │ ├── test_column_transformer.py │ └── test_target.py ├── conftest.py ├── covariance ├── __init__.py ├── _elliptic_envelope.py ├── _empirical_covariance.py ├── _graph_lasso.py ├── _robust_covariance.py ├── _shrunk_covariance.py └── tests │ ├── __init__.py │ ├── test_covariance.py │ ├── test_elliptic_envelope.py │ ├── test_graphical_lasso.py │ └── test_robust_covariance.py ├── cross_decomposition ├── __init__.py ├── _pls.py └── tests │ ├── __init__.py │ └── test_pls.py ├── datasets ├── __init__.py ├── _arff_parser.py ├── _base.py ├── _california_housing.py ├── _covtype.py ├── _kddcup99.py ├── _lfw.py ├── _olivetti_faces.py ├── _openml.py ├── _rcv1.py ├── _samples_generator.py ├── _species_distributions.py ├── _svmlight_format_fast.pyx ├── _svmlight_format_io.py ├── _twenty_newsgroups.py ├── data │ ├── __init__.py │ ├── boston_house_prices.csv │ ├── breast_cancer.csv │ ├── diabetes_data_raw.csv.gz │ ├── diabetes_target.csv.gz │ ├── digits.csv.gz │ ├── iris.csv │ ├── linnerud_exercise.csv │ ├── linnerud_physiological.csv │ └── wine_data.csv ├── descr │ ├── __init__.py │ ├── breast_cancer.rst │ ├── california_housing.rst │ ├── covtype.rst │ ├── diabetes.rst │ ├── digits.rst │ ├── iris.rst │ ├── kddcup99.rst │ ├── lfw.rst │ ├── linnerud.rst │ ├── olivetti_faces.rst │ ├── rcv1.rst │ ├── species_distributions.rst │ ├── twenty_newsgroups.rst │ └── wine_data.rst ├── images │ ├── README.txt │ ├── __init__.py │ ├── china.jpg │ └── flower.jpg ├── meson.build └── tests │ ├── __init__.py │ ├── data │ ├── __init__.py │ ├── openml │ │ ├── __init__.py │ │ ├── id_1 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-1.json.gz │ │ │ ├── api-v1-jdf-1.json.gz │ │ │ ├── api-v1-jdq-1.json.gz │ │ │ └── data-v1-dl-1.arff.gz │ │ ├── id_1119 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-1119.json.gz │ │ │ ├── api-v1-jdf-1119.json.gz │ │ │ ├── api-v1-jdl-dn-adult-census-l-2-dv-1.json.gz │ │ │ ├── api-v1-jdl-dn-adult-census-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-1119.json.gz │ │ │ └── data-v1-dl-54002.arff.gz │ │ ├── id_1590 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-1590.json.gz │ │ │ ├── api-v1-jdf-1590.json.gz │ │ │ ├── api-v1-jdq-1590.json.gz │ │ │ └── data-v1-dl-1595261.arff.gz │ │ ├── id_2 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-2.json.gz │ │ │ ├── api-v1-jdf-2.json.gz │ │ │ ├── api-v1-jdl-dn-anneal-l-2-dv-1.json.gz │ │ │ ├── api-v1-jdl-dn-anneal-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-2.json.gz │ │ │ └── data-v1-dl-1666876.arff.gz │ │ ├── id_292 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-292.json.gz │ │ │ ├── api-v1-jd-40981.json.gz │ │ │ ├── api-v1-jdf-292.json.gz │ │ │ ├── api-v1-jdf-40981.json.gz │ │ │ ├── api-v1-jdl-dn-australian-l-2-dv-1-s-dact.json.gz │ │ │ ├── api-v1-jdl-dn-australian-l-2-dv-1.json.gz │ │ │ ├── api-v1-jdl-dn-australian-l-2-s-act-.json.gz │ │ │ └── data-v1-dl-49822.arff.gz │ │ ├── id_3 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-3.json.gz │ │ │ ├── api-v1-jdf-3.json.gz │ │ │ ├── api-v1-jdq-3.json.gz │ │ │ └── data-v1-dl-3.arff.gz │ │ ├── id_40589 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-40589.json.gz │ │ │ ├── api-v1-jdf-40589.json.gz │ │ │ ├── api-v1-jdl-dn-emotions-l-2-dv-3.json.gz │ │ │ ├── api-v1-jdl-dn-emotions-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-40589.json.gz │ │ │ └── data-v1-dl-4644182.arff.gz │ │ ├── id_40675 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-40675.json.gz │ │ │ ├── api-v1-jdf-40675.json.gz │ │ │ ├── api-v1-jdl-dn-glass2-l-2-dv-1-s-dact.json.gz │ │ │ ├── api-v1-jdl-dn-glass2-l-2-dv-1.json.gz │ │ │ ├── api-v1-jdl-dn-glass2-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-40675.json.gz │ │ │ └── data-v1-dl-4965250.arff.gz │ │ ├── id_40945 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-40945.json.gz │ │ │ ├── api-v1-jdf-40945.json.gz │ │ │ ├── api-v1-jdq-40945.json.gz │ │ │ └── data-v1-dl-16826755.arff.gz │ │ ├── id_40966 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-40966.json.gz │ │ │ ├── api-v1-jdf-40966.json.gz │ │ │ ├── api-v1-jdl-dn-miceprotein-l-2-dv-4.json.gz │ │ │ ├── api-v1-jdl-dn-miceprotein-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-40966.json.gz │ │ │ └── data-v1-dl-17928620.arff.gz │ │ ├── id_42074 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-42074.json.gz │ │ │ ├── api-v1-jdf-42074.json.gz │ │ │ ├── api-v1-jdq-42074.json.gz │ │ │ └── data-v1-dl-21552912.arff.gz │ │ ├── id_42585 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-42585.json.gz │ │ │ ├── api-v1-jdf-42585.json.gz │ │ │ ├── api-v1-jdq-42585.json.gz │ │ │ └── data-v1-dl-21854866.arff.gz │ │ ├── id_561 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-561.json.gz │ │ │ ├── api-v1-jdf-561.json.gz │ │ │ ├── api-v1-jdl-dn-cpu-l-2-dv-1.json.gz │ │ │ ├── api-v1-jdl-dn-cpu-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-561.json.gz │ │ │ └── data-v1-dl-52739.arff.gz │ │ ├── id_61 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-61.json.gz │ │ │ ├── api-v1-jdf-61.json.gz │ │ │ ├── api-v1-jdl-dn-iris-l-2-dv-1.json.gz │ │ │ ├── api-v1-jdl-dn-iris-l-2-s-act-.json.gz │ │ │ ├── api-v1-jdq-61.json.gz │ │ │ └── data-v1-dl-61.arff.gz │ │ └── id_62 │ │ │ ├── __init__.py │ │ │ ├── api-v1-jd-62.json.gz │ │ │ ├── api-v1-jdf-62.json.gz │ │ │ ├── api-v1-jdq-62.json.gz │ │ │ └── data-v1-dl-52352.arff.gz │ ├── svmlight_classification.txt │ ├── svmlight_invalid.txt │ ├── svmlight_invalid_order.txt │ └── svmlight_multilabel.txt │ ├── test_20news.py │ ├── test_arff_parser.py │ ├── test_base.py │ ├── test_california_housing.py │ ├── test_common.py │ ├── test_covtype.py │ ├── test_kddcup99.py │ ├── test_lfw.py │ ├── test_olivetti_faces.py │ ├── test_openml.py │ ├── test_rcv1.py │ ├── test_samples_generator.py │ └── test_svmlight_format.py ├── decomposition ├── __init__.py ├── _base.py ├── _cdnmf_fast.pyx ├── _dict_learning.py ├── _factor_analysis.py ├── _fastica.py ├── _incremental_pca.py ├── _kernel_pca.py ├── _lda.py ├── _nmf.py ├── _online_lda_fast.pyx ├── _pca.py ├── _sparse_pca.py ├── _truncated_svd.py ├── meson.build └── tests │ ├── __init__.py │ ├── test_dict_learning.py │ ├── test_factor_analysis.py │ ├── test_fastica.py │ ├── test_incremental_pca.py │ ├── test_kernel_pca.py │ ├── test_nmf.py │ ├── test_online_lda.py │ ├── test_pca.py │ ├── test_sparse_pca.py │ └── test_truncated_svd.py ├── discriminant_analysis.py ├── dummy.py ├── ensemble ├── __init__.py ├── _bagging.py ├── _base.py ├── _forest.py ├── _gb.py ├── _gradient_boosting.pyx ├── _hist_gradient_boosting │ ├── __init__.py │ ├── _binning.pyx │ ├── _bitset.pxd │ ├── _bitset.pyx │ ├── _gradient_boosting.pyx │ ├── _predictor.pyx │ ├── binning.py │ ├── common.pxd │ ├── common.pyx │ ├── gradient_boosting.py │ ├── grower.py │ ├── histogram.pyx │ ├── meson.build │ ├── predictor.py │ ├── splitting.pyx │ ├── tests │ │ ├── __init__.py │ │ ├── test_binning.py │ │ ├── test_bitset.py │ │ ├── test_compare_lightgbm.py │ │ ├── test_gradient_boosting.py │ │ ├── test_grower.py │ │ ├── test_histogram.py │ │ ├── test_monotonic_constraints.py │ │ ├── test_predictor.py │ │ ├── test_splitting.py │ │ └── test_warm_start.py │ └── utils.py ├── _iforest.py ├── _stacking.py ├── _voting.py ├── _weight_boosting.py ├── meson.build └── tests │ ├── __init__.py │ ├── test_bagging.py │ ├── test_base.py │ ├── test_common.py │ ├── test_forest.py │ ├── test_gradient_boosting.py │ ├── test_iforest.py │ ├── test_stacking.py │ ├── test_voting.py │ └── test_weight_boosting.py ├── exceptions.py ├── experimental ├── __init__.py ├── enable_halving_search_cv.py ├── enable_hist_gradient_boosting.py ├── enable_iterative_imputer.py └── tests │ ├── __init__.py │ ├── test_enable_hist_gradient_boosting.py │ ├── test_enable_iterative_imputer.py │ └── test_enable_successive_halving.py ├── externals ├── README ├── __init__.py ├── _arff.py ├── _packaging │ ├── __init__.py │ ├── _structures.py │ └── version.py ├── _scipy │ ├── __init__.py │ └── sparse │ │ ├── __init__.py │ │ └── csgraph │ │ ├── __init__.py │ │ └── _laplacian.py └── conftest.py ├── feature_extraction ├── __init__.py ├── _dict_vectorizer.py ├── _hash.py ├── _hashing_fast.pyx ├── _stop_words.py ├── image.py ├── meson.build ├── tests │ ├── __init__.py │ ├── test_dict_vectorizer.py │ ├── test_feature_hasher.py │ ├── test_image.py │ └── test_text.py └── text.py ├── feature_selection ├── __init__.py ├── _base.py ├── _from_model.py ├── _mutual_info.py ├── _rfe.py ├── _sequential.py ├── _univariate_selection.py ├── _variance_threshold.py └── tests │ ├── __init__.py │ ├── test_base.py │ ├── test_chi2.py │ ├── test_feature_select.py │ ├── test_from_model.py │ ├── test_mutual_info.py │ ├── test_rfe.py │ ├── test_sequential.py │ └── test_variance_threshold.py ├── frozen ├── __init__.py ├── _frozen.py └── tests │ ├── __init__.py │ └── test_frozen.py ├── gaussian_process ├── __init__.py ├── _gpc.py ├── _gpr.py ├── kernels.py └── tests │ ├── __init__.py │ ├── _mini_sequence_kernel.py │ ├── test_gpc.py │ ├── test_gpr.py │ └── test_kernels.py ├── impute ├── __init__.py ├── _base.py ├── _iterative.py ├── _knn.py └── tests │ ├── __init__.py │ ├── test_base.py │ ├── test_common.py │ ├── test_impute.py │ └── test_knn.py ├── inspection ├── __init__.py ├── _partial_dependence.py ├── _pd_utils.py ├── _permutation_importance.py ├── _plot │ ├── __init__.py │ ├── decision_boundary.py │ ├── partial_dependence.py │ └── tests │ │ ├── __init__.py │ │ ├── test_boundary_decision_display.py │ │ └── test_plot_partial_dependence.py └── tests │ ├── __init__.py │ ├── test_partial_dependence.py │ ├── test_pd_utils.py │ └── test_permutation_importance.py ├── isotonic.py ├── kernel_approximation.py ├── kernel_ridge.py ├── linear_model ├── __init__.py ├── _base.py ├── _bayes.py ├── _cd_fast.pyx ├── _coordinate_descent.py ├── _glm │ ├── __init__.py │ ├── _newton_solver.py │ ├── glm.py │ └── tests │ │ ├── __init__.py │ │ └── test_glm.py ├── _huber.py ├── _least_angle.py ├── _linear_loss.py ├── _logistic.py ├── _omp.py ├── _passive_aggressive.py ├── _perceptron.py ├── _quantile.py ├── _ransac.py ├── _ridge.py ├── _sag.py ├── _sag_fast.pyx.tp ├── _sgd_fast.pyx.tp ├── _stochastic_gradient.py ├── _theil_sen.py ├── meson.build └── tests │ ├── __init__.py │ ├── test_base.py │ ├── test_bayes.py │ ├── test_common.py │ ├── test_coordinate_descent.py │ ├── test_huber.py │ ├── test_least_angle.py │ ├── test_linear_loss.py │ ├── test_logistic.py │ ├── test_omp.py │ ├── test_passive_aggressive.py │ ├── test_perceptron.py │ ├── test_quantile.py │ ├── test_ransac.py │ ├── test_ridge.py │ ├── test_sag.py │ ├── test_sgd.py │ ├── test_sparse_coordinate_descent.py │ └── test_theil_sen.py ├── manifold ├── __init__.py ├── _barnes_hut_tsne.pyx ├── _isomap.py ├── _locally_linear.py ├── _mds.py ├── _spectral_embedding.py ├── _t_sne.py ├── _utils.pyx ├── meson.build └── tests │ ├── __init__.py │ ├── test_isomap.py │ ├── test_locally_linear.py │ ├── test_mds.py │ ├── test_spectral_embedding.py │ └── test_t_sne.py ├── meson.build ├── metrics ├── __init__.py ├── _base.py ├── _classification.py ├── _dist_metrics.pxd.tp ├── _dist_metrics.pyx.tp ├── _pairwise_distances_reduction │ ├── __init__.py │ ├── _argkmin.pxd.tp │ ├── _argkmin.pyx.tp │ ├── _argkmin_classmode.pyx.tp │ ├── _base.pxd.tp │ ├── _base.pyx.tp │ ├── _classmode.pxd │ ├── _datasets_pair.pxd.tp │ ├── _datasets_pair.pyx.tp │ ├── _dispatcher.py │ ├── _middle_term_computer.pxd.tp │ ├── _middle_term_computer.pyx.tp │ ├── _radius_neighbors.pxd.tp │ ├── _radius_neighbors.pyx.tp │ ├── _radius_neighbors_classmode.pyx.tp │ └── meson.build ├── _pairwise_fast.pyx ├── _plot │ ├── __init__.py │ ├── confusion_matrix.py │ ├── det_curve.py │ ├── precision_recall_curve.py │ ├── regression.py │ ├── roc_curve.py │ └── tests │ │ ├── __init__.py │ │ ├── test_common_curve_display.py │ │ ├── test_confusion_matrix_display.py │ │ ├── test_det_curve_display.py │ │ ├── test_precision_recall_display.py │ │ ├── test_predict_error_display.py │ │ └── test_roc_curve_display.py ├── _ranking.py ├── _regression.py ├── _scorer.py ├── cluster │ ├── __init__.py │ ├── _bicluster.py │ ├── _expected_mutual_info_fast.pyx │ ├── _supervised.py │ ├── _unsupervised.py │ ├── meson.build │ └── tests │ │ ├── __init__.py │ │ ├── test_bicluster.py │ │ ├── test_common.py │ │ ├── test_supervised.py │ │ └── test_unsupervised.py ├── meson.build ├── pairwise.py └── tests │ ├── __init__.py │ ├── test_classification.py │ ├── test_common.py │ ├── test_dist_metrics.py │ ├── test_pairwise.py │ ├── test_pairwise_distances_reduction.py │ ├── test_ranking.py │ ├── test_regression.py │ └── test_score_objects.py ├── mixture ├── __init__.py ├── _base.py ├── _bayesian_mixture.py ├── _gaussian_mixture.py └── tests │ ├── __init__.py │ ├── test_bayesian_mixture.py │ ├── test_gaussian_mixture.py │ └── test_mixture.py ├── model_selection ├── __init__.py ├── _classification_threshold.py ├── _plot.py ├── _search.py ├── _search_successive_halving.py ├── _split.py ├── _validation.py └── tests │ ├── __init__.py │ ├── common.py │ ├── test_classification_threshold.py │ ├── test_plot.py │ ├── test_search.py │ ├── test_split.py │ ├── test_successive_halving.py │ └── test_validation.py ├── multiclass.py ├── multioutput.py ├── naive_bayes.py ├── neighbors ├── __init__.py ├── _ball_tree.pyx.tp ├── _base.py ├── _binary_tree.pxi.tp ├── _classification.py ├── _graph.py ├── _kd_tree.pyx.tp ├── _kde.py ├── _lof.py ├── _nca.py ├── _nearest_centroid.py ├── _partition_nodes.pxd ├── _partition_nodes.pyx ├── _quad_tree.pxd ├── _quad_tree.pyx ├── _regression.py ├── _unsupervised.py ├── meson.build └── tests │ ├── __init__.py │ ├── test_ball_tree.py │ ├── test_graph.py │ ├── test_kd_tree.py │ ├── test_kde.py │ ├── test_lof.py │ ├── test_nca.py │ ├── test_nearest_centroid.py │ ├── test_neighbors.py │ ├── test_neighbors_pipeline.py │ ├── test_neighbors_tree.py │ └── test_quad_tree.py ├── neural_network ├── __init__.py ├── _base.py ├── _multilayer_perceptron.py ├── _rbm.py ├── _stochastic_optimizers.py └── tests │ ├── __init__.py │ ├── test_base.py │ ├── test_mlp.py │ ├── test_rbm.py │ └── test_stochastic_optimizers.py ├── pipeline.py ├── preprocessing ├── __init__.py ├── _csr_polynomial_expansion.pyx ├── _data.py ├── _discretization.py ├── _encoders.py ├── _function_transformer.py ├── _label.py ├── _polynomial.py ├── _target_encoder.py ├── _target_encoder_fast.pyx ├── meson.build └── tests │ ├── __init__.py │ ├── test_common.py │ ├── test_data.py │ ├── test_discretization.py │ ├── test_encoders.py │ ├── test_function_transformer.py │ ├── test_label.py │ ├── test_polynomial.py │ └── test_target_encoder.py ├── random_projection.py ├── semi_supervised ├── __init__.py ├── _label_propagation.py ├── _self_training.py └── tests │ ├── __init__.py │ ├── test_label_propagation.py │ └── test_self_training.py ├── svm ├── __init__.py ├── _base.py ├── _bounds.py ├── _classes.py ├── _liblinear.pxi ├── _liblinear.pyx ├── _libsvm.pxi ├── _libsvm.pyx ├── _libsvm_sparse.pyx ├── _newrand.pyx ├── meson.build ├── src │ ├── liblinear │ │ ├── COPYRIGHT │ │ ├── _cython_blas_helpers.h │ │ ├── liblinear_helper.c │ │ ├── linear.cpp │ │ ├── linear.h │ │ ├── tron.cpp │ │ └── tron.h │ ├── libsvm │ │ ├── LIBSVM_CHANGES │ │ ├── _svm_cython_blas_helpers.h │ │ ├── libsvm_helper.c │ │ ├── libsvm_sparse_helper.c │ │ ├── libsvm_template.cpp │ │ ├── svm.cpp │ │ └── svm.h │ └── newrand │ │ └── newrand.h └── tests │ ├── __init__.py │ ├── test_bounds.py │ ├── test_sparse.py │ └── test_svm.py ├── tests ├── __init__.py ├── metadata_routing_common.py ├── test_base.py ├── test_build.py ├── test_calibration.py ├── test_check_build.py ├── test_common.py ├── test_config.py ├── test_discriminant_analysis.py ├── test_docstring_parameters.py ├── test_docstrings.py ├── test_dummy.py ├── test_init.py ├── test_isotonic.py ├── test_kernel_approximation.py ├── test_kernel_ridge.py ├── test_metadata_routing.py ├── test_metaestimators.py ├── test_metaestimators_metadata_routing.py ├── test_min_dependencies_readme.py ├── test_multiclass.py ├── test_multioutput.py ├── test_naive_bayes.py ├── test_pipeline.py ├── test_public_functions.py └── test_random_projection.py ├── tree ├── __init__.py ├── _classes.py ├── _criterion.pxd ├── _criterion.pyx ├── _export.py ├── _partitioner.pxd ├── _partitioner.pyx ├── _reingold_tilford.py ├── _splitter.pxd ├── _splitter.pyx ├── _tree.pxd ├── _tree.pyx ├── _utils.pxd ├── _utils.pyx ├── meson.build └── tests │ ├── __init__.py │ ├── test_export.py │ ├── test_monotonic_tree.py │ ├── test_reingold_tilford.py │ └── test_tree.py └── utils ├── __init__.py ├── _arpack.py ├── _array_api.py ├── _available_if.py ├── _bunch.py ├── _chunking.py ├── _cython_blas.pxd ├── _cython_blas.pyx ├── _encode.py ├── _estimator_html_repr.css ├── _estimator_html_repr.py ├── _fast_dict.pxd ├── _fast_dict.pyx ├── _heap.pxd ├── _heap.pyx ├── _indexing.py ├── _isfinite.pyx ├── _joblib.py ├── _mask.py ├── _metadata_requests.py ├── _missing.py ├── _mocking.py ├── _openmp_helpers.pxd ├── _openmp_helpers.pyx ├── _optional_dependencies.py ├── _param_validation.py ├── _plotting.py ├── _pprint.py ├── _random.pxd ├── _random.pyx ├── _response.py ├── _seq_dataset.pxd.tp ├── _seq_dataset.pyx.tp ├── _set_output.py ├── _show_versions.py ├── _sorting.pxd ├── _sorting.pyx ├── _tags.py ├── _test_common ├── __init__.py └── instance_generator.py ├── _testing.py ├── _typedefs.pxd ├── _typedefs.pyx ├── _unique.py ├── _user_interface.py ├── _vector_sentinel.pxd ├── _vector_sentinel.pyx ├── _weight_vector.pxd.tp ├── _weight_vector.pyx.tp ├── arrayfuncs.pyx ├── class_weight.py ├── deprecation.py ├── discovery.py ├── estimator_checks.py ├── extmath.py ├── fixes.py ├── graph.py ├── meson.build ├── metadata_routing.py ├── metaestimators.py ├── multiclass.py ├── murmurhash.pxd ├── murmurhash.pyx ├── optimize.py ├── parallel.py ├── random.py ├── sparsefuncs.py ├── sparsefuncs_fast.pyx ├── src ├── MurmurHash3.cpp └── MurmurHash3.h ├── stats.py ├── tests ├── __init__.py ├── test_arpack.py ├── test_array_api.py ├── test_arrayfuncs.py ├── test_bunch.py ├── test_chunking.py ├── test_class_weight.py ├── test_cython_blas.py ├── test_deprecation.py ├── test_encode.py ├── test_estimator_checks.py ├── test_estimator_html_repr.py ├── test_extmath.py ├── test_fast_dict.py ├── test_fixes.py ├── test_graph.py ├── test_indexing.py ├── test_mask.py ├── test_metaestimators.py ├── test_missing.py ├── test_mocking.py ├── test_multiclass.py ├── test_murmurhash.py ├── test_optimize.py ├── test_parallel.py ├── test_param_validation.py ├── test_plotting.py ├── test_pprint.py ├── test_random.py ├── test_response.py ├── test_seq_dataset.py ├── test_set_output.py ├── test_shortest_path.py ├── test_show_versions.py ├── test_sparsefuncs.py ├── test_stats.py ├── test_tags.py ├── test_testing.py ├── test_typedefs.py ├── test_unique.py ├── test_user_interface.py ├── test_utils.py ├── test_validation.py └── test_weight_vector.py └── validation.py /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | We are a community based on openness, as well as friendly and didactic discussions. 4 | 5 | We aspire to treat everybody equally, and value their contributions. 6 | 7 | Decisions are made based on technical merit and consensus. 8 | 9 | Code is not the only way to help the project. Reviewing pull requests, 10 | answering questions to help others on mailing lists or issues, organizing and 11 | teaching tutorials, working on the website, improving the documentation, are 12 | all priceless contributions. 13 | 14 | We abide by the principles of openness, respect, and consideration of others of 15 | the Python Software Foundation: https://www.python.org/psf/codeofconduct/ 16 | 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # simple makefile to simplify repetitive build env management tasks under posix 2 | 3 | PYTHON ?= python 4 | DEFAULT_MESON_BUILD_DIR = build/cp$(shell python -c 'import sys; print(f"{sys.version_info.major}{sys.version_info.minor}")' ) 5 | 6 | all: 7 | @echo "Please use 'make ' where is one of" 8 | @echo " dev build scikit-learn with Meson" 9 | @echo " clean clean scikit-learn Meson build. Very rarely needed," 10 | @echo " since meson-python recompiles on import." 11 | 12 | .PHONY: all 13 | 14 | dev: dev-meson 15 | 16 | dev-meson: 17 | pip install --verbose --no-build-isolation --editable . --config-settings editable-verbose=true 18 | 19 | clean: clean-meson 20 | 21 | clean-meson: 22 | pip uninstall -y scikit-learn 23 | # It seems in some cases removing the folder avoids weird compilation 24 | # errors (e.g. when switching from numpy>=2 to numpy<2). For some 25 | # reason ninja clean -C $(DEFAULT_MESON_BUILD_DIR) is not 26 | # enough. 27 | rm -rf $(DEFAULT_MESON_BUILD_DIR) 28 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------------- | ------------------ | 7 | | 1.6.1 | :white_check_mark: | 8 | | < 1.6.1 | :x: | 9 | 10 | ## Reporting a Vulnerability 11 | 12 | Please report security vulnerabilities by email to `security@scikit-learn.org`. 13 | This email is an alias to a subset of the scikit-learn maintainers' team. 14 | 15 | If the security vulnerability is accepted, a patch will be crafted privately 16 | in order to prepare a dedicated bugfix release as timely as possible (depending 17 | on the complexity of the fix). 18 | 19 | In addition to sending the report by email, you can also report security 20 | vulnerabilities to [tidelift](https://tidelift.com/security). 21 | -------------------------------------------------------------------------------- /bench_num_threads.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/bench_num_threads.parquet -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # Documentation for scikit-learn 2 | 3 | This directory contains the full manual and website as displayed at 4 | https://scikit-learn.org. See 5 | https://scikit-learn.org/dev/developers/contributing.html#documentation for 6 | detailed information about the documentation. 7 | -------------------------------------------------------------------------------- /doc/api/deprecated.rst.template: -------------------------------------------------------------------------------- 1 | :html_theme.sidebar_secondary.remove: 2 | 3 | .. _api_depr_ref: 4 | 5 | Recently Deprecated 6 | =================== 7 | 8 | .. currentmodule:: sklearn 9 | 10 | {% for ver, objs in DEPRECATED_API_REFERENCE %} 11 | .. _api_depr_ref-{{ ver|replace(".", "-") }}: 12 | 13 | .. rubric:: To be removed in {{ ver }} 14 | 15 | .. autosummary:: 16 | :nosignatures: 17 | :toctree: ../modules/generated/ 18 | :template: base.rst 19 | 20 | {% for obj in objs %} 21 | {{ obj }} 22 | {%- endfor %} 23 | 24 | {% endfor %} 25 | -------------------------------------------------------------------------------- /doc/api/module.rst.template: -------------------------------------------------------------------------------- 1 | :html_theme.sidebar_secondary.remove: 2 | 3 | {% if module == "sklearn" -%} 4 | {%- set module_hook = "sklearn" -%} 5 | {%- elif module.startswith("sklearn.") -%} 6 | {%- set module_hook = module[8:] -%} 7 | {%- else -%} 8 | {%- set module_hook = None -%} 9 | {%- endif -%} 10 | 11 | {% if module_hook %} 12 | .. _{{ module_hook }}_ref: 13 | {% endif %} 14 | 15 | {{ module }} 16 | {{ "=" * module|length }} 17 | 18 | .. automodule:: {{ module }} 19 | 20 | {% if module_info["description"] %} 21 | {{ module_info["description"] }} 22 | {% endif %} 23 | 24 | {% for section in module_info["sections"] %} 25 | {% if section["title"] and module_hook %} 26 | .. _{{ module_hook }}_ref-{{ section["title"]|lower|replace(" ", "-") }}: 27 | {% endif %} 28 | 29 | {% if section["title"] %} 30 | {{ section["title"] }} 31 | {{ "-" * section["title"]|length }} 32 | {% endif %} 33 | 34 | {% if section["description"] %} 35 | {{ section["description"] }} 36 | {% endif %} 37 | 38 | .. autosummary:: 39 | :nosignatures: 40 | :toctree: ../modules/generated/ 41 | :template: base.rst 42 | 43 | {% for obj in section["autosummary"] %} 44 | {{ obj }} 45 | {%- endfor %} 46 | {% endfor %} 47 | -------------------------------------------------------------------------------- /doc/binder/requirements.txt: -------------------------------------------------------------------------------- 1 | # A binder requirement file is required by sphinx-gallery. 2 | # We don't really need one since our binder requirement file lives in the 3 | # .binder directory. 4 | # This file can be removed if 'dependencies' is made an optional key for 5 | # binder in sphinx-gallery. 6 | -------------------------------------------------------------------------------- /doc/communication_team.rst: -------------------------------------------------------------------------------- 1 | .. raw :: html 2 | 3 | 4 |
5 | 8 |
9 |
10 |

Lauren Burke-McCarthy

11 |
12 |
13 |
14 |

François Goupil

15 |
16 |
17 | -------------------------------------------------------------------------------- /doc/communication_team_emeritus.rst: -------------------------------------------------------------------------------- 1 | - Reshama Shaikh 2 | -------------------------------------------------------------------------------- /doc/computing.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Computing with scikit-learn 3 | ============================ 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | computing/scaling_strategies 9 | computing/computational_performance 10 | computing/parallelism 11 | -------------------------------------------------------------------------------- /doc/contributor_experience_team_emeritus.rst: -------------------------------------------------------------------------------- 1 | - Chiara Marmo 2 | -------------------------------------------------------------------------------- /doc/data_transforms.rst: -------------------------------------------------------------------------------- 1 | .. _data-transforms: 2 | 3 | Dataset transformations 4 | ----------------------- 5 | 6 | scikit-learn provides a library of transformers, which may clean (see 7 | :ref:`preprocessing`), reduce (see :ref:`data_reduction`), expand (see 8 | :ref:`kernel_approximation`) or generate (see :ref:`feature_extraction`) 9 | feature representations. 10 | 11 | Like other estimators, these are represented by classes with a ``fit`` method, 12 | which learns model parameters (e.g. mean and standard deviation for 13 | normalization) from a training set, and a ``transform`` method which applies 14 | this transformation model to unseen data. ``fit_transform`` may be more 15 | convenient and efficient for modelling and transforming the training data 16 | simultaneously. 17 | 18 | Combining such transformers, either in parallel or series is covered in 19 | :ref:`combining_estimators`. :ref:`metrics` covers transforming feature 20 | spaces into affinity matrices, while :ref:`preprocessing_targets` considers 21 | transformations of the target space (e.g. categorical labels) for use in 22 | scikit-learn. 23 | 24 | .. toctree:: 25 | :maxdepth: 2 26 | 27 | modules/compose 28 | modules/feature_extraction 29 | modules/preprocessing 30 | modules/impute 31 | modules/unsupervised_reduction 32 | modules/random_projection 33 | modules/kernel_approximation 34 | modules/metrics 35 | modules/preprocessing_targets 36 | -------------------------------------------------------------------------------- /doc/datasets/real_world.rst: -------------------------------------------------------------------------------- 1 | .. _real_world_datasets: 2 | 3 | Real world datasets 4 | =================== 5 | 6 | .. currentmodule:: sklearn.datasets 7 | 8 | scikit-learn provides tools to load larger datasets, downloading them if 9 | necessary. 10 | 11 | They can be loaded using the following functions: 12 | 13 | .. autosummary:: 14 | 15 | fetch_olivetti_faces 16 | fetch_20newsgroups 17 | fetch_20newsgroups_vectorized 18 | fetch_lfw_people 19 | fetch_lfw_pairs 20 | fetch_covtype 21 | fetch_rcv1 22 | fetch_kddcup99 23 | fetch_california_housing 24 | fetch_species_distributions 25 | 26 | .. include:: ../../sklearn/datasets/descr/olivetti_faces.rst 27 | 28 | .. include:: ../../sklearn/datasets/descr/twenty_newsgroups.rst 29 | 30 | .. include:: ../../sklearn/datasets/descr/lfw.rst 31 | 32 | .. include:: ../../sklearn/datasets/descr/covtype.rst 33 | 34 | .. include:: ../../sklearn/datasets/descr/rcv1.rst 35 | 36 | .. include:: ../../sklearn/datasets/descr/kddcup99.rst 37 | 38 | .. include:: ../../sklearn/datasets/descr/california_housing.rst 39 | 40 | .. include:: ../../sklearn/datasets/descr/species_distributions.rst 41 | -------------------------------------------------------------------------------- /doc/datasets/toy_dataset.rst: -------------------------------------------------------------------------------- 1 | .. _toy_datasets: 2 | 3 | Toy datasets 4 | ============ 5 | 6 | .. currentmodule:: sklearn.datasets 7 | 8 | scikit-learn comes with a few small standard datasets that do not require to 9 | download any file from some external website. 10 | 11 | They can be loaded using the following functions: 12 | 13 | .. autosummary:: 14 | 15 | load_iris 16 | load_diabetes 17 | load_digits 18 | load_linnerud 19 | load_wine 20 | load_breast_cancer 21 | 22 | These datasets are useful to quickly illustrate the behavior of the 23 | various algorithms implemented in scikit-learn. They are however often too 24 | small to be representative of real world machine learning tasks. 25 | 26 | .. include:: ../../sklearn/datasets/descr/iris.rst 27 | 28 | .. include:: ../../sklearn/datasets/descr/diabetes.rst 29 | 30 | .. include:: ../../sklearn/datasets/descr/digits.rst 31 | 32 | .. include:: ../../sklearn/datasets/descr/linnerud.rst 33 | 34 | .. include:: ../../sklearn/datasets/descr/wine_data.rst 35 | 36 | .. include:: ../../sklearn/datasets/descr/breast_cancer.rst 37 | -------------------------------------------------------------------------------- /doc/developers/index.rst: -------------------------------------------------------------------------------- 1 | .. _developers_guide: 2 | 3 | ================= 4 | Developer's Guide 5 | ================= 6 | 7 | .. toctree:: 8 | 9 | contributing 10 | minimal_reproducer 11 | develop 12 | tips 13 | utilities 14 | performance 15 | cython 16 | advanced_installation 17 | bug_triaging 18 | maintainer 19 | plotting 20 | -------------------------------------------------------------------------------- /doc/dispatching.rst: -------------------------------------------------------------------------------- 1 | =========== 2 | Dispatching 3 | =========== 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | modules/array_api 9 | -------------------------------------------------------------------------------- /doc/documentation_team.rst: -------------------------------------------------------------------------------- 1 | .. raw :: html 2 | 3 | 4 |
5 | 8 |
9 |
10 |

Arturo Amor

11 |
12 |
13 |
14 |

Lucy Liu

15 |
16 |
17 |
18 |

Maren Westermann

19 |
20 |
21 |
22 |

Yao Xiao

23 |
24 |
25 | -------------------------------------------------------------------------------- /doc/images/axa-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/axa-small.png -------------------------------------------------------------------------------- /doc/images/axa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/axa.png -------------------------------------------------------------------------------- /doc/images/bcg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/bcg.png -------------------------------------------------------------------------------- /doc/images/beta_divergence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/beta_divergence.png -------------------------------------------------------------------------------- /doc/images/bnp-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/bnp-small.png -------------------------------------------------------------------------------- /doc/images/bnp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/bnp.png -------------------------------------------------------------------------------- /doc/images/cds-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/cds-logo.png -------------------------------------------------------------------------------- /doc/images/chanel-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/chanel-small.png -------------------------------------------------------------------------------- /doc/images/chanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/chanel.png -------------------------------------------------------------------------------- /doc/images/columbia-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/columbia-small.png -------------------------------------------------------------------------------- /doc/images/columbia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/columbia.png -------------------------------------------------------------------------------- /doc/images/czi-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/czi-small.png -------------------------------------------------------------------------------- /doc/images/czi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/czi.png -------------------------------------------------------------------------------- /doc/images/dataiku-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/dataiku-small.png -------------------------------------------------------------------------------- /doc/images/dataiku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/dataiku.png -------------------------------------------------------------------------------- /doc/images/digicosme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/digicosme.png -------------------------------------------------------------------------------- /doc/images/dysco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/dysco.png -------------------------------------------------------------------------------- /doc/images/fnrs-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/fnrs-logo-small.png -------------------------------------------------------------------------------- /doc/images/fujitsu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/fujitsu.png -------------------------------------------------------------------------------- /doc/images/generated-doc-ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/generated-doc-ci.png -------------------------------------------------------------------------------- /doc/images/google-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/google-small.png -------------------------------------------------------------------------------- /doc/images/grid_search_cross_validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/grid_search_cross_validation.png -------------------------------------------------------------------------------- /doc/images/grid_search_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/grid_search_workflow.png -------------------------------------------------------------------------------- /doc/images/huggingface_logo-noborder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/huggingface_logo-noborder.png -------------------------------------------------------------------------------- /doc/images/inria-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/inria-logo.jpg -------------------------------------------------------------------------------- /doc/images/inria-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/inria-small.png -------------------------------------------------------------------------------- /doc/images/intel-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/intel-small.png -------------------------------------------------------------------------------- /doc/images/intel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/intel.png -------------------------------------------------------------------------------- /doc/images/iris.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/iris.pdf -------------------------------------------------------------------------------- /doc/images/last_digit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/last_digit.png -------------------------------------------------------------------------------- /doc/images/lda_model_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/lda_model_graph.png -------------------------------------------------------------------------------- /doc/images/logo_APHP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/logo_APHP.png -------------------------------------------------------------------------------- /doc/images/logo_APHP_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/logo_APHP_text.png -------------------------------------------------------------------------------- /doc/images/microsoft-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/microsoft-small.png -------------------------------------------------------------------------------- /doc/images/microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/microsoft.png -------------------------------------------------------------------------------- /doc/images/ml_map.README.rst: -------------------------------------------------------------------------------- 1 | The scikit-learn machine learning cheat sheet was originally created by Andreas Mueller: 2 | https://peekaboo-vision.blogspot.de/2013/01/machine-learning-cheat-sheet-for-scikit.html 3 | 4 | The current version of the chart is located at `doc/images/ml_map.svg` in SVG+XML 5 | format, created using [draw.io](https://draw.io/). To edit the chart, open the file in 6 | draw.io, make changes, and save. This should update the chart in-place. Another option 7 | would be to re-export the chart as SVG and replace the existing file. The options used 8 | for exporting the chart are: 9 | 10 | - Zoom: 100% 11 | - Border width: 15 12 | - Size: Diagram 13 | - Transparent Background: False 14 | - Appearance: Light 15 | 16 | Note that estimators nodes are clickable and should go to the estimator 17 | documentation. After updating or re-exporting the SVG with draw.io, the links 18 | may be prefixed with e.g. `https://app.diagrams.net/`. Remember to check and 19 | remove them, for instance by replacing all occurrences of 20 | `https://app.diagrams.net/./` with `./` with the following command: 21 | 22 | .. prompt:: bash 23 | 24 | perl -pi -e 's@https://app.diagrams.net/\./@./@g' doc/images/ml_map.svg 25 | -------------------------------------------------------------------------------- /doc/images/multi_org_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/multi_org_chart.png -------------------------------------------------------------------------------- /doc/images/multilayerperceptron_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/multilayerperceptron_network.png -------------------------------------------------------------------------------- /doc/images/no_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/no_image.png -------------------------------------------------------------------------------- /doc/images/nvidia-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/nvidia-small.png -------------------------------------------------------------------------------- /doc/images/nvidia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/nvidia.png -------------------------------------------------------------------------------- /doc/images/nyu_short_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/nyu_short_color.png -------------------------------------------------------------------------------- /doc/images/permuted_non_predictive_feature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/permuted_non_predictive_feature.png -------------------------------------------------------------------------------- /doc/images/permuted_predictive_feature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/permuted_predictive_feature.png -------------------------------------------------------------------------------- /doc/images/plot_digits_classification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/plot_digits_classification.png -------------------------------------------------------------------------------- /doc/images/plot_face_recognition_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/plot_face_recognition_1.png -------------------------------------------------------------------------------- /doc/images/plot_face_recognition_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/plot_face_recognition_2.png -------------------------------------------------------------------------------- /doc/images/png-logo-inria-la-fondation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/png-logo-inria-la-fondation.png -------------------------------------------------------------------------------- /doc/images/probabl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/probabl.png -------------------------------------------------------------------------------- /doc/images/quansight-labs-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/quansight-labs-small.png -------------------------------------------------------------------------------- /doc/images/quansight-labs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/quansight-labs.png -------------------------------------------------------------------------------- /doc/images/rbm_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/rbm_graph.png -------------------------------------------------------------------------------- /doc/images/scikit-learn-logo-notext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/scikit-learn-logo-notext.png -------------------------------------------------------------------------------- /doc/images/scikit-learn-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/scikit-learn-logo-small.png -------------------------------------------------------------------------------- /doc/images/sloan_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/sloan_banner.png -------------------------------------------------------------------------------- /doc/images/sloan_logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/sloan_logo-small.png -------------------------------------------------------------------------------- /doc/images/sydney-primary.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/sydney-primary.jpeg -------------------------------------------------------------------------------- /doc/images/sydney-stacked-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/sydney-stacked-small.png -------------------------------------------------------------------------------- /doc/images/telecom-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/telecom-small.png -------------------------------------------------------------------------------- /doc/images/telecom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/telecom.png -------------------------------------------------------------------------------- /doc/images/visual-studio-build-tools-selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/visual-studio-build-tools-selection.png -------------------------------------------------------------------------------- /doc/images/wellcome-trust-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/wellcome-trust-small.png -------------------------------------------------------------------------------- /doc/images/wellcome-trust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/images/wellcome-trust.png -------------------------------------------------------------------------------- /doc/index.rst.template: -------------------------------------------------------------------------------- 1 | .. title:: Index 2 | 3 | .. Define the overall structure, that affects the prev-next buttons and the order 4 | of the sections in the top navbar. 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 2 9 | 10 | Install 11 | user_guide 12 | API 13 | auto_examples/index 14 | Community 15 | getting_started 16 | whats_new 17 | Glossary 18 | Development <{{ development_link }}> 19 | FAQ 20 | support 21 | related_projects 22 | roadmap 23 | Governance 24 | about 25 | -------------------------------------------------------------------------------- /doc/inspection.rst: -------------------------------------------------------------------------------- 1 | .. _inspection: 2 | 3 | Inspection 4 | ---------- 5 | 6 | Predictive performance is often the main goal of developing machine learning 7 | models. Yet summarizing performance with an evaluation metric is often 8 | insufficient: it assumes that the evaluation metric and test dataset 9 | perfectly reflect the target domain, which is rarely true. In certain domains, 10 | a model needs a certain level of interpretability before it can be deployed. 11 | A model that is exhibiting performance issues needs to be debugged for one to 12 | understand the model's underlying issue. The 13 | :mod:`sklearn.inspection` module provides tools to help understand the 14 | predictions from a model and what affects them. This can be used to 15 | evaluate assumptions and biases of a model, design a better model, or 16 | to diagnose issues with model performance. 17 | 18 | .. rubric:: Examples 19 | 20 | * :ref:`sphx_glr_auto_examples_inspection_plot_linear_model_coefficient_interpretation.py` 21 | 22 | .. toctree:: 23 | 24 | modules/partial_dependence 25 | modules/permutation_importance 26 | -------------------------------------------------------------------------------- /doc/install_instructions_conda.rst: -------------------------------------------------------------------------------- 1 | Install conda using the 2 | `conda-forge installers `__ (no 3 | administrator permission required). Then run: 4 | 5 | .. prompt:: bash 6 | 7 | conda create -n sklearn-env -c conda-forge scikit-learn 8 | conda activate sklearn-env 9 | 10 | In order to check your installation, you can use: 11 | 12 | .. prompt:: bash 13 | 14 | conda list scikit-learn # show scikit-learn version and location 15 | conda list # show all installed packages in the environment 16 | python -c "import sklearn; sklearn.show_versions()" 17 | -------------------------------------------------------------------------------- /doc/js/scripts/api-search.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This script is for initializing the search table on the API index page. See 3 | * DataTables documentation for more information: https://datatables.net/ 4 | */ 5 | 6 | document.addEventListener("DOMContentLoaded", function () { 7 | new DataTable("table.apisearch-table", { 8 | order: [], // Keep original order 9 | lengthMenu: [10, 25, 50, 100, { label: "All", value: -1 }], 10 | pageLength: -1, // Show all entries by default 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /doc/js/scripts/sg_plotly_resize.js: -------------------------------------------------------------------------------- 1 | // Related to https://github.com/scikit-learn/scikit-learn/issues/30279 2 | // There an interaction between plotly and bootstrap/pydata-sphinx-theme 3 | // that causes plotly figures to not detect the right-hand sidebar width 4 | 5 | // Plotly figures are responsive, this triggers a resize event once the DOM has 6 | // finished loading so that they resize themselves. 7 | 8 | document.addEventListener("DOMContentLoaded", () => { 9 | window.dispatchEvent(new Event("resize")); 10 | }); 11 | -------------------------------------------------------------------------------- /doc/jupyter-lite.json: -------------------------------------------------------------------------------- 1 | { 2 | "jupyter-lite-schema-version": 0, 3 | "jupyter-config-data": { 4 | "litePluginSettings": { 5 | "@jupyterlite/pyodide-kernel-extension:kernel": { 6 | "pyodideUrl": "https://cdn.jsdelivr.net/pyodide/v0.27.2/full/pyodide.js" 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /doc/jupyter_lite_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "LiteBuildConfig": { 3 | "no_sourcemaps": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /doc/logos/1280px-scikit-learn-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/1280px-scikit-learn-logo.png -------------------------------------------------------------------------------- /doc/logos/brand_colors/colorswatch_29ABE2_cyan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/brand_colors/colorswatch_29ABE2_cyan.png -------------------------------------------------------------------------------- /doc/logos/brand_colors/colorswatch_9B4600_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/brand_colors/colorswatch_9B4600_brown.png -------------------------------------------------------------------------------- /doc/logos/brand_colors/colorswatch_F7931E_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/brand_colors/colorswatch_F7931E_orange.png -------------------------------------------------------------------------------- /doc/logos/brand_guidelines/scikitlearn_logo_clearspace_updated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/brand_guidelines/scikitlearn_logo_clearspace_updated.png -------------------------------------------------------------------------------- /doc/logos/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/favicon.ico -------------------------------------------------------------------------------- /doc/logos/identity.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/identity.pdf -------------------------------------------------------------------------------- /doc/logos/scikit-learn-logo-notext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/scikit-learn-logo-notext.png -------------------------------------------------------------------------------- /doc/logos/scikit-learn-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/scikit-learn-logo-small.png -------------------------------------------------------------------------------- /doc/logos/scikit-learn-logo-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/scikit-learn-logo-thumb.png -------------------------------------------------------------------------------- /doc/logos/scikit-learn-logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/scikit-learn-logo.bmp -------------------------------------------------------------------------------- /doc/logos/scikit-learn-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/logos/scikit-learn-logo.png -------------------------------------------------------------------------------- /doc/maintainers_emeritus.rst: -------------------------------------------------------------------------------- 1 | - Mathieu Blondel 2 | - Joris Van den Bossche 3 | - Matthieu Brucher 4 | - Lars Buitinck 5 | - David Cournapeau 6 | - Noel Dawe 7 | - Vincent Dubourg 8 | - Edouard Duchesnay 9 | - Alexander Fabisch 10 | - Virgile Fritsch 11 | - Satrajit Ghosh 12 | - Angel Soler Gollonet 13 | - Chris Gorgolewski 14 | - Jaques Grobler 15 | - Yaroslav Halchenko 16 | - Brian Holt 17 | - Arnaud Joly 18 | - Thouis (Ray) Jones 19 | - Kyle Kastner 20 | - manoj kumar 21 | - Robert Layton 22 | - Wei Li 23 | - Paolo Losi 24 | - Gilles Louppe 25 | - Jan Hendrik Metzen 26 | - Vincent Michel 27 | - Jarrod Millman 28 | - Vlad Niculae 29 | - Alexandre Passos 30 | - Fabian Pedregosa 31 | - Peter Prettenhofer 32 | - Hanmin Qin 33 | - (Venkat) Raghav, Rajagopalan 34 | - Jacob Schreiber 35 | - 杜世橋 Du Shiqiao 36 | - Bertrand Thirion 37 | - Tom Dupré la Tour 38 | - Jake Vanderplas 39 | - Nelle Varoquaux 40 | - David Warde-Farley 41 | - Ron Weiss 42 | - Roman Yurchak 43 | -------------------------------------------------------------------------------- /doc/min_dependency_substitutions.rst.template: -------------------------------------------------------------------------------- 1 | {% for package, (version, _) in dependent_packages.items() -%} 2 | .. |{{ package|capitalize }}MinVersion| replace:: {{ version }} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /doc/min_dependency_table.rst.template: -------------------------------------------------------------------------------- 1 | .. list-table:: 2 | :header-rows: 1 3 | 4 | * - Dependency 5 | - Minimum Version 6 | - Purpose 7 | 8 | {% for package, (version, tags) in dependent_packages.items() -%} 9 | * - {{ package }} 10 | - {{ version }} 11 | - {{ tags }} 12 | 13 | {% endfor %} 14 | -------------------------------------------------------------------------------- /doc/model_selection.rst: -------------------------------------------------------------------------------- 1 | .. _model_selection: 2 | 3 | Model selection and evaluation 4 | ------------------------------ 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | modules/cross_validation 10 | modules/grid_search 11 | modules/classification_threshold 12 | modules/model_evaluation 13 | modules/learning_curve 14 | -------------------------------------------------------------------------------- /doc/modules/glm_data/lasso_enet_coordinate_descent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/modules/glm_data/lasso_enet_coordinate_descent.png -------------------------------------------------------------------------------- /doc/modules/glm_data/poisson_gamma_tweedie_distributions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/modules/glm_data/poisson_gamma_tweedie_distributions.png -------------------------------------------------------------------------------- /doc/modules/pipeline.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. raw:: html 4 | 5 | 6 | 9 | 10 | This content is now at :ref:`combining_estimators`. 11 | -------------------------------------------------------------------------------- /doc/scss/api.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the styling for API reference pages, currently under `modules/generated`. 3 | * Note that it should be applied *ONLY* to API reference pages, as the selectors are 4 | * designed based on how `autodoc` and `autosummary` generate the stuff. 5 | */ 6 | 7 | // Make the admonitions more compact 8 | div.versionadded, 9 | div.versionchanged, 10 | div.deprecated { 11 | margin: 1rem auto; 12 | 13 | > p { 14 | margin: 0.3rem auto; 15 | } 16 | } 17 | 18 | // Make docstrings more compact 19 | dd { 20 | p:not(table *) { 21 | margin-bottom: 0.5rem !important; 22 | } 23 | 24 | ul { 25 | margin-bottom: 0.5rem !important; 26 | padding-left: 2rem !important; 27 | } 28 | } 29 | 30 | // The first method is too close the the docstring above 31 | dl.py.method:first-of-type { 32 | margin-top: 2rem; 33 | } 34 | 35 | // https://github.com/pydata/pydata-sphinx-theme/blob/8cf45f835bfdafc5f3821014a18f3b7e0fc2d44b/src/pydata_sphinx_theme/assets/styles/content/_api.scss 36 | dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) { 37 | margin-bottom: 1.5rem; 38 | 39 | dd { 40 | margin-left: 1.2rem; 41 | } 42 | 43 | // "Parameters", "Returns", etc. in the docstring 44 | dt.field-odd, 45 | dt.field-even { 46 | margin: 0.5rem 0; 47 | 48 | + dd > dl { 49 | margin-bottom: 0.5rem; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /doc/sphinxext/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include tests *.py 2 | include *.txt 3 | -------------------------------------------------------------------------------- /doc/supervised_learning.rst: -------------------------------------------------------------------------------- 1 | .. _supervised-learning: 2 | 3 | Supervised learning 4 | ------------------- 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | modules/linear_model 10 | modules/lda_qda.rst 11 | modules/kernel_ridge.rst 12 | modules/svm 13 | modules/sgd 14 | modules/neighbors 15 | modules/gaussian_process 16 | modules/cross_decomposition.rst 17 | modules/naive_bayes 18 | modules/tree 19 | modules/ensemble 20 | modules/multiclass 21 | modules/feature_selection.rst 22 | modules/semi_supervised.rst 23 | modules/isotonic.rst 24 | modules/calibration.rst 25 | modules/neural_networks_supervised 26 | -------------------------------------------------------------------------------- /doc/templates/base.rst: -------------------------------------------------------------------------------- 1 | {{ objname | escape | underline(line="=") }} 2 | 3 | {% if objtype == "module" -%} 4 | 5 | .. automodule:: {{ fullname }} 6 | 7 | {%- elif objtype == "function" -%} 8 | 9 | .. currentmodule:: {{ module }} 10 | 11 | .. autofunction:: {{ objname }} 12 | 13 | .. minigallery:: {{ module }}.{{ objname }} 14 | :add-heading: Gallery examples 15 | :heading-level: - 16 | 17 | {%- elif objtype == "class" -%} 18 | 19 | .. currentmodule:: {{ module }} 20 | 21 | .. autoclass:: {{ objname }} 22 | :members: 23 | :inherited-members: 24 | :special-members: __call__ 25 | 26 | .. minigallery:: {{ module }}.{{ objname }} {% for meth in methods %}{{ module }}.{{ objname }}.{{ meth }} {% endfor %} 27 | :add-heading: Gallery examples 28 | :heading-level: - 29 | 30 | {%- else -%} 31 | 32 | .. currentmodule:: {{ module }} 33 | 34 | .. auto{{ objtype }}:: {{ objname }} 35 | 36 | {%- endif -%} 37 | -------------------------------------------------------------------------------- /doc/templates/numpydoc_docstring.rst: -------------------------------------------------------------------------------- 1 | {{index}} 2 | {{summary}} 3 | {{extended_summary}} 4 | {{parameters}} 5 | {{returns}} 6 | {{yields}} 7 | {{other_parameters}} 8 | {{attributes}} 9 | {{raises}} 10 | {{warns}} 11 | {{warnings}} 12 | {{see_also}} 13 | {{notes}} 14 | {{references}} 15 | {{examples}} 16 | {{methods}} 17 | -------------------------------------------------------------------------------- /doc/templates/redirects.html: -------------------------------------------------------------------------------- 1 | {% set redirect = pathto(redirects[pagename]) %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | scikit-learn: machine learning in Python 11 | 12 | 13 |

You will be automatically redirected to the new location of this page.

14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/testimonials/README.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | To find the list of people we contacted, see: 4 | https://docs.google.com/spreadsheet/ccc?key=0AhGnAxuBDhjmdDYwNzlZVE5SMkFsMjNBbGlaWkpNZ1E&usp=sharing 5 | 6 | To obtain access to this file, send an email to: 7 | nelle dot varoquaux at gmail dot com 8 | 9 | -------------------------------------------------------------------------------- /doc/testimonials/images/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/Makefile -------------------------------------------------------------------------------- /doc/testimonials/images/aweber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/aweber.png -------------------------------------------------------------------------------- /doc/testimonials/images/bestofmedia-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/bestofmedia-logo.png -------------------------------------------------------------------------------- /doc/testimonials/images/betaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/betaworks.png -------------------------------------------------------------------------------- /doc/testimonials/images/birchbox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/birchbox.jpg -------------------------------------------------------------------------------- /doc/testimonials/images/bnp_paribas_cardif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/bnp_paribas_cardif.png -------------------------------------------------------------------------------- /doc/testimonials/images/booking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/booking.png -------------------------------------------------------------------------------- /doc/testimonials/images/change-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/change-logo.png -------------------------------------------------------------------------------- /doc/testimonials/images/dataiku_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/dataiku_logo.png -------------------------------------------------------------------------------- /doc/testimonials/images/datapublica.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/datapublica.png -------------------------------------------------------------------------------- /doc/testimonials/images/datarobot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/datarobot.png -------------------------------------------------------------------------------- /doc/testimonials/images/evernote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/evernote.png -------------------------------------------------------------------------------- /doc/testimonials/images/howaboutwe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/howaboutwe.png -------------------------------------------------------------------------------- /doc/testimonials/images/huggingface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/huggingface.png -------------------------------------------------------------------------------- /doc/testimonials/images/infonea.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/infonea.jpg -------------------------------------------------------------------------------- /doc/testimonials/images/inria.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/inria.png -------------------------------------------------------------------------------- /doc/testimonials/images/jpmorgan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/jpmorgan.png -------------------------------------------------------------------------------- /doc/testimonials/images/lovely.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/lovely.png -------------------------------------------------------------------------------- /doc/testimonials/images/machinalis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/machinalis.png -------------------------------------------------------------------------------- /doc/testimonials/images/mars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/mars.png -------------------------------------------------------------------------------- /doc/testimonials/images/okcupid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/okcupid.png -------------------------------------------------------------------------------- /doc/testimonials/images/ottogroup_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/ottogroup_logo.png -------------------------------------------------------------------------------- /doc/testimonials/images/peerindex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/peerindex.png -------------------------------------------------------------------------------- /doc/testimonials/images/phimeca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/phimeca.png -------------------------------------------------------------------------------- /doc/testimonials/images/rangespan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/rangespan.png -------------------------------------------------------------------------------- /doc/testimonials/images/solido_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/solido_logo.png -------------------------------------------------------------------------------- /doc/testimonials/images/spotify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/spotify.png -------------------------------------------------------------------------------- /doc/testimonials/images/telecomparistech.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/telecomparistech.jpg -------------------------------------------------------------------------------- /doc/testimonials/images/yhat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/yhat.png -------------------------------------------------------------------------------- /doc/testimonials/images/zopa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/doc/testimonials/images/zopa.png -------------------------------------------------------------------------------- /doc/unsupervised_learning.rst: -------------------------------------------------------------------------------- 1 | .. _unsupervised-learning: 2 | 3 | Unsupervised learning 4 | ----------------------- 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | modules/mixture 10 | modules/manifold 11 | modules/clustering 12 | modules/biclustering 13 | modules/decomposition 14 | modules/covariance 15 | modules/outlier_detection 16 | modules/density 17 | modules/neural_networks_unsupervised 18 | -------------------------------------------------------------------------------- /doc/user_guide.rst: -------------------------------------------------------------------------------- 1 | .. _user_guide: 2 | 3 | ========== 4 | User Guide 5 | ========== 6 | 7 | .. toctree:: 8 | :numbered: 9 | :maxdepth: 3 10 | 11 | supervised_learning.rst 12 | unsupervised_learning.rst 13 | model_selection.rst 14 | inspection.rst 15 | visualizations.rst 16 | data_transforms.rst 17 | datasets.rst 18 | computing.rst 19 | model_persistence.rst 20 | common_pitfalls.rst 21 | dispatching.rst 22 | machine_learning_map.rst 23 | presentations.rst 24 | 25 | Under Development 26 | ----------------- 27 | 28 | .. toctree:: 29 | :numbered: 30 | :maxdepth: 1 31 | 32 | metadata_routing.rst 33 | -------------------------------------------------------------------------------- /doc/whats_new.rst: -------------------------------------------------------------------------------- 1 | .. currentmodule:: sklearn 2 | 3 | .. include:: whats_new/_contributors.rst 4 | 5 | Release History 6 | =============== 7 | 8 | Changelogs and release notes for all scikit-learn releases are linked in this page. 9 | 10 | .. tip:: 11 | 12 | `Subscribe to scikit-learn releases `__ 13 | on libraries.io to be notified when new versions are released. 14 | 15 | .. toctree:: 16 | :maxdepth: 2 17 | 18 | whats_new/v1.7.rst 19 | whats_new/v1.6.rst 20 | whats_new/v1.5.rst 21 | whats_new/v1.4.rst 22 | whats_new/v1.3.rst 23 | whats_new/v1.2.rst 24 | whats_new/v1.1.rst 25 | whats_new/v1.0.rst 26 | whats_new/v0.24.rst 27 | whats_new/v0.23.rst 28 | whats_new/v0.22.rst 29 | whats_new/v0.21.rst 30 | whats_new/v0.20.rst 31 | whats_new/v0.19.rst 32 | whats_new/v0.18.rst 33 | whats_new/v0.17.rst 34 | whats_new/v0.16.rst 35 | whats_new/v0.15.rst 36 | whats_new/v0.14.rst 37 | whats_new/v0.13.rst 38 | whats_new/older_versions.rst 39 | -------------------------------------------------------------------------------- /doc/whats_new/changelog_legend.inc: -------------------------------------------------------------------------------- 1 | .. rubric:: Legend for changelogs 2 | 3 | - |MajorFeature| something big that you couldn't do before. 4 | - |Feature| something that you couldn't do before. 5 | - |Efficiency| an existing feature now may not require as much computation or 6 | memory. 7 | - |Enhancement| a miscellaneous minor improvement. 8 | - |Fix| something that previously didn't work as documented -- or according 9 | to reasonable expectations -- should now work. 10 | - |API| you will need to change your code to have the same effect in the 11 | future; or a feature will be removed in the future. 12 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/array-api/29519.feature.rst: -------------------------------------------------------------------------------- 1 | - :func:`sklearn.utils.check_consistent_length` now supports Array API compatible 2 | inputs. 3 | By :user:`Stefanie Senger ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/array-api/29978.feature.rst: -------------------------------------------------------------------------------- 1 | - :func:`sklearn.metrics.explained_variance_score` and 2 | :func:`sklearn.metrics.mean_pinball_loss` now support Array API compatible inputs. 3 | By :user:`Virgil Chan ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/array-api/30395.feature.rst: -------------------------------------------------------------------------------- 1 | - :func:`sklearn.metrics.fbeta_score`, 2 | :func:`sklearn.metrics.precision_score` and 3 | :func:`sklearn.metrics.recall_score` now support Array API compatible inputs. 4 | By :user:`Omar Salman ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.covariance/30483.fix.rst: -------------------------------------------------------------------------------- 1 | - Support for ``n_samples == n_features`` in `sklearn.covariance.MinCovDet` has 2 | been restored. By :user:`Antony Lee `. 3 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.datasets/30196.enhancement.rst: -------------------------------------------------------------------------------- 1 | - New parameter ``return_X_y`` added to :func:`datasets.make_classification`. The 2 | default value of the parameter does not change how the function behaves. 3 | By :user:`Success Moses ` and :user:`Adam Cooper ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.decomposition/30443.feature.rst: -------------------------------------------------------------------------------- 1 | - :class:`~sklearn.decomposition.DictionaryLearning`, 2 | :class:`~sklearn.decomposition.SparseCoder` and 3 | :class:`~sklearn.decomposition.MiniBatchDictionaryLearning` now have a 4 | ``inverse_transform`` method. By :user:`Rémi Flamary ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.ensemble/30649.fix.rst: -------------------------------------------------------------------------------- 1 | - :class:`ensemble.VotingClassifier` and :class:`ensemble.VotingRegressor` 2 | validate `estimators` to make sure it is a list of tuples. By `Thomas Fan`_. 3 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.inspection/26202.enhancement.rst: -------------------------------------------------------------------------------- 1 | - Add `custom_values` parameter in :func:`inspection.partial_dependence`. It enables 2 | users to pass their own grid of values at which the partial dependence should be 3 | calculated. 4 | By :user:`Freddy A. Boulton ` and :user:`Stephen Pardy 5 | ` -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.inspection/30409.api.rst: -------------------------------------------------------------------------------- 1 | - :func:`inspection.partial_dependence` does no longer accept integer dtype for 2 | numerical feature columns. Explicit conversion to floating point values is 3 | now required before calling this tool (and preferably even before fitting the 4 | model to inspect). 5 | By :user:`Olivier Grisel ` 6 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.linear_model/30057.fix.rst: -------------------------------------------------------------------------------- 1 | - :class:`linear_model.LogisticRegression` and 2 | :class:`linear_model.LogisticRegressionCV` now properly pass sample weights to 3 | :func:`utils.class_weight.compute_class_weight` when fit with 4 | `class_weight="balanced"`. 5 | By :user:`Shruti Nath ` and :user:`Olivier Grisel ` 6 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.linear_model/30521.fix.rst: -------------------------------------------------------------------------------- 1 | - |Enhancement| Added a new parameter `tol` to 2 | :class:`linear_model.LinearRegression` that determines the precision of the 3 | solution `coef_` when fitting on sparse data. 4 | By :user:`Success Moses ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.linear_model/30644.fix.rst: -------------------------------------------------------------------------------- 1 | - The update and initialization of the hyperparameters now properly handle 2 | sample weights in :class:`linear_model.BayesianRidge`. 3 | By :user:`Antoine Baker `. 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.metrics/29288.enhancement.rst: -------------------------------------------------------------------------------- 1 | - :func:`~metrics.class_likelihood_ratios` now has a `replace_undefined_by` param. 2 | When there is a division by zero, the metric is undefined and the set values are 3 | returned for `LR+` and `LR-`. 4 | By :user:`Stefanie Senger ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.metrics/29288.fix.rst: -------------------------------------------------------------------------------- 1 | - :func:`~metrics.class_likelihood_ratios` now raises `UndefinedMetricWarning` instead 2 | of `UserWarning` when a division by zero occurs. 3 | By :user:`Stefanie Senger ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.metrics/29727.fix.rst: -------------------------------------------------------------------------------- 1 | - :class:`metrics.RocCurveDisplay` will no longer set a legend when 2 | `label` is `None` in both the `line_kwargs` and the `chance_level_kw`. 3 | By :user:`Arturo Amor ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.mixture/30414.efficiency.rst: -------------------------------------------------------------------------------- 1 | - Simplified redundant computation when estimating covariances in 2 | :class:`~mixture.GaussianMixture` with a `covariance_type="spherical"` or 3 | `covariance_type="diag"`. 4 | By :user:`Leonce Mekinda ` and :user:`Olivier Grisel ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.mixture/30415.efficiency.rst: -------------------------------------------------------------------------------- 1 | - :class:`~mixture.GaussianMixture` now consistently operates at `float32` 2 | precision when fitted with `float32` data to improve training speed and 3 | memory efficiency. Previously, part of the computation would be implicitly 4 | cast to `float64`. By :user:`Olivier Grisel ` and :user:`Omar Salman 5 | `. 6 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.multioutput/30152.enhancement.rst: -------------------------------------------------------------------------------- 1 | - The parameter `base_estimator` has been deprecated in favour of `estimator` for 2 | :class:`multioutput.RegressorChain` and :class:`multioutput.ClassifierChain`. 3 | By :user:`Success Moses ` and :user:`dikraMasrour ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.neural_network/30155.feature.rst: -------------------------------------------------------------------------------- 1 | - Added support for `sample_weight` in :class:`neural_network.MLPClassifier` and 2 | :class:`neural_network.MLPRegressor`. 3 | By :user:`Zach Shu ` and :user:`Christian Lorentzen ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.pipeline/30406.enhancement.rst: -------------------------------------------------------------------------------- 1 | - Expose the ``verbose_feature_names_out`` argument in the 2 | :func:`pipeline.make_union` function, allowing users to control 3 | feature name uniqueness in the :class:`pipeline.FeatureUnion`. 4 | By :user:`Abhijeetsingh Meena ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.preprocessing/29907.enhancement.rst: -------------------------------------------------------------------------------- 1 | - :class:`preprocessing.KBinsDiscretizer` with `strategy="uniform"` now 2 | accepts `sample_weight`. Additionally with `strategy="quantile"` the 3 | `quantile_method` can now be specified (in the future 4 | `quantile_method="averaged_inverted_cdf"` will become the default) 5 | :pr:`29907` by :user:`Shruti Nath ` and :user:`Olivier Grisel 6 | ` 7 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.preprocessing/29907.fix.rst: -------------------------------------------------------------------------------- 1 | - :class:`preprocessing.KBinsDiscretizer` now uses weighted resampling when 2 | sample weights are given and subsampling is used. This may change results 3 | even when not using sample weights, although in absolute and not in terms 4 | of statistical properties. 5 | :pr:`29907` by :user:`Shruti Nath ` and :user:`Jérémie du Boisberranger 6 | ` 7 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.svm/30057.fix.rst: -------------------------------------------------------------------------------- 1 | - :class:`svm.LinearSVC` now properly passes sample weights to 2 | :func:`utils.class_weight.compute_class_weight` when fit with 3 | `class_weight="balanced"`. 4 | By :user:`Shruti Nath ` 5 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.utils/29907.enhancement.rst: -------------------------------------------------------------------------------- 1 | 2 | - :func: `resample` now handles sample weights which allows 3 | weighted resampling. 4 | :pr:`29907` by :user:`Shruti Nath ` and :user:`Olivier Grisel 5 | ` 6 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.utils/30057.enhancement.rst: -------------------------------------------------------------------------------- 1 | - :func:`utils.class_weight.compute_class_weight` now properly accounts for 2 | sample weights when using strategy "balanced" to calculate class weights. 3 | By :user:`Shruti Nath ` 4 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.utils/30380.enhancement.rst: -------------------------------------------------------------------------------- 1 | - Warning filters from the main process are propagated to joblib workers. 2 | By `Thomas Fan`_ 3 | -------------------------------------------------------------------------------- /doc/whats_new/upcoming_changes/sklearn.utils/30775.fix.rst: -------------------------------------------------------------------------------- 1 | - In :mod:`utils.estimator_checks` we now enforce for binary classifiers a 2 | binary `y` by taking the minimum as the negative class instead of the first 3 | element, which makes it robust to `y` shuffling. It prevents two checks from 4 | wrongly failing on binary classifiers. 5 | By :user:`Antoine Baker `. 6 | -------------------------------------------------------------------------------- /doc/whats_new/v1.7.rst: -------------------------------------------------------------------------------- 1 | .. include:: _contributors.rst 2 | 3 | .. currentmodule:: sklearn 4 | 5 | .. _release_notes_1_7: 6 | 7 | =========== 8 | Version 1.7 9 | =========== 10 | 11 | .. 12 | -- UNCOMMENT WHEN 1.7.0 IS RELEASED -- 13 | For a short description of the main highlights of the release, please refer to 14 | :ref:`sphx_glr_auto_examples_release_highlights_plot_release_highlights_1_6_0.py`. 15 | 16 | 17 | .. 18 | DELETE WHEN 1.7.0 IS RELEASED 19 | Since October 2024, DO NOT add your changelog entry in this file. 20 | .. 21 | Instead, create a file named `..rst` in the relevant sub-folder in 22 | `doc/whats_new/upcoming_changes/`. For full details, see: 23 | https://github.com/scikit-learn/scikit-learn/blob/main/doc/whats_new/upcoming_changes/README.md 24 | 25 | .. include:: changelog_legend.inc 26 | 27 | .. towncrier release notes start 28 | 29 | .. rubric:: Code and documentation contributors 30 | 31 | Thanks to everyone who has contributed to the maintenance and improvement of 32 | the project since version 1.7, including: 33 | 34 | TODO: update at the time of the release. 35 | -------------------------------------------------------------------------------- /examples/README.txt: -------------------------------------------------------------------------------- 1 | .. _general_examples: 2 | 3 | Examples 4 | ======== 5 | 6 | This is the gallery of examples that showcase how scikit-learn can be used. Some 7 | examples demonstrate the use of the :ref:`API ` in general and some 8 | demonstrate specific applications in tutorial form. Also check out our 9 | :ref:`user guide ` for more detailed illustrations. 10 | -------------------------------------------------------------------------------- /examples/applications/README.txt: -------------------------------------------------------------------------------- 1 | .. _realworld_examples: 2 | 3 | Examples based on real world datasets 4 | ------------------------------------- 5 | 6 | Applications to real world problems with some medium sized datasets or 7 | interactive user interface. 8 | -------------------------------------------------------------------------------- /examples/bicluster/README.txt: -------------------------------------------------------------------------------- 1 | .. _bicluster_examples: 2 | 3 | Biclustering 4 | ------------ 5 | 6 | Examples concerning biclustering techniques. 7 | -------------------------------------------------------------------------------- /examples/calibration/README.txt: -------------------------------------------------------------------------------- 1 | .. _calibration_examples: 2 | 3 | Calibration 4 | ----------------------- 5 | 6 | Examples illustrating the calibration of predicted probabilities of classifiers. 7 | -------------------------------------------------------------------------------- /examples/classification/README.txt: -------------------------------------------------------------------------------- 1 | .. _classification_examples: 2 | 3 | Classification 4 | ----------------------- 5 | 6 | General examples about classification algorithms. 7 | -------------------------------------------------------------------------------- /examples/cluster/README.txt: -------------------------------------------------------------------------------- 1 | .. _cluster_examples: 2 | 3 | Clustering 4 | ---------- 5 | 6 | Examples concerning the :mod:`sklearn.cluster` module. 7 | -------------------------------------------------------------------------------- /examples/cluster/plot_kmeans_plusplus.py: -------------------------------------------------------------------------------- 1 | """ 2 | =========================================================== 3 | An example of K-Means++ initialization 4 | =========================================================== 5 | 6 | An example to show the output of the :func:`sklearn.cluster.kmeans_plusplus` 7 | function for generating initial seeds for clustering. 8 | 9 | K-Means++ is used as the default initialization for :ref:`k_means`. 10 | 11 | """ 12 | 13 | # Authors: The scikit-learn developers 14 | # SPDX-License-Identifier: BSD-3-Clause 15 | 16 | import matplotlib.pyplot as plt 17 | 18 | from sklearn.cluster import kmeans_plusplus 19 | from sklearn.datasets import make_blobs 20 | 21 | # Generate sample data 22 | n_samples = 4000 23 | n_components = 4 24 | 25 | X, y_true = make_blobs( 26 | n_samples=n_samples, centers=n_components, cluster_std=0.60, random_state=0 27 | ) 28 | X = X[:, ::-1] 29 | 30 | # Calculate seeds from k-means++ 31 | centers_init, indices = kmeans_plusplus(X, n_clusters=4, random_state=0) 32 | 33 | # Plot init seeds along side sample data 34 | plt.figure(1) 35 | colors = ["#4EACC5", "#FF9C34", "#4E9A06", "m"] 36 | 37 | for k, col in enumerate(colors): 38 | cluster_data = y_true == k 39 | plt.scatter(X[cluster_data, 0], X[cluster_data, 1], c=col, marker=".", s=10) 40 | 41 | plt.scatter(centers_init[:, 0], centers_init[:, 1], c="b", s=50) 42 | plt.title("K-Means++ Initialization") 43 | plt.xticks([]) 44 | plt.yticks([]) 45 | plt.show() 46 | -------------------------------------------------------------------------------- /examples/compose/README.txt: -------------------------------------------------------------------------------- 1 | .. _compose_examples: 2 | 3 | Pipelines and composite estimators 4 | ---------------------------------- 5 | 6 | Examples of how to compose transformers and pipelines from other estimators. See the :ref:`User Guide `. 7 | -------------------------------------------------------------------------------- /examples/covariance/README.txt: -------------------------------------------------------------------------------- 1 | .. _covariance_examples: 2 | 3 | Covariance estimation 4 | --------------------- 5 | 6 | Examples concerning the :mod:`sklearn.covariance` module. 7 | -------------------------------------------------------------------------------- /examples/cross_decomposition/README.txt: -------------------------------------------------------------------------------- 1 | .. _cross_decomposition_examples: 2 | 3 | Cross decomposition 4 | ------------------- 5 | 6 | Examples concerning the :mod:`sklearn.cross_decomposition` module. 7 | 8 | -------------------------------------------------------------------------------- /examples/datasets/README.txt: -------------------------------------------------------------------------------- 1 | .. _dataset_examples: 2 | 3 | Dataset examples 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.datasets` module. 7 | -------------------------------------------------------------------------------- /examples/decomposition/README.txt: -------------------------------------------------------------------------------- 1 | .. _decomposition_examples: 2 | 3 | Decomposition 4 | ------------- 5 | 6 | Examples concerning the :mod:`sklearn.decomposition` module. 7 | 8 | -------------------------------------------------------------------------------- /examples/developing_estimators/README.txt: -------------------------------------------------------------------------------- 1 | .. _developing_estimator_examples: 2 | 3 | Developing Estimators 4 | --------------------- 5 | 6 | Examples concerning the development of Custom Estimator. -------------------------------------------------------------------------------- /examples/ensemble/README.txt: -------------------------------------------------------------------------------- 1 | .. _ensemble_examples: 2 | 3 | Ensemble methods 4 | ---------------- 5 | 6 | Examples concerning the :mod:`sklearn.ensemble` module. 7 | -------------------------------------------------------------------------------- /examples/feature_selection/README.txt: -------------------------------------------------------------------------------- 1 | .. _feature_selection_examples: 2 | 3 | Feature Selection 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.feature_selection` module. 7 | -------------------------------------------------------------------------------- /examples/frozen/README.txt: -------------------------------------------------------------------------------- 1 | .. _frozen_examples: 2 | 3 | Frozen Estimators 4 | ----------------- 5 | 6 | Examples concerning the :mod:`sklearn.frozen` module. 7 | 8 | -------------------------------------------------------------------------------- /examples/gaussian_process/README.txt: -------------------------------------------------------------------------------- 1 | .. _gaussian_process_examples: 2 | 3 | Gaussian Process for Machine Learning 4 | ------------------------------------- 5 | 6 | Examples concerning the :mod:`sklearn.gaussian_process` module. 7 | 8 | -------------------------------------------------------------------------------- /examples/impute/README.txt: -------------------------------------------------------------------------------- 1 | .. _impute_examples: 2 | 3 | Missing Value Imputation 4 | ------------------------ 5 | 6 | Examples concerning the :mod:`sklearn.impute` module. 7 | -------------------------------------------------------------------------------- /examples/inspection/README.txt: -------------------------------------------------------------------------------- 1 | .. _inspection_examples: 2 | 3 | Inspection 4 | ---------- 5 | 6 | Examples related to the :mod:`sklearn.inspection` module. 7 | 8 | -------------------------------------------------------------------------------- /examples/kernel_approximation/README.txt: -------------------------------------------------------------------------------- 1 | .. _kernel_approximation_examples: 2 | 3 | Kernel Approximation 4 | -------------------- 5 | 6 | Examples concerning the :mod:`sklearn.kernel_approximation` module. 7 | -------------------------------------------------------------------------------- /examples/linear_model/README.txt: -------------------------------------------------------------------------------- 1 | .. _linear_examples: 2 | 3 | Generalized Linear Models 4 | ------------------------- 5 | 6 | Examples concerning the :mod:`sklearn.linear_model` module. 7 | -------------------------------------------------------------------------------- /examples/linear_model/plot_sgd_separating_hyperplane.py: -------------------------------------------------------------------------------- 1 | """ 2 | ========================================= 3 | SGD: Maximum margin separating hyperplane 4 | ========================================= 5 | 6 | Plot the maximum margin separating hyperplane within a two-class 7 | separable dataset using a linear Support Vector Machines classifier 8 | trained using SGD. 9 | 10 | """ 11 | 12 | # Authors: The scikit-learn developers 13 | # SPDX-License-Identifier: BSD-3-Clause 14 | 15 | import matplotlib.pyplot as plt 16 | import numpy as np 17 | 18 | from sklearn.datasets import make_blobs 19 | from sklearn.linear_model import SGDClassifier 20 | 21 | # we create 50 separable points 22 | X, Y = make_blobs(n_samples=50, centers=2, random_state=0, cluster_std=0.60) 23 | 24 | # fit the model 25 | clf = SGDClassifier(loss="hinge", alpha=0.01, max_iter=200) 26 | 27 | clf.fit(X, Y) 28 | 29 | # plot the line, the points, and the nearest vectors to the plane 30 | xx = np.linspace(-1, 5, 10) 31 | yy = np.linspace(-1, 5, 10) 32 | 33 | X1, X2 = np.meshgrid(xx, yy) 34 | Z = np.empty(X1.shape) 35 | for (i, j), val in np.ndenumerate(X1): 36 | x1 = val 37 | x2 = X2[i, j] 38 | p = clf.decision_function([[x1, x2]]) 39 | Z[i, j] = p[0] 40 | levels = [-1.0, 0.0, 1.0] 41 | linestyles = ["dashed", "solid", "dashed"] 42 | colors = "k" 43 | plt.contour(X1, X2, Z, levels, colors=colors, linestyles=linestyles) 44 | plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired, edgecolor="black", s=20) 45 | 46 | plt.axis("tight") 47 | plt.show() 48 | -------------------------------------------------------------------------------- /examples/manifold/README.txt: -------------------------------------------------------------------------------- 1 | .. _manifold_examples: 2 | 3 | Manifold learning 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.manifold` module. 7 | 8 | -------------------------------------------------------------------------------- /examples/miscellaneous/README.txt: -------------------------------------------------------------------------------- 1 | .. _miscellaneous_examples: 2 | 3 | Miscellaneous 4 | ------------- 5 | 6 | Miscellaneous and introductory examples for scikit-learn. 7 | 8 | -------------------------------------------------------------------------------- /examples/mixture/README.txt: -------------------------------------------------------------------------------- 1 | .. _mixture_examples: 2 | 3 | Gaussian Mixture Models 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.mixture` module. 7 | -------------------------------------------------------------------------------- /examples/model_selection/README.txt: -------------------------------------------------------------------------------- 1 | .. _model_selection_examples: 2 | 3 | Model Selection 4 | ----------------------- 5 | 6 | Examples related to the :mod:`sklearn.model_selection` module. 7 | -------------------------------------------------------------------------------- /examples/multiclass/README.txt: -------------------------------------------------------------------------------- 1 | .. _multiclass_examples: 2 | 3 | Multiclass methods 4 | ------------------ 5 | 6 | Examples concerning the :mod:`sklearn.multiclass` module. 7 | -------------------------------------------------------------------------------- /examples/multioutput/README.txt: -------------------------------------------------------------------------------- 1 | .. _multioutput_examples: 2 | 3 | Multioutput methods 4 | ------------------- 5 | 6 | Examples concerning the :mod:`sklearn.multioutput` module. 7 | -------------------------------------------------------------------------------- /examples/neighbors/README.txt: -------------------------------------------------------------------------------- 1 | .. _neighbors_examples: 2 | 3 | Nearest Neighbors 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.neighbors` module. 7 | -------------------------------------------------------------------------------- /examples/neural_networks/README.txt: -------------------------------------------------------------------------------- 1 | .. _neural_network_examples: 2 | 3 | Neural Networks 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.neural_network` module. 7 | -------------------------------------------------------------------------------- /examples/preprocessing/README.txt: -------------------------------------------------------------------------------- 1 | .. _preprocessing_examples: 2 | 3 | Preprocessing 4 | ------------- 5 | 6 | Examples concerning the :mod:`sklearn.preprocessing` module. 7 | -------------------------------------------------------------------------------- /examples/release_highlights/README.txt: -------------------------------------------------------------------------------- 1 | .. _release_highlights_examples: 2 | 3 | Release Highlights 4 | ------------------ 5 | 6 | These examples illustrate the main features of the releases of scikit-learn. 7 | -------------------------------------------------------------------------------- /examples/semi_supervised/README.txt: -------------------------------------------------------------------------------- 1 | .. _semi_supervised_examples: 2 | 3 | Semi Supervised Classification 4 | ------------------------------ 5 | 6 | Examples concerning the :mod:`sklearn.semi_supervised` module. 7 | -------------------------------------------------------------------------------- /examples/svm/README.txt: -------------------------------------------------------------------------------- 1 | .. _svm_examples: 2 | 3 | Support Vector Machines 4 | ----------------------- 5 | 6 | Examples concerning the :mod:`sklearn.svm` module. 7 | -------------------------------------------------------------------------------- /examples/svm/plot_separating_hyperplane.py: -------------------------------------------------------------------------------- 1 | """ 2 | ========================================= 3 | SVM: Maximum margin separating hyperplane 4 | ========================================= 5 | 6 | Plot the maximum margin separating hyperplane within a two-class 7 | separable dataset using a Support Vector Machine classifier with 8 | linear kernel. 9 | 10 | """ 11 | 12 | # Authors: The scikit-learn developers 13 | # SPDX-License-Identifier: BSD-3-Clause 14 | 15 | import matplotlib.pyplot as plt 16 | 17 | from sklearn import svm 18 | from sklearn.datasets import make_blobs 19 | from sklearn.inspection import DecisionBoundaryDisplay 20 | 21 | # we create 40 separable points 22 | X, y = make_blobs(n_samples=40, centers=2, random_state=6) 23 | 24 | # fit the model, don't regularize for illustration purposes 25 | clf = svm.SVC(kernel="linear", C=1000) 26 | clf.fit(X, y) 27 | 28 | plt.scatter(X[:, 0], X[:, 1], c=y, s=30, cmap=plt.cm.Paired) 29 | 30 | # plot the decision function 31 | ax = plt.gca() 32 | DecisionBoundaryDisplay.from_estimator( 33 | clf, 34 | X, 35 | plot_method="contour", 36 | colors="k", 37 | levels=[-1, 0, 1], 38 | alpha=0.5, 39 | linestyles=["--", "-", "--"], 40 | ax=ax, 41 | ) 42 | # plot support vectors 43 | ax.scatter( 44 | clf.support_vectors_[:, 0], 45 | clf.support_vectors_[:, 1], 46 | s=100, 47 | linewidth=1, 48 | facecolors="none", 49 | edgecolors="k", 50 | ) 51 | plt.show() 52 | -------------------------------------------------------------------------------- /examples/text/README.txt: -------------------------------------------------------------------------------- 1 | .. _text_examples: 2 | 3 | Working with text documents 4 | ---------------------------- 5 | 6 | Examples concerning the :mod:`sklearn.feature_extraction.text` module. 7 | -------------------------------------------------------------------------------- /examples/tree/README.txt: -------------------------------------------------------------------------------- 1 | .. _tree_examples: 2 | 3 | Decision Trees 4 | -------------- 5 | 6 | Examples concerning the :mod:`sklearn.tree` module. 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [options] 2 | packages = find: 3 | 4 | [options.packages.find] 5 | include = sklearn* 6 | 7 | [aliases] 8 | test = pytest 9 | 10 | [tool:pytest] 11 | # disable-pytest-warnings should be removed once we rewrite tests 12 | # using yield with parametrize 13 | doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS 14 | testpaths = sklearn 15 | addopts = 16 | --disable-pytest-warnings 17 | --color=yes 18 | 19 | [mypy] 20 | ignore_missing_imports = True 21 | allow_redefinition = True 22 | exclude= 23 | sklearn/externals 24 | 25 | [mypy-joblib.*] 26 | follow_imports = skip 27 | 28 | [codespell] 29 | skip = ./.git,./.mypy_cache,./sklearn/feature_extraction/_stop_words.py,./doc/_build,./doc/auto_examples,./doc/modules/generated 30 | ignore-words = build_tools/codespell_ignore_words.txt 31 | -------------------------------------------------------------------------------- /sklearn/__check_build/_check_build.pyx: -------------------------------------------------------------------------------- 1 | def check_build(): 2 | return 3 | -------------------------------------------------------------------------------- /sklearn/__check_build/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_check_build', 3 | '_check_build.pyx', 4 | cython_args: cython_args, 5 | install: true, 6 | subdir: 'sklearn/__check_build', 7 | ) 8 | -------------------------------------------------------------------------------- /sklearn/_build_utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/_build_utils/__init__.py -------------------------------------------------------------------------------- /sklearn/_build_utils/version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """Extract version number from __init__.py""" 3 | 4 | # Authors: The scikit-learn developers 5 | # SPDX-License-Identifier: BSD-3-Clause 6 | 7 | import os 8 | 9 | sklearn_init = os.path.join(os.path.dirname(__file__), "../__init__.py") 10 | 11 | data = open(sklearn_init).readlines() 12 | version_line = next(line for line in data if line.startswith("__version__")) 13 | 14 | version = version_line.strip().split(" = ")[1].replace('"', "").replace("'", "") 15 | 16 | print(version) 17 | -------------------------------------------------------------------------------- /sklearn/_distributor_init.py: -------------------------------------------------------------------------------- 1 | """Distributor init file 2 | 3 | Distributors: you can add custom code here to support particular distributions 4 | of scikit-learn. 5 | 6 | For example, this is a good place to put any checks for hardware requirements. 7 | 8 | The scikit-learn standard source distribution will not put code in this file, 9 | so you can safely replace this file with your own version. 10 | """ 11 | 12 | # Authors: The scikit-learn developers 13 | # SPDX-License-Identifier: BSD-3-Clause 14 | -------------------------------------------------------------------------------- /sklearn/_loss/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | The :mod:`sklearn._loss` module includes loss function classes suitable for 3 | fitting classification and regression tasks. 4 | """ 5 | 6 | # Authors: The scikit-learn developers 7 | # SPDX-License-Identifier: BSD-3-Clause 8 | 9 | from .loss import ( 10 | AbsoluteError, 11 | HalfBinomialLoss, 12 | HalfGammaLoss, 13 | HalfMultinomialLoss, 14 | HalfPoissonLoss, 15 | HalfSquaredError, 16 | HalfTweedieLoss, 17 | HalfTweedieLossIdentity, 18 | HuberLoss, 19 | PinballLoss, 20 | ) 21 | 22 | __all__ = [ 23 | "HalfSquaredError", 24 | "AbsoluteError", 25 | "PinballLoss", 26 | "HuberLoss", 27 | "HalfPoissonLoss", 28 | "HalfGammaLoss", 29 | "HalfTweedieLoss", 30 | "HalfTweedieLossIdentity", 31 | "HalfBinomialLoss", 32 | "HalfMultinomialLoss", 33 | ] 34 | -------------------------------------------------------------------------------- /sklearn/_loss/meson.build: -------------------------------------------------------------------------------- 1 | # .pyx is generated, so this is needed to make Cython compilation work 2 | _loss_cython_tree = [ 3 | fs.copyfile('_loss.pxd') 4 | ] 5 | 6 | _loss_pyx = custom_target( 7 | '_loss_pyx', 8 | output: '_loss.pyx', 9 | input: '_loss.pyx.tp', 10 | command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'], 11 | # TODO in principle this should go in py.exension_module below. This is 12 | # temporary work-around for dependency issue with .pyx.tp files. For more 13 | # details, see https://github.com/mesonbuild/meson/issues/13212 14 | depends: _loss_cython_tree, 15 | ) 16 | 17 | py.extension_module( 18 | '_loss', 19 | _loss_pyx, 20 | dependencies: [openmp_dep], 21 | cython_args: cython_args, 22 | install: true, 23 | subdir: 'sklearn/_loss', 24 | ) 25 | -------------------------------------------------------------------------------- /sklearn/_loss/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/_loss/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/cluster/_dbscan_inner.pyx: -------------------------------------------------------------------------------- 1 | # Fast inner loop for DBSCAN. 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from libcpp.vector cimport vector 7 | 8 | from ..utils._typedefs cimport uint8_t, intp_t 9 | 10 | 11 | def dbscan_inner(const uint8_t[::1] is_core, 12 | object[:] neighborhoods, 13 | intp_t[::1] labels): 14 | cdef intp_t i, label_num = 0, v 15 | cdef intp_t[:] neighb 16 | cdef vector[intp_t] stack 17 | 18 | for i in range(labels.shape[0]): 19 | if labels[i] != -1 or not is_core[i]: 20 | continue 21 | 22 | # Depth-first search starting from i, ending at the non-core points. 23 | # This is very similar to the classic algorithm for computing connected 24 | # components, the difference being that we label non-core points as 25 | # part of a cluster (component), but don't expand their neighborhoods. 26 | while True: 27 | if labels[i] == -1: 28 | labels[i] = label_num 29 | if is_core[i]: 30 | neighb = neighborhoods[i] 31 | for i in range(neighb.shape[0]): 32 | v = neighb[i] 33 | if labels[v] == -1: 34 | stack.push_back(v) 35 | 36 | if stack.size() == 0: 37 | break 38 | i = stack.back() 39 | stack.pop_back() 40 | 41 | label_num += 1 42 | -------------------------------------------------------------------------------- /sklearn/cluster/_hdbscan/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/cluster/_hdbscan/meson.build: -------------------------------------------------------------------------------- 1 | cluster_hdbscan_extension_metadata = { 2 | '_linkage': {'sources': ['_linkage.pyx', metrics_cython_tree]}, 3 | '_reachability': {'sources': ['_reachability.pyx']}, 4 | '_tree': {'sources': ['_tree.pyx']} 5 | } 6 | 7 | foreach ext_name, ext_dict : cluster_hdbscan_extension_metadata 8 | py.extension_module( 9 | ext_name, 10 | ext_dict.get('sources'), 11 | dependencies: [np_dep], 12 | cython_args: cython_args, 13 | subdir: 'sklearn/cluster/_hdbscan', 14 | install: true 15 | ) 16 | endforeach 17 | -------------------------------------------------------------------------------- /sklearn/cluster/_hdbscan/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/cluster/_hdbscan/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/cluster/_hierarchical_fast.pxd: -------------------------------------------------------------------------------- 1 | from ..utils._typedefs cimport intp_t 2 | 3 | cdef class UnionFind: 4 | cdef intp_t next_label 5 | cdef intp_t[:] parent 6 | cdef intp_t[:] size 7 | 8 | cdef void union(self, intp_t m, intp_t n) noexcept 9 | cdef intp_t fast_find(self, intp_t n) noexcept 10 | -------------------------------------------------------------------------------- /sklearn/cluster/_k_means_common.pxd: -------------------------------------------------------------------------------- 1 | from cython cimport floating 2 | 3 | 4 | cdef floating _euclidean_dense_dense( 5 | const floating*, 6 | const floating*, 7 | int, 8 | bint 9 | ) noexcept nogil 10 | 11 | cdef floating _euclidean_sparse_dense( 12 | const floating[::1], 13 | const int[::1], 14 | const floating[::1], 15 | floating, 16 | bint 17 | ) noexcept nogil 18 | 19 | cpdef void _relocate_empty_clusters_dense( 20 | const floating[:, ::1], 21 | const floating[::1], 22 | const floating[:, ::1], 23 | floating[:, ::1], 24 | floating[::1], 25 | const int[::1] 26 | ) 27 | 28 | cpdef void _relocate_empty_clusters_sparse( 29 | const floating[::1], 30 | const int[::1], 31 | const int[::1], 32 | const floating[::1], 33 | const floating[:, ::1], 34 | floating[:, ::1], 35 | floating[::1], 36 | const int[::1] 37 | ) 38 | 39 | cdef void _average_centers( 40 | floating[:, ::1], 41 | const floating[::1] 42 | ) 43 | 44 | cdef void _center_shift( 45 | const floating[:, ::1], 46 | const floating[:, ::1], 47 | floating[::1] 48 | ) 49 | -------------------------------------------------------------------------------- /sklearn/cluster/meson.build: -------------------------------------------------------------------------------- 1 | cluster_extension_metadata = { 2 | '_dbscan_inner': 3 | {'sources': ['_dbscan_inner.pyx'], 'override_options': ['cython_language=cpp']}, 4 | '_hierarchical_fast': 5 | {'sources': ['_hierarchical_fast.pyx', metrics_cython_tree], 6 | 'override_options': ['cython_language=cpp']}, 7 | '_k_means_common': 8 | {'sources': ['_k_means_common.pyx'], 'dependencies': [openmp_dep]}, 9 | '_k_means_lloyd': 10 | {'sources': ['_k_means_lloyd.pyx'], 'dependencies': [openmp_dep]}, 11 | '_k_means_elkan': 12 | {'sources': ['_k_means_elkan.pyx'], 'dependencies': [openmp_dep]}, 13 | '_k_means_minibatch': 14 | {'sources': ['_k_means_minibatch.pyx'], 'dependencies': [openmp_dep]}, 15 | } 16 | 17 | foreach ext_name, ext_dict : cluster_extension_metadata 18 | py.extension_module( 19 | ext_name, 20 | [ext_dict.get('sources'), utils_cython_tree], 21 | dependencies: [np_dep] + ext_dict.get('dependencies', []), 22 | override_options : ext_dict.get('override_options', []), 23 | cython_args: cython_args, 24 | subdir: 'sklearn/cluster', 25 | install: true 26 | ) 27 | endforeach 28 | 29 | subdir('_hdbscan') 30 | -------------------------------------------------------------------------------- /sklearn/cluster/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/cluster/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/cluster/tests/common.py: -------------------------------------------------------------------------------- 1 | """ 2 | Common utilities for testing clustering. 3 | 4 | """ 5 | 6 | import numpy as np 7 | 8 | ############################################################################### 9 | # Generate sample data 10 | 11 | 12 | def generate_clustered_data( 13 | seed=0, n_clusters=3, n_features=2, n_samples_per_cluster=20, std=0.4 14 | ): 15 | prng = np.random.RandomState(seed) 16 | 17 | # the data is voluntary shifted away from zero to check clustering 18 | # algorithm robustness with regards to non centered data 19 | means = ( 20 | np.array( 21 | [ 22 | [1, 1, 1, 0], 23 | [-1, -1, 0, 1], 24 | [1, -1, 1, 1], 25 | [-1, 1, 1, 0], 26 | ] 27 | ) 28 | + 10 29 | ) 30 | 31 | X = np.empty((0, n_features)) 32 | for i in range(n_clusters): 33 | X = np.r_[ 34 | X, 35 | means[i][:n_features] + std * prng.randn(n_samples_per_cluster, n_features), 36 | ] 37 | return X 38 | -------------------------------------------------------------------------------- /sklearn/compose/__init__.py: -------------------------------------------------------------------------------- 1 | """Meta-estimators for building composite models with transformers. 2 | 3 | In addition to its current contents, this module will eventually be home to 4 | refurbished versions of :class:`~sklearn.pipeline.Pipeline` and 5 | :class:`~sklearn.pipeline.FeatureUnion`. 6 | """ 7 | 8 | # Authors: The scikit-learn developers 9 | # SPDX-License-Identifier: BSD-3-Clause 10 | 11 | from ._column_transformer import ( 12 | ColumnTransformer, 13 | make_column_selector, 14 | make_column_transformer, 15 | ) 16 | from ._target import TransformedTargetRegressor 17 | 18 | __all__ = [ 19 | "ColumnTransformer", 20 | "make_column_transformer", 21 | "TransformedTargetRegressor", 22 | "make_column_selector", 23 | ] 24 | -------------------------------------------------------------------------------- /sklearn/compose/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/compose/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/covariance/__init__.py: -------------------------------------------------------------------------------- 1 | """Methods and algorithms to robustly estimate covariance. 2 | 3 | They estimate the covariance of features at given sets of points, as well as the 4 | precision matrix defined as the inverse of the covariance. Covariance estimation is 5 | closely related to the theory of Gaussian graphical models. 6 | """ 7 | 8 | # Authors: The scikit-learn developers 9 | # SPDX-License-Identifier: BSD-3-Clause 10 | 11 | from ._elliptic_envelope import EllipticEnvelope 12 | from ._empirical_covariance import ( 13 | EmpiricalCovariance, 14 | empirical_covariance, 15 | log_likelihood, 16 | ) 17 | from ._graph_lasso import GraphicalLasso, GraphicalLassoCV, graphical_lasso 18 | from ._robust_covariance import MinCovDet, fast_mcd 19 | from ._shrunk_covariance import ( 20 | OAS, 21 | LedoitWolf, 22 | ShrunkCovariance, 23 | ledoit_wolf, 24 | ledoit_wolf_shrinkage, 25 | oas, 26 | shrunk_covariance, 27 | ) 28 | 29 | __all__ = [ 30 | "EllipticEnvelope", 31 | "EmpiricalCovariance", 32 | "GraphicalLasso", 33 | "GraphicalLassoCV", 34 | "LedoitWolf", 35 | "MinCovDet", 36 | "OAS", 37 | "ShrunkCovariance", 38 | "empirical_covariance", 39 | "fast_mcd", 40 | "graphical_lasso", 41 | "ledoit_wolf", 42 | "ledoit_wolf_shrinkage", 43 | "log_likelihood", 44 | "oas", 45 | "shrunk_covariance", 46 | ] 47 | -------------------------------------------------------------------------------- /sklearn/covariance/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/covariance/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/cross_decomposition/__init__.py: -------------------------------------------------------------------------------- 1 | """Algorithms for cross decomposition.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._pls import CCA, PLSSVD, PLSCanonical, PLSRegression 7 | 8 | __all__ = ["PLSCanonical", "PLSRegression", "PLSSVD", "CCA"] 9 | -------------------------------------------------------------------------------- /sklearn/cross_decomposition/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/cross_decomposition/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/datasets/data/diabetes_data_raw.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/data/diabetes_data_raw.csv.gz -------------------------------------------------------------------------------- /sklearn/datasets/data/diabetes_target.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/data/diabetes_target.csv.gz -------------------------------------------------------------------------------- /sklearn/datasets/data/digits.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/data/digits.csv.gz -------------------------------------------------------------------------------- /sklearn/datasets/data/linnerud_exercise.csv: -------------------------------------------------------------------------------- 1 | Chins Situps Jumps 2 | 5 162 60 3 | 2 110 60 4 | 12 101 101 5 | 12 105 37 6 | 13 155 58 7 | 4 101 42 8 | 8 101 38 9 | 6 125 40 10 | 15 200 40 11 | 17 251 250 12 | 17 120 38 13 | 13 210 115 14 | 14 215 105 15 | 1 50 50 16 | 6 70 31 17 | 12 210 120 18 | 4 60 25 19 | 11 230 80 20 | 15 225 73 21 | 2 110 43 22 | -------------------------------------------------------------------------------- /sklearn/datasets/data/linnerud_physiological.csv: -------------------------------------------------------------------------------- 1 | Weight Waist Pulse 2 | 191 36 50 3 | 189 37 52 4 | 193 38 58 5 | 162 35 62 6 | 189 35 46 7 | 182 36 56 8 | 211 38 56 9 | 167 34 60 10 | 176 31 74 11 | 154 33 56 12 | 169 34 50 13 | 166 33 52 14 | 154 34 64 15 | 247 46 50 16 | 193 36 46 17 | 202 37 62 18 | 176 37 54 19 | 157 32 52 20 | 156 33 54 21 | 138 33 68 22 | -------------------------------------------------------------------------------- /sklearn/datasets/descr/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/datasets/descr/covtype.rst: -------------------------------------------------------------------------------- 1 | .. _covtype_dataset: 2 | 3 | Forest covertypes 4 | ----------------- 5 | 6 | The samples in this dataset correspond to 30×30m patches of forest in the US, 7 | collected for the task of predicting each patch's cover type, 8 | i.e. the dominant species of tree. 9 | There are seven covertypes, making this a multiclass classification problem. 10 | Each sample has 54 features, described on the 11 | `dataset's homepage `__. 12 | Some of the features are boolean indicators, 13 | while others are discrete or continuous measurements. 14 | 15 | **Data Set Characteristics:** 16 | 17 | ================= ============ 18 | Classes 7 19 | Samples total 581012 20 | Dimensionality 54 21 | Features int 22 | ================= ============ 23 | 24 | :func:`sklearn.datasets.fetch_covtype` will load the covertype dataset; 25 | it returns a dictionary-like 'Bunch' object 26 | with the feature matrix in the ``data`` member 27 | and the target values in ``target``. If optional argument 'as_frame' is 28 | set to 'True', it will return ``data`` and ``target`` as pandas 29 | data frame, and there will be an additional member ``frame`` as well. 30 | The dataset will be downloaded from the web if necessary. 31 | -------------------------------------------------------------------------------- /sklearn/datasets/descr/linnerud.rst: -------------------------------------------------------------------------------- 1 | .. _linnerrud_dataset: 2 | 3 | Linnerrud dataset 4 | ----------------- 5 | 6 | **Data Set Characteristics:** 7 | 8 | :Number of Instances: 20 9 | :Number of Attributes: 3 10 | :Missing Attribute Values: None 11 | 12 | The Linnerud dataset is a multi-output regression dataset. It consists of three 13 | exercise (data) and three physiological (target) variables collected from 14 | twenty middle-aged men in a fitness club: 15 | 16 | - *physiological* - CSV containing 20 observations on 3 physiological variables: 17 | Weight, Waist and Pulse. 18 | - *exercise* - CSV containing 20 observations on 3 exercise variables: 19 | Chins, Situps and Jumps. 20 | 21 | .. dropdown:: References 22 | 23 | * Tenenhaus, M. (1998). La regression PLS: theorie et pratique. Paris: 24 | Editions Technic. 25 | -------------------------------------------------------------------------------- /sklearn/datasets/images/README.txt: -------------------------------------------------------------------------------- 1 | Image: china.jpg 2 | Released under a creative commons license. [1] 3 | Attribution: Some rights reserved by danielbuechele [2] 4 | Retrieved 21st August, 2011 from [3] by Robert Layton 5 | 6 | [1] https://creativecommons.org/licenses/by/2.0/ 7 | [2] https://www.flickr.com/photos/danielbuechele/ 8 | [3] https://www.flickr.com/photos/danielbuechele/6061409035/sizes/z/in/photostream/ 9 | 10 | 11 | Image: flower.jpg 12 | Released under a creative commons license. [1] 13 | Attribution: Some rights reserved by danielbuechele [2] 14 | Retrieved 21st August, 2011 from [3] by Robert Layton 15 | 16 | [1] https://creativecommons.org/licenses/by/2.0/ 17 | [2] https://www.flickr.com/photos/vultilion/ 18 | [3] https://www.flickr.com/photos/vultilion/6056698931/sizes/z/in/photostream/ 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sklearn/datasets/images/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/datasets/images/china.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/images/china.jpg -------------------------------------------------------------------------------- /sklearn/datasets/images/flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/images/flower.jpg -------------------------------------------------------------------------------- /sklearn/datasets/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_svmlight_format_fast', 3 | '_svmlight_format_fast.pyx', 4 | dependencies: [np_dep], 5 | cython_args: cython_args, 6 | subdir: 'sklearn/datasets', 7 | install: true 8 | ) 9 | -------------------------------------------------------------------------------- /sklearn/datasets/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1/api-v1-jd-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1/api-v1-jd-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1/api-v1-jdf-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1/api-v1-jdf-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1/api-v1-jdq-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1/api-v1-jdq-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1/data-v1-dl-1.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1/data-v1-dl-1.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/api-v1-jd-1119.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/api-v1-jd-1119.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/api-v1-jdf-1119.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/api-v1-jdf-1119.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/api-v1-jdl-dn-adult-census-l-2-dv-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/api-v1-jdl-dn-adult-census-l-2-dv-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/api-v1-jdl-dn-adult-census-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/api-v1-jdl-dn-adult-census-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/api-v1-jdq-1119.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/api-v1-jdq-1119.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1119/data-v1-dl-54002.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1119/data-v1-dl-54002.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1590/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1590/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1590/api-v1-jd-1590.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1590/api-v1-jd-1590.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1590/api-v1-jdf-1590.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1590/api-v1-jdf-1590.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1590/api-v1-jdq-1590.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1590/api-v1-jdq-1590.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_1590/data-v1-dl-1595261.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_1590/data-v1-dl-1595261.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/api-v1-jd-2.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/api-v1-jd-2.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/api-v1-jdf-2.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/api-v1-jdf-2.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/api-v1-jdl-dn-anneal-l-2-dv-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/api-v1-jdl-dn-anneal-l-2-dv-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/api-v1-jdl-dn-anneal-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/api-v1-jdl-dn-anneal-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/api-v1-jdq-2.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/api-v1-jdq-2.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_2/data-v1-dl-1666876.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_2/data-v1-dl-1666876.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jd-292.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jd-292.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jd-40981.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jd-40981.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jdf-292.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jdf-292.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jdf-40981.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jdf-40981.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-dv-1-s-dact.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-dv-1-s-dact.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-dv-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-dv-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_292/data-v1-dl-49822.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_292/data-v1-dl-49822.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_3/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_3/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_3/api-v1-jd-3.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_3/api-v1-jd-3.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_3/api-v1-jdf-3.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_3/api-v1-jdf-3.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_3/api-v1-jdq-3.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_3/api-v1-jdq-3.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_3/data-v1-dl-3.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_3/data-v1-dl-3.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/api-v1-jd-40589.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/api-v1-jd-40589.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/api-v1-jdf-40589.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/api-v1-jdf-40589.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/api-v1-jdl-dn-emotions-l-2-dv-3.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/api-v1-jdl-dn-emotions-l-2-dv-3.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/api-v1-jdl-dn-emotions-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/api-v1-jdl-dn-emotions-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/api-v1-jdq-40589.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/api-v1-jdq-40589.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40589/data-v1-dl-4644182.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40589/data-v1-dl-4644182.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/api-v1-jd-40675.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/api-v1-jd-40675.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/api-v1-jdf-40675.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/api-v1-jdf-40675.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-dv-1-s-dact.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-dv-1-s-dact.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-dv-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-dv-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/api-v1-jdq-40675.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/api-v1-jdq-40675.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40675/data-v1-dl-4965250.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40675/data-v1-dl-4965250.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40945/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40945/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40945/api-v1-jd-40945.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40945/api-v1-jd-40945.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40945/api-v1-jdf-40945.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40945/api-v1-jdf-40945.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40945/api-v1-jdq-40945.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40945/api-v1-jdq-40945.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40945/data-v1-dl-16826755.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40945/data-v1-dl-16826755.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/api-v1-jd-40966.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/api-v1-jd-40966.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/api-v1-jdf-40966.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/api-v1-jdf-40966.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/api-v1-jdl-dn-miceprotein-l-2-dv-4.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/api-v1-jdl-dn-miceprotein-l-2-dv-4.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/api-v1-jdl-dn-miceprotein-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/api-v1-jdl-dn-miceprotein-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/api-v1-jdq-40966.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/api-v1-jdq-40966.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_40966/data-v1-dl-17928620.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_40966/data-v1-dl-17928620.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42074/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42074/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42074/api-v1-jd-42074.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42074/api-v1-jd-42074.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42074/api-v1-jdf-42074.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42074/api-v1-jdf-42074.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42074/api-v1-jdq-42074.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42074/api-v1-jdq-42074.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42074/data-v1-dl-21552912.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42074/data-v1-dl-21552912.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42585/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42585/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42585/api-v1-jd-42585.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42585/api-v1-jd-42585.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42585/api-v1-jdf-42585.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42585/api-v1-jdf-42585.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42585/api-v1-jdq-42585.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42585/api-v1-jdq-42585.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_42585/data-v1-dl-21854866.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_42585/data-v1-dl-21854866.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/api-v1-jd-561.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/api-v1-jd-561.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/api-v1-jdf-561.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/api-v1-jdf-561.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/api-v1-jdl-dn-cpu-l-2-dv-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/api-v1-jdl-dn-cpu-l-2-dv-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/api-v1-jdl-dn-cpu-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/api-v1-jdl-dn-cpu-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/api-v1-jdq-561.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/api-v1-jdq-561.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_561/data-v1-dl-52739.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_561/data-v1-dl-52739.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/api-v1-jd-61.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/api-v1-jd-61.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/api-v1-jdf-61.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/api-v1-jdf-61.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/api-v1-jdl-dn-iris-l-2-dv-1.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/api-v1-jdl-dn-iris-l-2-dv-1.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/api-v1-jdl-dn-iris-l-2-s-act-.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/api-v1-jdl-dn-iris-l-2-s-act-.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/api-v1-jdq-61.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/api-v1-jdq-61.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_61/data-v1-dl-61.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_61/data-v1-dl-61.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_62/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_62/__init__.py -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_62/api-v1-jd-62.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_62/api-v1-jd-62.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_62/api-v1-jdf-62.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_62/api-v1-jdf-62.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_62/api-v1-jdq-62.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_62/api-v1-jdq-62.json.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/openml/id_62/data-v1-dl-52352.arff.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/datasets/tests/data/openml/id_62/data-v1-dl-52352.arff.gz -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/svmlight_classification.txt: -------------------------------------------------------------------------------- 1 | # comment 2 | # note: the next line contains a tab 3 | 1.0 3:2.5 11:-5.2 16:1.5 # and an inline comment 4 | 2.0 6:1.0 13:-3 5 | # another comment 6 | 3.0 21:27 7 | 4.0 2:1.234567890123456e10 # double precision value 8 | 1.0 # empty line, all zeros 9 | 2.0 3:0 # explicit zeros 10 | -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/svmlight_invalid.txt: -------------------------------------------------------------------------------- 1 | python 2:2.5 10:-5.2 15:1.5 2 | 2.0 5:1.0 12:-3 3 | 3.0 20:27 4 | -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/svmlight_invalid_order.txt: -------------------------------------------------------------------------------- 1 | -1 5:2.5 2:-5.2 15:1.5 2 | -------------------------------------------------------------------------------- /sklearn/datasets/tests/data/svmlight_multilabel.txt: -------------------------------------------------------------------------------- 1 | # multilabel dataset in SVMlight format 2 | 1,0 2:2.5 10:-5.2 15:1.5 3 | 2 5:1.0 12:-3 4 | 2:3.5 11:26 5 | 1,2 20:27 6 | -------------------------------------------------------------------------------- /sklearn/datasets/tests/test_olivetti_faces.py: -------------------------------------------------------------------------------- 1 | """Test Olivetti faces fetcher, if the data is available, 2 | or if specifically requested via environment variable 3 | (e.g. for CI jobs).""" 4 | 5 | import numpy as np 6 | 7 | from sklearn.datasets.tests.test_common import check_return_X_y 8 | from sklearn.utils import Bunch 9 | from sklearn.utils._testing import assert_array_equal 10 | 11 | 12 | def test_olivetti_faces(fetch_olivetti_faces_fxt): 13 | data = fetch_olivetti_faces_fxt(shuffle=True, random_state=0) 14 | 15 | assert isinstance(data, Bunch) 16 | for expected_keys in ("data", "images", "target", "DESCR"): 17 | assert expected_keys in data.keys() 18 | 19 | assert data.data.shape == (400, 4096) 20 | assert data.images.shape == (400, 64, 64) 21 | assert data.target.shape == (400,) 22 | assert_array_equal(np.unique(np.sort(data.target)), np.arange(40)) 23 | assert data.DESCR.startswith(".. _olivetti_faces_dataset:") 24 | 25 | # test the return_X_y option 26 | check_return_X_y(data, fetch_olivetti_faces_fxt) 27 | -------------------------------------------------------------------------------- /sklearn/decomposition/_cdnmf_fast.pyx: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | from cython cimport floating 5 | from libc.math cimport fabs 6 | 7 | 8 | def _update_cdnmf_fast(floating[:, ::1] W, floating[:, :] HHt, 9 | floating[:, :] XHt, Py_ssize_t[::1] permutation): 10 | cdef: 11 | floating violation = 0 12 | Py_ssize_t n_components = W.shape[1] 13 | Py_ssize_t n_samples = W.shape[0] # n_features for H update 14 | floating grad, pg, hess 15 | Py_ssize_t i, r, s, t 16 | 17 | with nogil: 18 | for s in range(n_components): 19 | t = permutation[s] 20 | 21 | for i in range(n_samples): 22 | # gradient = GW[t, i] where GW = np.dot(W, HHt) - XHt 23 | grad = -XHt[i, t] 24 | 25 | for r in range(n_components): 26 | grad += HHt[t, r] * W[i, r] 27 | 28 | # projected gradient 29 | pg = min(0., grad) if W[i, t] == 0 else grad 30 | violation += fabs(pg) 31 | 32 | # Hessian 33 | hess = HHt[t, t] 34 | 35 | if hess != 0: 36 | W[i, t] = max(W[i, t] - grad / hess, 0.) 37 | 38 | return violation 39 | -------------------------------------------------------------------------------- /sklearn/decomposition/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_online_lda_fast', 3 | ['_online_lda_fast.pyx', utils_cython_tree], 4 | cython_args: cython_args, 5 | subdir: 'sklearn/decomposition', 6 | install: true 7 | ) 8 | 9 | py.extension_module( 10 | '_cdnmf_fast', 11 | '_cdnmf_fast.pyx', 12 | dependencies: [np_dep], 13 | cython_args: cython_args, 14 | subdir: 'sklearn/decomposition', 15 | install: true 16 | ) 17 | -------------------------------------------------------------------------------- /sklearn/decomposition/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/decomposition/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/ensemble/_hist_gradient_boosting/__init__.py: -------------------------------------------------------------------------------- 1 | """This module implements histogram-based gradient boosting estimators. 2 | 3 | The implementation is a port from pygbm which is itself strongly inspired 4 | from LightGBM. 5 | """ 6 | 7 | # Authors: The scikit-learn developers 8 | # SPDX-License-Identifier: BSD-3-Clause 9 | -------------------------------------------------------------------------------- /sklearn/ensemble/_hist_gradient_boosting/_bitset.pxd: -------------------------------------------------------------------------------- 1 | from .common cimport X_BINNED_DTYPE_C 2 | from .common cimport BITSET_DTYPE_C 3 | from .common cimport BITSET_INNER_DTYPE_C 4 | from .common cimport X_DTYPE_C 5 | from ...utils._typedefs cimport uint8_t 6 | 7 | 8 | cdef void init_bitset(BITSET_DTYPE_C bitset) noexcept nogil 9 | 10 | cdef void set_bitset(BITSET_DTYPE_C bitset, X_BINNED_DTYPE_C val) noexcept nogil 11 | 12 | cdef uint8_t in_bitset(BITSET_DTYPE_C bitset, X_BINNED_DTYPE_C val) noexcept nogil 13 | 14 | cpdef uint8_t in_bitset_memoryview(const BITSET_INNER_DTYPE_C[:] bitset, 15 | X_BINNED_DTYPE_C val) noexcept nogil 16 | 17 | cdef uint8_t in_bitset_2d_memoryview( 18 | const BITSET_INNER_DTYPE_C[:, :] bitset, 19 | X_BINNED_DTYPE_C val, 20 | unsigned int row) noexcept nogil 21 | -------------------------------------------------------------------------------- /sklearn/ensemble/_hist_gradient_boosting/common.pxd: -------------------------------------------------------------------------------- 1 | from ...utils._typedefs cimport float32_t, float64_t, intp_t, uint8_t, uint32_t 2 | 3 | 4 | ctypedef float64_t X_DTYPE_C 5 | ctypedef uint8_t X_BINNED_DTYPE_C 6 | ctypedef float64_t Y_DTYPE_C 7 | ctypedef float32_t G_H_DTYPE_C 8 | ctypedef uint32_t BITSET_INNER_DTYPE_C 9 | ctypedef BITSET_INNER_DTYPE_C[8] BITSET_DTYPE_C 10 | 11 | 12 | cdef packed struct hist_struct: 13 | # Same as histogram dtype but we need a struct to declare views. It needs 14 | # to be packed since by default numpy dtypes aren't aligned 15 | Y_DTYPE_C sum_gradients 16 | Y_DTYPE_C sum_hessians 17 | unsigned int count 18 | 19 | 20 | cdef packed struct node_struct: 21 | # Equivalent struct to PREDICTOR_RECORD_DTYPE to use in memory views. It 22 | # needs to be packed since by default numpy dtypes aren't aligned 23 | Y_DTYPE_C value 24 | unsigned int count 25 | intp_t feature_idx 26 | X_DTYPE_C num_threshold 27 | uint8_t missing_go_to_left 28 | unsigned int left 29 | unsigned int right 30 | Y_DTYPE_C gain 31 | unsigned int depth 32 | uint8_t is_leaf 33 | X_BINNED_DTYPE_C bin_threshold 34 | uint8_t is_categorical 35 | # The index of the corresponding bitsets in the Predictor's bitset arrays. 36 | # Only used if is_categorical is True 37 | unsigned int bitset_idx 38 | 39 | 40 | cpdef enum MonotonicConstraint: 41 | NO_CST = 0 42 | POS = 1 43 | NEG = -1 44 | -------------------------------------------------------------------------------- /sklearn/ensemble/_hist_gradient_boosting/meson.build: -------------------------------------------------------------------------------- 1 | hist_gradient_boosting_extension_metadata = { 2 | '_gradient_boosting': {'sources': ['_gradient_boosting.pyx'], 'dependencies': [openmp_dep]}, 3 | 'histogram': {'sources': ['histogram.pyx'], 'dependencies': [openmp_dep]}, 4 | 'splitting': {'sources': ['splitting.pyx'], 'dependencies': [openmp_dep]}, 5 | '_binning': {'sources': ['_binning.pyx'], 'dependencies': [openmp_dep]}, 6 | '_predictor': {'sources': ['_predictor.pyx'], 'dependencies': [openmp_dep]}, 7 | '_bitset': {'sources': ['_bitset.pyx']}, 8 | 'common': {'sources': ['common.pyx']}, 9 | } 10 | 11 | foreach ext_name, ext_dict : hist_gradient_boosting_extension_metadata 12 | py.extension_module( 13 | ext_name, 14 | ext_dict.get('sources'), 15 | dependencies: ext_dict.get('dependencies', []), 16 | cython_args: cython_args, 17 | subdir: 'sklearn/ensemble/_hist_gradient_boosting', 18 | install: true 19 | ) 20 | endforeach 21 | -------------------------------------------------------------------------------- /sklearn/ensemble/_hist_gradient_boosting/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/ensemble/_hist_gradient_boosting/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/ensemble/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_gradient_boosting', 3 | ['_gradient_boosting.pyx'] + utils_cython_tree, 4 | dependencies: [np_dep], 5 | cython_args: cython_args, 6 | subdir: 'sklearn/ensemble', 7 | install: true 8 | ) 9 | 10 | subdir('_hist_gradient_boosting') 11 | -------------------------------------------------------------------------------- /sklearn/ensemble/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/ensemble/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/experimental/__init__.py: -------------------------------------------------------------------------------- 1 | """Importable modules that enable the use of experimental features or estimators. 2 | 3 | .. warning:: 4 | 5 | The features and estimators that are experimental aren't subject to 6 | deprecation cycles. Use them at your own risks! 7 | """ 8 | 9 | # Authors: The scikit-learn developers 10 | # SPDX-License-Identifier: BSD-3-Clause 11 | -------------------------------------------------------------------------------- /sklearn/experimental/enable_halving_search_cv.py: -------------------------------------------------------------------------------- 1 | """Enables Successive Halving search-estimators 2 | 3 | The API and results of these estimators might change without any deprecation 4 | cycle. 5 | 6 | Importing this file dynamically sets the 7 | :class:`~sklearn.model_selection.HalvingRandomSearchCV` and 8 | :class:`~sklearn.model_selection.HalvingGridSearchCV` as attributes of the 9 | `model_selection` module:: 10 | 11 | >>> # explicitly require this experimental feature 12 | >>> from sklearn.experimental import enable_halving_search_cv # noqa 13 | >>> # now you can import normally from model_selection 14 | >>> from sklearn.model_selection import HalvingRandomSearchCV 15 | >>> from sklearn.model_selection import HalvingGridSearchCV 16 | 17 | 18 | The ``# noqa`` comment comment can be removed: it just tells linters like 19 | flake8 to ignore the import, which appears as unused. 20 | """ 21 | 22 | # Authors: The scikit-learn developers 23 | # SPDX-License-Identifier: BSD-3-Clause 24 | 25 | from .. import model_selection 26 | from ..model_selection._search_successive_halving import ( 27 | HalvingGridSearchCV, 28 | HalvingRandomSearchCV, 29 | ) 30 | 31 | # use settattr to avoid mypy errors when monkeypatching 32 | setattr(model_selection, "HalvingRandomSearchCV", HalvingRandomSearchCV) 33 | setattr(model_selection, "HalvingGridSearchCV", HalvingGridSearchCV) 34 | 35 | model_selection.__all__ += ["HalvingRandomSearchCV", "HalvingGridSearchCV"] 36 | -------------------------------------------------------------------------------- /sklearn/experimental/enable_hist_gradient_boosting.py: -------------------------------------------------------------------------------- 1 | """This is now a no-op and can be safely removed from your code. 2 | 3 | It used to enable the use of 4 | :class:`~sklearn.ensemble.HistGradientBoostingClassifier` and 5 | :class:`~sklearn.ensemble.HistGradientBoostingRegressor` when they were still 6 | :term:`experimental`, but these estimators are now stable and can be imported 7 | normally from `sklearn.ensemble`. 8 | """ 9 | 10 | # Authors: The scikit-learn developers 11 | # SPDX-License-Identifier: BSD-3-Clause 12 | 13 | # Don't remove this file, we don't want to break users code just because the 14 | # feature isn't experimental anymore. 15 | 16 | 17 | import warnings 18 | 19 | warnings.warn( 20 | "Since version 1.0, " 21 | "it is not needed to import enable_hist_gradient_boosting anymore. " 22 | "HistGradientBoostingClassifier and HistGradientBoostingRegressor are now " 23 | "stable and can be normally imported from sklearn.ensemble." 24 | ) 25 | -------------------------------------------------------------------------------- /sklearn/experimental/enable_iterative_imputer.py: -------------------------------------------------------------------------------- 1 | """Enables IterativeImputer 2 | 3 | The API and results of this estimator might change without any deprecation 4 | cycle. 5 | 6 | Importing this file dynamically sets :class:`~sklearn.impute.IterativeImputer` 7 | as an attribute of the impute module:: 8 | 9 | >>> # explicitly require this experimental feature 10 | >>> from sklearn.experimental import enable_iterative_imputer # noqa 11 | >>> # now you can import normally from impute 12 | >>> from sklearn.impute import IterativeImputer 13 | """ 14 | 15 | # Authors: The scikit-learn developers 16 | # SPDX-License-Identifier: BSD-3-Clause 17 | 18 | from .. import impute 19 | from ..impute._iterative import IterativeImputer 20 | 21 | # use settattr to avoid mypy errors when monkeypatching 22 | setattr(impute, "IterativeImputer", IterativeImputer) 23 | impute.__all__ += ["IterativeImputer"] 24 | -------------------------------------------------------------------------------- /sklearn/experimental/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/experimental/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/experimental/tests/test_enable_hist_gradient_boosting.py: -------------------------------------------------------------------------------- 1 | """Tests for making sure experimental imports work as expected.""" 2 | 3 | import textwrap 4 | 5 | import pytest 6 | 7 | from sklearn.utils._testing import assert_run_python_script_without_output 8 | from sklearn.utils.fixes import _IS_WASM 9 | 10 | 11 | @pytest.mark.xfail(_IS_WASM, reason="cannot start subprocess") 12 | def test_import_raises_warning(): 13 | code = """ 14 | import pytest 15 | with pytest.warns(UserWarning, match="it is not needed to import"): 16 | from sklearn.experimental import enable_hist_gradient_boosting # noqa 17 | """ 18 | pattern = "it is not needed to import enable_hist_gradient_boosting anymore" 19 | assert_run_python_script_without_output(textwrap.dedent(code), pattern=pattern) 20 | -------------------------------------------------------------------------------- /sklearn/externals/README: -------------------------------------------------------------------------------- 1 | This directory contains bundled external dependencies that are updated 2 | every once in a while. 3 | 4 | Note for distribution packagers: if you want to remove the duplicated 5 | code and depend on a packaged version, we suggest that you simply do a 6 | symbolic link in this directory. 7 | 8 | -------------------------------------------------------------------------------- /sklearn/externals/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | External, bundled dependencies. 4 | 5 | """ 6 | -------------------------------------------------------------------------------- /sklearn/externals/_packaging/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/externals/_packaging/__init__.py -------------------------------------------------------------------------------- /sklearn/externals/_scipy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/externals/_scipy/__init__.py -------------------------------------------------------------------------------- /sklearn/externals/_scipy/sparse/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/externals/_scipy/sparse/__init__.py -------------------------------------------------------------------------------- /sklearn/externals/_scipy/sparse/csgraph/__init__.py: -------------------------------------------------------------------------------- 1 | from ._laplacian import laplacian 2 | -------------------------------------------------------------------------------- /sklearn/externals/conftest.py: -------------------------------------------------------------------------------- 1 | # Do not collect any tests in externals. This is more robust than using 2 | # --ignore because --ignore needs a path and it is not convenient to pass in 3 | # the externals path (very long install-dependent path in site-packages) when 4 | # using --pyargs 5 | def pytest_ignore_collect(collection_path, config): 6 | return True 7 | -------------------------------------------------------------------------------- /sklearn/feature_extraction/__init__.py: -------------------------------------------------------------------------------- 1 | """Feature extraction from raw data.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from . import image, text 7 | from ._dict_vectorizer import DictVectorizer 8 | from ._hash import FeatureHasher 9 | from .image import grid_to_graph, img_to_graph 10 | 11 | __all__ = [ 12 | "DictVectorizer", 13 | "image", 14 | "img_to_graph", 15 | "grid_to_graph", 16 | "text", 17 | "FeatureHasher", 18 | ] 19 | -------------------------------------------------------------------------------- /sklearn/feature_extraction/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_hashing_fast', 3 | ['_hashing_fast.pyx', utils_cython_tree], 4 | dependencies: [np_dep], 5 | override_options: ['cython_language=cpp'], 6 | cython_args: cython_args, 7 | subdir: 'sklearn/feature_extraction', 8 | install: true 9 | ) 10 | -------------------------------------------------------------------------------- /sklearn/feature_extraction/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/feature_extraction/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/feature_selection/__init__.py: -------------------------------------------------------------------------------- 1 | """Feature selection algorithms. 2 | 3 | These include univariate filter selection methods and the recursive feature elimination 4 | algorithm. 5 | """ 6 | 7 | # Authors: The scikit-learn developers 8 | # SPDX-License-Identifier: BSD-3-Clause 9 | 10 | from ._base import SelectorMixin 11 | from ._from_model import SelectFromModel 12 | from ._mutual_info import mutual_info_classif, mutual_info_regression 13 | from ._rfe import RFE, RFECV 14 | from ._sequential import SequentialFeatureSelector 15 | from ._univariate_selection import ( 16 | GenericUnivariateSelect, 17 | SelectFdr, 18 | SelectFpr, 19 | SelectFwe, 20 | SelectKBest, 21 | SelectPercentile, 22 | chi2, 23 | f_classif, 24 | f_oneway, 25 | f_regression, 26 | r_regression, 27 | ) 28 | from ._variance_threshold import VarianceThreshold 29 | 30 | __all__ = [ 31 | "GenericUnivariateSelect", 32 | "SequentialFeatureSelector", 33 | "RFE", 34 | "RFECV", 35 | "SelectFdr", 36 | "SelectFpr", 37 | "SelectFwe", 38 | "SelectKBest", 39 | "SelectFromModel", 40 | "SelectPercentile", 41 | "VarianceThreshold", 42 | "chi2", 43 | "f_classif", 44 | "f_oneway", 45 | "f_regression", 46 | "r_regression", 47 | "mutual_info_classif", 48 | "mutual_info_regression", 49 | "SelectorMixin", 50 | ] 51 | -------------------------------------------------------------------------------- /sklearn/feature_selection/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/feature_selection/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/frozen/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | from ._frozen import FrozenEstimator 5 | 6 | __all__ = ["FrozenEstimator"] 7 | -------------------------------------------------------------------------------- /sklearn/frozen/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/frozen/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/gaussian_process/__init__.py: -------------------------------------------------------------------------------- 1 | """Gaussian process based regression and classification.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from . import kernels 7 | from ._gpc import GaussianProcessClassifier 8 | from ._gpr import GaussianProcessRegressor 9 | 10 | __all__ = ["GaussianProcessRegressor", "GaussianProcessClassifier", "kernels"] 11 | -------------------------------------------------------------------------------- /sklearn/gaussian_process/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/gaussian_process/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/impute/__init__.py: -------------------------------------------------------------------------------- 1 | """Transformers for missing value imputation.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | import typing 7 | 8 | from ._base import MissingIndicator, SimpleImputer 9 | from ._knn import KNNImputer 10 | 11 | if typing.TYPE_CHECKING: 12 | # Avoid errors in type checkers (e.g. mypy) for experimental estimators. 13 | # TODO: remove this check once the estimator is no longer experimental. 14 | from ._iterative import IterativeImputer # noqa 15 | 16 | __all__ = ["MissingIndicator", "SimpleImputer", "KNNImputer"] 17 | 18 | 19 | # TODO: remove this check once the estimator is no longer experimental. 20 | def __getattr__(name): 21 | if name == "IterativeImputer": 22 | raise ImportError( 23 | f"{name} is experimental and the API might change without any " 24 | "deprecation cycle. To use it, you need to explicitly import " 25 | "enable_iterative_imputer:\n" 26 | "from sklearn.experimental import enable_iterative_imputer" 27 | ) 28 | raise AttributeError(f"module {__name__} has no attribute {name}") 29 | -------------------------------------------------------------------------------- /sklearn/impute/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/impute/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/inspection/__init__.py: -------------------------------------------------------------------------------- 1 | """Tools for model inspection.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._partial_dependence import partial_dependence 7 | from ._permutation_importance import permutation_importance 8 | from ._plot.decision_boundary import DecisionBoundaryDisplay 9 | from ._plot.partial_dependence import PartialDependenceDisplay 10 | 11 | __all__ = [ 12 | "partial_dependence", 13 | "permutation_importance", 14 | "PartialDependenceDisplay", 15 | "DecisionBoundaryDisplay", 16 | ] 17 | -------------------------------------------------------------------------------- /sklearn/inspection/_plot/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/inspection/_plot/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/inspection/_plot/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/inspection/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/inspection/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/linear_model/_glm/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | from .glm import ( 5 | GammaRegressor, 6 | PoissonRegressor, 7 | TweedieRegressor, 8 | _GeneralizedLinearRegressor, 9 | ) 10 | 11 | __all__ = [ 12 | "_GeneralizedLinearRegressor", 13 | "PoissonRegressor", 14 | "GammaRegressor", 15 | "TweedieRegressor", 16 | ] 17 | -------------------------------------------------------------------------------- /sklearn/linear_model/_glm/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/linear_model/meson.build: -------------------------------------------------------------------------------- 1 | # .pyx is generated, so this is needed to make Cython compilation work 2 | linear_model_cython_tree = [ 3 | fs.copyfile('__init__.py'), 4 | ] 5 | 6 | py.extension_module( 7 | '_cd_fast', 8 | ['_cd_fast.pyx', utils_cython_tree], 9 | cython_args: cython_args, 10 | subdir: 'sklearn/linear_model', 11 | install: true 12 | ) 13 | 14 | name_list = ['_sgd_fast', '_sag_fast'] 15 | 16 | foreach name: name_list 17 | pyx = custom_target( 18 | name + '_pyx', 19 | output: name + '.pyx', 20 | input: name + '.pyx.tp', 21 | command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'], 22 | # TODO in principle this should go in py.exension_module below. This is 23 | # temporary work-around for dependency issue with .pyx.tp files. For more 24 | # details, see https://github.com/mesonbuild/meson/issues/13212 25 | depends: [linear_model_cython_tree, utils_cython_tree], 26 | ) 27 | py.extension_module( 28 | name, 29 | pyx, 30 | cython_args: cython_args, 31 | subdir: 'sklearn/linear_model', 32 | install: true 33 | ) 34 | endforeach 35 | -------------------------------------------------------------------------------- /sklearn/linear_model/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/linear_model/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/manifold/__init__.py: -------------------------------------------------------------------------------- 1 | """Data embedding techniques.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._isomap import Isomap 7 | from ._locally_linear import LocallyLinearEmbedding, locally_linear_embedding 8 | from ._mds import MDS, smacof 9 | from ._spectral_embedding import SpectralEmbedding, spectral_embedding 10 | from ._t_sne import TSNE, trustworthiness 11 | 12 | __all__ = [ 13 | "locally_linear_embedding", 14 | "LocallyLinearEmbedding", 15 | "Isomap", 16 | "MDS", 17 | "smacof", 18 | "SpectralEmbedding", 19 | "spectral_embedding", 20 | "TSNE", 21 | "trustworthiness", 22 | ] 23 | -------------------------------------------------------------------------------- /sklearn/manifold/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_utils', 3 | ['_utils.pyx', utils_cython_tree], 4 | cython_args: cython_args, 5 | subdir: 'sklearn/manifold', 6 | install: true 7 | ) 8 | 9 | py.extension_module( 10 | '_barnes_hut_tsne', 11 | '_barnes_hut_tsne.pyx', 12 | dependencies: [np_dep, openmp_dep], 13 | cython_args: cython_args, 14 | subdir: 'sklearn/manifold', 15 | install: true 16 | ) 17 | -------------------------------------------------------------------------------- /sklearn/manifold/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/manifold/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/metrics/_pairwise_distances_reduction/_argkmin.pxd.tp: -------------------------------------------------------------------------------- 1 | from ...utils._typedefs cimport intp_t, float64_t 2 | 3 | {{for name_suffix in ['64', '32']}} 4 | 5 | from ._base cimport BaseDistancesReduction{{name_suffix}} 6 | from ._middle_term_computer cimport MiddleTermComputer{{name_suffix}} 7 | 8 | cdef class ArgKmin{{name_suffix}}(BaseDistancesReduction{{name_suffix}}): 9 | """float{{name_suffix}} implementation of the ArgKmin.""" 10 | 11 | cdef: 12 | intp_t k 13 | 14 | intp_t[:, ::1] argkmin_indices 15 | float64_t[:, ::1] argkmin_distances 16 | 17 | # Used as array of pointers to private datastructures used in threads. 18 | float64_t ** heaps_r_distances_chunks 19 | intp_t ** heaps_indices_chunks 20 | 21 | 22 | cdef class EuclideanArgKmin{{name_suffix}}(ArgKmin{{name_suffix}}): 23 | """EuclideanDistance-specialisation of ArgKmin{{name_suffix}}.""" 24 | cdef: 25 | MiddleTermComputer{{name_suffix}} middle_term_computer 26 | const float64_t[::1] X_norm_squared 27 | const float64_t[::1] Y_norm_squared 28 | 29 | bint use_squared_distances 30 | 31 | {{endfor}} 32 | -------------------------------------------------------------------------------- /sklearn/metrics/_pairwise_distances_reduction/_classmode.pxd: -------------------------------------------------------------------------------- 1 | cpdef enum WeightingStrategy: 2 | uniform = 0 3 | # TODO: Implement the following options in weighted_histogram_mode 4 | distance = 1 5 | callable = 2 6 | -------------------------------------------------------------------------------- /sklearn/metrics/_plot/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/metrics/_plot/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/metrics/_plot/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/metrics/cluster/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_expected_mutual_info_fast', 3 | '_expected_mutual_info_fast.pyx', 4 | cython_args: cython_args, 5 | subdir: 'sklearn/metrics/cluster', 6 | install: true 7 | ) 8 | -------------------------------------------------------------------------------- /sklearn/metrics/cluster/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/metrics/cluster/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/metrics/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/metrics/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/mixture/__init__.py: -------------------------------------------------------------------------------- 1 | """Mixture modeling algorithms.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._bayesian_mixture import BayesianGaussianMixture 7 | from ._gaussian_mixture import GaussianMixture 8 | 9 | __all__ = ["GaussianMixture", "BayesianGaussianMixture"] 10 | -------------------------------------------------------------------------------- /sklearn/mixture/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/mixture/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/mixture/tests/test_mixture.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | import numpy as np 5 | import pytest 6 | 7 | from sklearn.mixture import BayesianGaussianMixture, GaussianMixture 8 | 9 | 10 | @pytest.mark.parametrize("estimator", [GaussianMixture(), BayesianGaussianMixture()]) 11 | def test_gaussian_mixture_n_iter(estimator): 12 | # check that n_iter is the number of iteration performed. 13 | rng = np.random.RandomState(0) 14 | X = rng.rand(10, 5) 15 | max_iter = 1 16 | estimator.set_params(max_iter=max_iter) 17 | estimator.fit(X) 18 | assert estimator.n_iter_ == max_iter 19 | 20 | 21 | @pytest.mark.parametrize("estimator", [GaussianMixture(), BayesianGaussianMixture()]) 22 | def test_mixture_n_components_greater_than_n_samples_error(estimator): 23 | """Check error when n_components <= n_samples""" 24 | rng = np.random.RandomState(0) 25 | X = rng.rand(10, 5) 26 | estimator.set_params(n_components=12) 27 | 28 | msg = "Expected n_samples >= n_components" 29 | with pytest.raises(ValueError, match=msg): 30 | estimator.fit(X) 31 | -------------------------------------------------------------------------------- /sklearn/model_selection/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/model_selection/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/model_selection/tests/common.py: -------------------------------------------------------------------------------- 1 | """ 2 | Common utilities for testing model selection. 3 | """ 4 | 5 | import numpy as np 6 | 7 | from sklearn.model_selection import KFold 8 | 9 | 10 | class OneTimeSplitter: 11 | """A wrapper to make KFold single entry cv iterator""" 12 | 13 | def __init__(self, n_splits=4, n_samples=99): 14 | self.n_splits = n_splits 15 | self.n_samples = n_samples 16 | self.indices = iter(KFold(n_splits=n_splits).split(np.ones(n_samples))) 17 | 18 | def split(self, X=None, y=None, groups=None): 19 | """Split can be called only once""" 20 | for index in self.indices: 21 | yield index 22 | 23 | def get_n_splits(self, X=None, y=None, groups=None): 24 | return self.n_splits 25 | -------------------------------------------------------------------------------- /sklearn/neighbors/__init__.py: -------------------------------------------------------------------------------- 1 | """The k-nearest neighbors algorithms.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._ball_tree import BallTree 7 | from ._base import VALID_METRICS, VALID_METRICS_SPARSE, sort_graph_by_row_values 8 | from ._classification import KNeighborsClassifier, RadiusNeighborsClassifier 9 | from ._graph import ( 10 | KNeighborsTransformer, 11 | RadiusNeighborsTransformer, 12 | kneighbors_graph, 13 | radius_neighbors_graph, 14 | ) 15 | from ._kd_tree import KDTree 16 | from ._kde import KernelDensity 17 | from ._lof import LocalOutlierFactor 18 | from ._nca import NeighborhoodComponentsAnalysis 19 | from ._nearest_centroid import NearestCentroid 20 | from ._regression import KNeighborsRegressor, RadiusNeighborsRegressor 21 | from ._unsupervised import NearestNeighbors 22 | 23 | __all__ = [ 24 | "BallTree", 25 | "KDTree", 26 | "KNeighborsClassifier", 27 | "KNeighborsRegressor", 28 | "KNeighborsTransformer", 29 | "NearestCentroid", 30 | "NearestNeighbors", 31 | "RadiusNeighborsClassifier", 32 | "RadiusNeighborsRegressor", 33 | "RadiusNeighborsTransformer", 34 | "kneighbors_graph", 35 | "radius_neighbors_graph", 36 | "KernelDensity", 37 | "LocalOutlierFactor", 38 | "NeighborhoodComponentsAnalysis", 39 | "sort_graph_by_row_values", 40 | "VALID_METRICS", 41 | "VALID_METRICS_SPARSE", 42 | ] 43 | -------------------------------------------------------------------------------- /sklearn/neighbors/_partition_nodes.pxd: -------------------------------------------------------------------------------- 1 | from cython cimport floating 2 | from ..utils._typedefs cimport float64_t, intp_t 3 | 4 | cdef int partition_node_indices( 5 | const floating *data, 6 | intp_t *node_indices, 7 | intp_t split_dim, 8 | intp_t split_index, 9 | intp_t n_features, 10 | intp_t n_points) except -1 11 | -------------------------------------------------------------------------------- /sklearn/neighbors/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/neighbors/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/neural_network/__init__.py: -------------------------------------------------------------------------------- 1 | """Models based on neural networks.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._multilayer_perceptron import MLPClassifier, MLPRegressor 7 | from ._rbm import BernoulliRBM 8 | 9 | __all__ = ["BernoulliRBM", "MLPClassifier", "MLPRegressor"] 10 | -------------------------------------------------------------------------------- /sklearn/neural_network/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/neural_network/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/neural_network/tests/test_base.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from sklearn.neural_network._base import binary_log_loss, log_loss 5 | 6 | 7 | def test_binary_log_loss_1_prob_finite(): 8 | # y_proba is equal to one should result in a finite logloss 9 | y_true = np.array([[0, 0, 1]]).T 10 | y_prob = np.array([[0.9, 1.0, 1.0]]).T 11 | 12 | loss = binary_log_loss(y_true, y_prob) 13 | assert np.isfinite(loss) 14 | 15 | 16 | @pytest.mark.parametrize( 17 | "y_true, y_prob", 18 | [ 19 | ( 20 | np.array([[1, 0, 0], [0, 1, 0]]), 21 | np.array([[0.0, 1.0, 0.0], [0.9, 0.05, 0.05]]), 22 | ), 23 | (np.array([[0, 0, 1]]).T, np.array([[0.9, 1.0, 1.0]]).T), 24 | ], 25 | ) 26 | def test_log_loss_1_prob_finite(y_true, y_prob): 27 | # y_proba is equal to 1 should result in a finite logloss 28 | loss = log_loss(y_true, y_prob) 29 | assert np.isfinite(loss) 30 | -------------------------------------------------------------------------------- /sklearn/preprocessing/meson.build: -------------------------------------------------------------------------------- 1 | py.extension_module( 2 | '_csr_polynomial_expansion', 3 | ['_csr_polynomial_expansion.pyx', utils_cython_tree], 4 | cython_args: cython_args, 5 | subdir: 'sklearn/preprocessing', 6 | install: true 7 | ) 8 | 9 | py.extension_module( 10 | '_target_encoder_fast', 11 | ['_target_encoder_fast.pyx', utils_cython_tree], 12 | override_options: ['cython_language=cpp'], 13 | cython_args: cython_args, 14 | subdir: 'sklearn/preprocessing', 15 | install: true 16 | ) 17 | -------------------------------------------------------------------------------- /sklearn/preprocessing/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/preprocessing/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/semi_supervised/__init__.py: -------------------------------------------------------------------------------- 1 | """Semi-supervised learning algorithms. 2 | 3 | These algorithms utilize small amounts of labeled data and large amounts of unlabeled 4 | data for classification tasks. 5 | """ 6 | 7 | # Authors: The scikit-learn developers 8 | # SPDX-License-Identifier: BSD-3-Clause 9 | 10 | from ._label_propagation import LabelPropagation, LabelSpreading 11 | from ._self_training import SelfTrainingClassifier 12 | 13 | __all__ = ["SelfTrainingClassifier", "LabelPropagation", "LabelSpreading"] 14 | -------------------------------------------------------------------------------- /sklearn/semi_supervised/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/semi_supervised/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/svm/__init__.py: -------------------------------------------------------------------------------- 1 | """Support vector machine algorithms.""" 2 | 3 | # See http://scikit-learn.sourceforge.net/modules/svm.html for complete 4 | # documentation. 5 | 6 | # Authors: The scikit-learn developers 7 | # SPDX-License-Identifier: BSD-3-Clause 8 | 9 | from ._bounds import l1_min_c 10 | from ._classes import SVC, SVR, LinearSVC, LinearSVR, NuSVC, NuSVR, OneClassSVM 11 | 12 | __all__ = [ 13 | "LinearSVC", 14 | "LinearSVR", 15 | "NuSVC", 16 | "NuSVR", 17 | "OneClassSVM", 18 | "SVC", 19 | "SVR", 20 | "l1_min_c", 21 | ] 22 | -------------------------------------------------------------------------------- /sklearn/svm/_newrand.pyx: -------------------------------------------------------------------------------- 1 | """Wrapper for newrand.h""" 2 | 3 | cdef extern from "newrand.h": 4 | void set_seed(unsigned int) 5 | unsigned int bounded_rand_int(unsigned int) 6 | 7 | 8 | def set_seed_wrap(unsigned int custom_seed): 9 | set_seed(custom_seed) 10 | 11 | 12 | def bounded_rand_int_wrap(unsigned int range_): 13 | return bounded_rand_int(range_) 14 | -------------------------------------------------------------------------------- /sklearn/svm/meson.build: -------------------------------------------------------------------------------- 1 | newrand_include = include_directories('src/newrand') 2 | libsvm_include = include_directories('src/libsvm') 3 | liblinear_include = include_directories('src/liblinear') 4 | 5 | _newrand = py.extension_module( 6 | '_newrand', 7 | '_newrand.pyx', 8 | override_options: ['cython_language=cpp'], 9 | include_directories: [newrand_include], 10 | cython_args: cython_args, 11 | subdir: 'sklearn/svm', 12 | install: true 13 | ) 14 | 15 | libsvm_skl = static_library( 16 | 'libsvm-skl', 17 | ['src/libsvm/libsvm_template.cpp'], 18 | ) 19 | 20 | py.extension_module( 21 | '_libsvm', 22 | ['_libsvm.pyx', utils_cython_tree], 23 | include_directories: [newrand_include, libsvm_include], 24 | link_with: libsvm_skl, 25 | cython_args: cython_args, 26 | subdir: 'sklearn/svm', 27 | install: true 28 | ) 29 | 30 | py.extension_module( 31 | '_libsvm_sparse', 32 | ['_libsvm_sparse.pyx', utils_cython_tree], 33 | include_directories: [newrand_include, libsvm_include], 34 | link_with: libsvm_skl, 35 | cython_args: cython_args, 36 | subdir: 'sklearn/svm', 37 | install: true 38 | ) 39 | 40 | liblinear_skl = static_library( 41 | 'liblinear-skl', 42 | ['src/liblinear/linear.cpp', 'src/liblinear/tron.cpp'], 43 | ) 44 | 45 | py.extension_module( 46 | '_liblinear', 47 | ['_liblinear.pyx', utils_cython_tree], 48 | include_directories: [newrand_include, liblinear_include], 49 | link_with: [liblinear_skl], 50 | cython_args: cython_args, 51 | subdir: 'sklearn/svm', 52 | install: true 53 | ) 54 | -------------------------------------------------------------------------------- /sklearn/svm/src/liblinear/_cython_blas_helpers.h: -------------------------------------------------------------------------------- 1 | #ifndef _CYTHON_BLAS_HELPERS_H 2 | #define _CYTHON_BLAS_HELPERS_H 3 | 4 | typedef double (*dot_func)(int, const double*, int, const double*, int); 5 | typedef void (*axpy_func)(int, double, const double*, int, double*, int); 6 | typedef void (*scal_func)(int, double, const double*, int); 7 | typedef double (*nrm2_func)(int, const double*, int); 8 | 9 | typedef struct BlasFunctions{ 10 | dot_func dot; 11 | axpy_func axpy; 12 | scal_func scal; 13 | nrm2_func nrm2; 14 | } BlasFunctions; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /sklearn/svm/src/liblinear/tron.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRON_H 2 | #define _TRON_H 3 | 4 | #include "_cython_blas_helpers.h" 5 | 6 | class function 7 | { 8 | public: 9 | virtual double fun(double *w) = 0 ; 10 | virtual void grad(double *w, double *g) = 0 ; 11 | virtual void Hv(double *s, double *Hs) = 0 ; 12 | 13 | virtual int get_nr_variable(void) = 0 ; 14 | virtual ~function(void){} 15 | }; 16 | 17 | class TRON 18 | { 19 | public: 20 | TRON(const function *fun_obj, double eps = 0.1, int max_iter = 1000, BlasFunctions *blas = 0); 21 | ~TRON(); 22 | 23 | int tron(double *w); 24 | void set_print_string(void (*i_print) (const char *buf)); 25 | 26 | private: 27 | int trcg(double delta, double *g, double *s, double *r); 28 | double norm_inf(int n, double *x); 29 | 30 | double eps; 31 | int max_iter; 32 | function *fun_obj; 33 | BlasFunctions *blas; 34 | void info(const char *fmt,...); 35 | void (*tron_print_string)(const char *buf); 36 | }; 37 | #endif 38 | -------------------------------------------------------------------------------- /sklearn/svm/src/libsvm/LIBSVM_CHANGES: -------------------------------------------------------------------------------- 1 | Changes to Libsvm 2 | 3 | This is here mainly as checklist for incorporation of new versions of libsvm. 4 | 5 | * Add copyright to files svm.cpp and svm.h 6 | * Add random_seed support and call to srand in fit function 7 | * Improved random number generator (fix on windows, enhancement on other 8 | platforms). See 9 | * invoke scipy blas api for svm kernel function to improve performance with speedup rate of 1.5X to 2X for dense data only. See 10 | * Expose the number of iterations run in optimization. See 11 | The changes made with respect to upstream are detailed in the heading of svm.cpp 12 | -------------------------------------------------------------------------------- /sklearn/svm/src/libsvm/_svm_cython_blas_helpers.h: -------------------------------------------------------------------------------- 1 | #ifndef _SVM_CYTHON_BLAS_HELPERS_H 2 | #define _SVM_CYTHON_BLAS_HELPERS_H 3 | 4 | typedef double (*dot_func)(int, const double*, int, const double*, int); 5 | typedef struct BlasFunctions{ 6 | dot_func dot; 7 | } BlasFunctions; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /sklearn/svm/src/libsvm/libsvm_template.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* this is a hack to generate libsvm with both sparse and dense 3 | methods in the same binary*/ 4 | 5 | #define _DENSE_REP 6 | #include "svm.cpp" 7 | #undef _DENSE_REP 8 | #include "svm.cpp" 9 | -------------------------------------------------------------------------------- /sklearn/svm/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/svm/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/tests/test_build.py: -------------------------------------------------------------------------------- 1 | import os 2 | import textwrap 3 | 4 | import pytest 5 | 6 | from sklearn import __version__ 7 | from sklearn.utils._openmp_helpers import _openmp_parallelism_enabled 8 | 9 | 10 | def test_openmp_parallelism_enabled(): 11 | # Check that sklearn is built with OpenMP-based parallelism enabled. 12 | # This test can be skipped by setting the environment variable 13 | # ``SKLEARN_SKIP_OPENMP_TEST``. 14 | if os.getenv("SKLEARN_SKIP_OPENMP_TEST"): 15 | pytest.skip("test explicitly skipped (SKLEARN_SKIP_OPENMP_TEST)") 16 | 17 | base_url = "dev" if __version__.endswith(".dev0") else "stable" 18 | err_msg = textwrap.dedent( 19 | """ 20 | This test fails because scikit-learn has been built without OpenMP. 21 | This is not recommended since some estimators will run in sequential 22 | mode instead of leveraging thread-based parallelism. 23 | 24 | You can find instructions to build scikit-learn with OpenMP at this 25 | address: 26 | 27 | https://scikit-learn.org/{}/developers/advanced_installation.html 28 | 29 | You can skip this test by setting the environment variable 30 | SKLEARN_SKIP_OPENMP_TEST to any value. 31 | """ 32 | ).format(base_url) 33 | 34 | assert _openmp_parallelism_enabled(), err_msg 35 | -------------------------------------------------------------------------------- /sklearn/tests/test_check_build.py: -------------------------------------------------------------------------------- 1 | """ 2 | Smoke Test the check_build module 3 | """ 4 | 5 | # Authors: The scikit-learn developers 6 | # SPDX-License-Identifier: BSD-3-Clause 7 | 8 | import pytest 9 | 10 | from sklearn.__check_build import raise_build_error 11 | 12 | 13 | def test_raise_build_error(): 14 | with pytest.raises(ImportError): 15 | raise_build_error(ImportError()) 16 | -------------------------------------------------------------------------------- /sklearn/tests/test_init.py: -------------------------------------------------------------------------------- 1 | # Basic unittests to test functioning of module's top-level 2 | 3 | 4 | __author__ = "Yaroslav Halchenko" 5 | __license__ = "BSD" 6 | 7 | 8 | try: 9 | from sklearn import * # noqa 10 | 11 | _top_import_error = None 12 | except Exception as e: 13 | _top_import_error = e 14 | 15 | 16 | def test_import_skl(): 17 | # Test either above import has failed for some reason 18 | # "import *" is discouraged outside of the module level, hence we 19 | # rely on setting up the variable above 20 | assert _top_import_error is None 21 | -------------------------------------------------------------------------------- /sklearn/tree/__init__.py: -------------------------------------------------------------------------------- 1 | """Decision tree based models for classification and regression.""" 2 | 3 | # Authors: The scikit-learn developers 4 | # SPDX-License-Identifier: BSD-3-Clause 5 | 6 | from ._classes import ( 7 | BaseDecisionTree, 8 | DecisionTreeClassifier, 9 | DecisionTreeRegressor, 10 | ExtraTreeClassifier, 11 | ExtraTreeRegressor, 12 | ) 13 | from ._export import export_graphviz, export_text, plot_tree 14 | 15 | __all__ = [ 16 | "BaseDecisionTree", 17 | "DecisionTreeClassifier", 18 | "DecisionTreeRegressor", 19 | "ExtraTreeClassifier", 20 | "ExtraTreeRegressor", 21 | "export_graphviz", 22 | "plot_tree", 23 | "export_text", 24 | ] 25 | -------------------------------------------------------------------------------- /sklearn/tree/meson.build: -------------------------------------------------------------------------------- 1 | tree_extension_metadata = { 2 | '_tree': 3 | {'sources': ['_tree.pyx'], 4 | 'override_options': ['cython_language=cpp', 'optimization=3']}, 5 | '_splitter': 6 | {'sources': ['_splitter.pyx'], 7 | 'override_options': ['optimization=3']}, 8 | '_partitioner': 9 | {'sources': ['_partitioner.pyx'], 10 | 'override_options': ['optimization=3']}, 11 | '_criterion': 12 | {'sources': ['_criterion.pyx'], 13 | 'override_options': ['optimization=3']}, 14 | '_utils': 15 | {'sources': ['_utils.pyx'], 16 | 'override_options': ['optimization=3']}, 17 | } 18 | 19 | foreach ext_name, ext_dict : tree_extension_metadata 20 | py.extension_module( 21 | ext_name, 22 | [ext_dict.get('sources'), utils_cython_tree], 23 | dependencies: [np_dep], 24 | override_options : ext_dict.get('override_options', []), 25 | cython_args: cython_args, 26 | subdir: 'sklearn/tree', 27 | install: true 28 | ) 29 | endforeach 30 | -------------------------------------------------------------------------------- /sklearn/tree/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/tree/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/utils/_arpack.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | from .validation import check_random_state 5 | 6 | 7 | def _init_arpack_v0(size, random_state): 8 | """Initialize the starting vector for iteration in ARPACK functions. 9 | 10 | Initialize a ndarray with values sampled from the uniform distribution on 11 | [-1, 1]. This initialization model has been chosen to be consistent with 12 | the ARPACK one as another initialization can lead to convergence issues. 13 | 14 | Parameters 15 | ---------- 16 | size : int 17 | The size of the eigenvalue vector to be initialized. 18 | 19 | random_state : int, RandomState instance or None, default=None 20 | The seed of the pseudo random number generator used to generate a 21 | uniform distribution. If int, random_state is the seed used by the 22 | random number generator; If RandomState instance, random_state is the 23 | random number generator; If None, the random number generator is the 24 | RandomState instance used by `np.random`. 25 | 26 | Returns 27 | ------- 28 | v0 : ndarray of shape (size,) 29 | The initialized vector. 30 | """ 31 | random_state = check_random_state(random_state) 32 | v0 = random_state.uniform(-1, 1, size) 33 | return v0 34 | -------------------------------------------------------------------------------- /sklearn/utils/_fast_dict.pxd: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | """ 5 | Uses C++ map containers for fast dict-like behavior with keys being 6 | integers, and values float. 7 | """ 8 | 9 | from libcpp.map cimport map as cpp_map 10 | 11 | from ._typedefs cimport float64_t, intp_t 12 | 13 | 14 | ############################################################################### 15 | # An object to be used in Python 16 | 17 | cdef class IntFloatDict: 18 | cdef cpp_map[intp_t, float64_t] my_map 19 | cdef _to_arrays(self, intp_t [:] keys, float64_t [:] values) 20 | -------------------------------------------------------------------------------- /sklearn/utils/_heap.pxd: -------------------------------------------------------------------------------- 1 | # Heap routines, used in various Cython implementations. 2 | 3 | from cython cimport floating 4 | 5 | from ._typedefs cimport intp_t 6 | 7 | 8 | cdef int heap_push( 9 | floating* values, 10 | intp_t* indices, 11 | intp_t size, 12 | floating val, 13 | intp_t val_idx, 14 | ) noexcept nogil 15 | -------------------------------------------------------------------------------- /sklearn/utils/_joblib.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | # TODO(1.7): remove this file 5 | 6 | import warnings as _warnings 7 | 8 | with _warnings.catch_warnings(): 9 | _warnings.simplefilter("ignore") 10 | # joblib imports may raise DeprecationWarning on certain Python 11 | # versions 12 | import joblib 13 | from joblib import ( 14 | Memory, 15 | Parallel, 16 | __version__, 17 | cpu_count, 18 | delayed, 19 | dump, 20 | effective_n_jobs, 21 | hash, 22 | load, 23 | logger, 24 | parallel_backend, 25 | register_parallel_backend, 26 | ) 27 | 28 | 29 | __all__ = [ 30 | "parallel_backend", 31 | "register_parallel_backend", 32 | "cpu_count", 33 | "Parallel", 34 | "Memory", 35 | "delayed", 36 | "effective_n_jobs", 37 | "hash", 38 | "logger", 39 | "dump", 40 | "load", 41 | "joblib", 42 | "__version__", 43 | ] 44 | -------------------------------------------------------------------------------- /sklearn/utils/_openmp_helpers.pxd: -------------------------------------------------------------------------------- 1 | # Helpers to safely access OpenMP routines 2 | # 3 | # no-op implementations are provided for the case where OpenMP is not available. 4 | # 5 | # All calls to OpenMP routines should be cimported from this module. 6 | 7 | cdef extern from *: 8 | """ 9 | #ifdef _OPENMP 10 | #include 11 | #define SKLEARN_OPENMP_PARALLELISM_ENABLED 1 12 | #else 13 | #define SKLEARN_OPENMP_PARALLELISM_ENABLED 0 14 | #define omp_lock_t int 15 | #define omp_init_lock(l) (void)0 16 | #define omp_destroy_lock(l) (void)0 17 | #define omp_set_lock(l) (void)0 18 | #define omp_unset_lock(l) (void)0 19 | #define omp_get_thread_num() 0 20 | #define omp_get_max_threads() 1 21 | #endif 22 | """ 23 | bint SKLEARN_OPENMP_PARALLELISM_ENABLED 24 | 25 | ctypedef struct omp_lock_t: 26 | pass 27 | 28 | void omp_init_lock(omp_lock_t*) noexcept nogil 29 | void omp_destroy_lock(omp_lock_t*) noexcept nogil 30 | void omp_set_lock(omp_lock_t*) noexcept nogil 31 | void omp_unset_lock(omp_lock_t*) noexcept nogil 32 | int omp_get_thread_num() noexcept nogil 33 | int omp_get_max_threads() noexcept nogil 34 | -------------------------------------------------------------------------------- /sklearn/utils/_optional_dependencies.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | def check_matplotlib_support(caller_name): 6 | """Raise ImportError with detailed error message if mpl is not installed. 7 | 8 | Plot utilities like any of the Display's plotting functions should lazily import 9 | matplotlib and call this helper before any computation. 10 | 11 | Parameters 12 | ---------- 13 | caller_name : str 14 | The name of the caller that requires matplotlib. 15 | """ 16 | try: 17 | import matplotlib # noqa 18 | except ImportError as e: 19 | raise ImportError( 20 | "{} requires matplotlib. You can install matplotlib with " 21 | "`pip install matplotlib`".format(caller_name) 22 | ) from e 23 | 24 | 25 | def check_pandas_support(caller_name): 26 | """Raise ImportError with detailed error message if pandas is not installed. 27 | 28 | Plot utilities like :func:`fetch_openml` should lazily import 29 | pandas and call this helper before any computation. 30 | 31 | Parameters 32 | ---------- 33 | caller_name : str 34 | The name of the caller that requires pandas. 35 | 36 | Returns 37 | ------- 38 | pandas 39 | The pandas package. 40 | """ 41 | try: 42 | import pandas # noqa 43 | 44 | return pandas 45 | except ImportError as e: 46 | raise ImportError("{} requires pandas.".format(caller_name)) from e 47 | -------------------------------------------------------------------------------- /sklearn/utils/_random.pxd: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | from ._typedefs cimport uint32_t 5 | 6 | 7 | cdef inline uint32_t DEFAULT_SEED = 1 8 | 9 | cdef enum: 10 | # Max value for our rand_r replacement (near the bottom). 11 | # We don't use RAND_MAX because it's different across platforms and 12 | # particularly tiny on Windows/MSVC. 13 | # It corresponds to the maximum representable value for 14 | # 32-bit signed integers (i.e. 2^31 - 1). 15 | RAND_R_MAX = 2147483647 16 | 17 | 18 | # rand_r replacement using a 32bit XorShift generator 19 | # See http://www.jstatsoft.org/v08/i14/paper for details 20 | cdef inline uint32_t our_rand_r(uint32_t* seed) nogil: 21 | """Generate a pseudo-random np.uint32 from a np.uint32 seed""" 22 | # seed shouldn't ever be 0. 23 | if (seed[0] == 0): 24 | seed[0] = DEFAULT_SEED 25 | 26 | seed[0] ^= (seed[0] << 13) 27 | seed[0] ^= (seed[0] >> 17) 28 | seed[0] ^= (seed[0] << 5) 29 | 30 | # Use the modulo to make sure that we don't return a values greater than the 31 | # maximum representable value for signed 32bit integers (i.e. 2^31 - 1). 32 | # Note that the parenthesis are needed to avoid overflow: here 33 | # RAND_R_MAX is cast to uint32_t before 1 is added. 34 | return seed[0] % ((RAND_R_MAX) + 1) 35 | -------------------------------------------------------------------------------- /sklearn/utils/_sorting.pxd: -------------------------------------------------------------------------------- 1 | from ._typedefs cimport intp_t 2 | 3 | from cython cimport floating 4 | 5 | cdef int simultaneous_sort( 6 | floating *dist, 7 | intp_t *idx, 8 | intp_t size, 9 | ) noexcept nogil 10 | -------------------------------------------------------------------------------- /sklearn/utils/_test_common/__init__.py: -------------------------------------------------------------------------------- 1 | # Authors: The scikit-learn developers 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /sklearn/utils/_typedefs.pyx: -------------------------------------------------------------------------------- 1 | # _typedefs is a declaration only module 2 | # 3 | # The functions implemented here are for testing purpose only. 4 | 5 | 6 | import numpy as np 7 | 8 | 9 | ctypedef fused testing_type_t: 10 | float32_t 11 | float64_t 12 | int8_t 13 | int32_t 14 | int64_t 15 | intp_t 16 | uint8_t 17 | uint32_t 18 | uint64_t 19 | 20 | 21 | def testing_make_array_from_typed_val(testing_type_t val): 22 | cdef testing_type_t[:] val_view = &val 23 | return np.asarray(val_view) 24 | -------------------------------------------------------------------------------- /sklearn/utils/_vector_sentinel.pxd: -------------------------------------------------------------------------------- 1 | cimport numpy as cnp 2 | 3 | from libcpp.vector cimport vector 4 | from ..utils._typedefs cimport intp_t, float64_t, int32_t, int64_t 5 | 6 | ctypedef fused vector_typed: 7 | vector[float64_t] 8 | vector[intp_t] 9 | vector[int32_t] 10 | vector[int64_t] 11 | 12 | cdef cnp.ndarray vector_to_nd_array(vector_typed * vect_ptr) 13 | -------------------------------------------------------------------------------- /sklearn/utils/metadata_routing.py: -------------------------------------------------------------------------------- 1 | """Utilities to route metadata within scikit-learn estimators.""" 2 | 3 | # This module is not a separate sub-folder since that would result in a circular 4 | # import issue. 5 | # 6 | # Authors: The scikit-learn developers 7 | # SPDX-License-Identifier: BSD-3-Clause 8 | 9 | from ._metadata_requests import WARN, UNUSED, UNCHANGED # noqa 10 | from ._metadata_requests import get_routing_for_object # noqa 11 | from ._metadata_requests import MetadataRouter # noqa 12 | from ._metadata_requests import MetadataRequest # noqa 13 | from ._metadata_requests import MethodMapping # noqa 14 | from ._metadata_requests import process_routing # noqa 15 | from ._metadata_requests import _MetadataRequester # noqa 16 | from ._metadata_requests import _routing_enabled # noqa 17 | from ._metadata_requests import _raise_for_params # noqa 18 | from ._metadata_requests import _RoutingNotSupportedMixin # noqa 19 | from ._metadata_requests import _raise_for_unsupported_routing # noqa 20 | -------------------------------------------------------------------------------- /sklearn/utils/murmurhash.pxd: -------------------------------------------------------------------------------- 1 | """Export fast murmurhash C/C++ routines + cython wrappers""" 2 | 3 | from ..utils._typedefs cimport int32_t, uint32_t 4 | 5 | # The C API is disabled for now, since it requires -I flags to get 6 | # compilation to work even when these functions are not used. 7 | # cdef extern from "MurmurHash3.h": 8 | # void MurmurHash3_x86_32(void* key, int len, unsigned int seed, 9 | # void* out) 10 | # 11 | # void MurmurHash3_x86_128(void* key, int len, unsigned int seed, 12 | # void* out) 13 | # 14 | # void MurmurHash3_x64_128(void* key, int len, unsigned int seed, 15 | # void* out) 16 | 17 | 18 | cpdef uint32_t murmurhash3_int_u32(int key, unsigned int seed) 19 | cpdef int32_t murmurhash3_int_s32(int key, unsigned int seed) 20 | cpdef uint32_t murmurhash3_bytes_u32(bytes key, unsigned int seed) 21 | cpdef int32_t murmurhash3_bytes_s32(bytes key, unsigned int seed) 22 | -------------------------------------------------------------------------------- /sklearn/utils/src/MurmurHash3.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // MurmurHash3 was written by Austin Appleby, and is placed in the public 3 | // domain. The author hereby disclaims copyright to this source code. 4 | 5 | #ifndef _MURMURHASH3_H_ 6 | #define _MURMURHASH3_H_ 7 | 8 | //----------------------------------------------------------------------------- 9 | // Platform-specific functions and macros 10 | 11 | // Microsoft Visual Studio 12 | 13 | #if defined(_MSC_VER) 14 | 15 | typedef unsigned char uint8_t; 16 | typedef unsigned long uint32_t; 17 | typedef unsigned __int64 uint64_t; 18 | 19 | // Other compilers 20 | 21 | #else // defined(_MSC_VER) 22 | 23 | #include 24 | 25 | #endif // !defined(_MSC_VER) 26 | 27 | //----------------------------------------------------------------------------- 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | 33 | void MurmurHash3_x86_32 ( const void * key, int len, uint32_t seed, void * out ); 34 | 35 | void MurmurHash3_x86_128 ( const void * key, int len, uint32_t seed, void * out ); 36 | 37 | void MurmurHash3_x64_128 ( const void * key, int len, uint32_t seed, void * out ); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | //----------------------------------------------------------------------------- 44 | 45 | #endif // _MURMURHASH3_H_ 46 | -------------------------------------------------------------------------------- /sklearn/utils/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakevdp/scikit-learn/ebc1276e7b859c84de60bebf9e2a5871ed205f0d/sklearn/utils/tests/__init__.py -------------------------------------------------------------------------------- /sklearn/utils/tests/test_arpack.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from numpy.testing import assert_allclose 3 | 4 | from sklearn.utils import check_random_state 5 | from sklearn.utils._arpack import _init_arpack_v0 6 | 7 | 8 | @pytest.mark.parametrize("seed", range(100)) 9 | def test_init_arpack_v0(seed): 10 | # check that the initialization a sampling from an uniform distribution 11 | # where we can fix the random state 12 | size = 1000 13 | v0 = _init_arpack_v0(size, seed) 14 | 15 | rng = check_random_state(seed) 16 | assert_allclose(v0, rng.uniform(-1, 1, size=size)) 17 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_arrayfuncs.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from sklearn.utils._testing import assert_allclose 5 | from sklearn.utils.arrayfuncs import _all_with_any_reduction_axis_1, min_pos 6 | 7 | 8 | def test_min_pos(): 9 | # Check that min_pos returns a positive value and that it's consistent 10 | # between float and double 11 | X = np.random.RandomState(0).randn(100) 12 | 13 | min_double = min_pos(X) 14 | min_float = min_pos(X.astype(np.float32)) 15 | 16 | assert_allclose(min_double, min_float) 17 | assert min_double >= 0 18 | 19 | 20 | @pytest.mark.parametrize("dtype", [np.float32, np.float64]) 21 | def test_min_pos_no_positive(dtype): 22 | # Check that the return value of min_pos is the maximum representable 23 | # value of the input dtype when all input elements are <= 0 (#19328) 24 | X = np.full(100, -1.0).astype(dtype, copy=False) 25 | 26 | assert min_pos(X) == np.finfo(dtype).max 27 | 28 | 29 | @pytest.mark.parametrize( 30 | "dtype", [np.int16, np.int32, np.int64, np.float32, np.float64] 31 | ) 32 | @pytest.mark.parametrize("value", [0, 1.5, -1]) 33 | def test_all_with_any_reduction_axis_1(dtype, value): 34 | # Check that return value is False when there is no row equal to `value` 35 | X = np.arange(12, dtype=dtype).reshape(3, 4) 36 | assert not _all_with_any_reduction_axis_1(X, value=value) 37 | 38 | # Make a row equal to `value` 39 | X[1, :] = value 40 | assert _all_with_any_reduction_axis_1(X, value=value) 41 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_bunch.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | import numpy as np 4 | import pytest 5 | 6 | from sklearn.utils import Bunch 7 | 8 | 9 | def test_bunch_attribute_deprecation(): 10 | """Check that bunch raises deprecation message with `__getattr__`.""" 11 | bunch = Bunch() 12 | values = np.asarray([1, 2, 3]) 13 | msg = ( 14 | "Key: 'values', is deprecated in 1.3 and will be " 15 | "removed in 1.5. Please use 'grid_values' instead" 16 | ) 17 | bunch._set_deprecated( 18 | values, new_key="grid_values", deprecated_key="values", warning_message=msg 19 | ) 20 | 21 | with warnings.catch_warnings(): 22 | # Does not warn for "grid_values" 23 | warnings.simplefilter("error") 24 | v = bunch["grid_values"] 25 | 26 | assert v is values 27 | 28 | with pytest.warns(FutureWarning, match=msg): 29 | # Warns for "values" 30 | v = bunch["values"] 31 | 32 | assert v is values 33 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_mask.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from sklearn.utils._mask import safe_mask 4 | from sklearn.utils.fixes import CSR_CONTAINERS 5 | from sklearn.utils.validation import check_random_state 6 | 7 | 8 | @pytest.mark.parametrize("csr_container", CSR_CONTAINERS) 9 | def test_safe_mask(csr_container): 10 | random_state = check_random_state(0) 11 | X = random_state.rand(5, 4) 12 | X_csr = csr_container(X) 13 | mask = [False, False, True, True, True] 14 | 15 | mask = safe_mask(X, mask) 16 | assert X[mask].shape[0] == 3 17 | 18 | mask = safe_mask(X_csr, mask) 19 | assert X_csr[mask].shape[0] == 3 20 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_missing.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from sklearn.utils._missing import is_scalar_nan 5 | 6 | 7 | @pytest.mark.parametrize( 8 | "value, result", 9 | [ 10 | (float("nan"), True), 11 | (np.nan, True), 12 | (float(np.nan), True), 13 | (np.float32(np.nan), True), 14 | (np.float64(np.nan), True), 15 | (0, False), 16 | (0.0, False), 17 | (None, False), 18 | ("", False), 19 | ("nan", False), 20 | ([np.nan], False), 21 | (9867966753463435747313673, False), # Python int that overflows with C type 22 | ], 23 | ) 24 | def test_is_scalar_nan(value, result): 25 | assert is_scalar_nan(value) is result 26 | # make sure that we are returning a Python bool 27 | assert isinstance(is_scalar_nan(value), bool) 28 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_show_versions.py: -------------------------------------------------------------------------------- 1 | from threadpoolctl import threadpool_info 2 | 3 | from sklearn.utils._show_versions import _get_deps_info, _get_sys_info, show_versions 4 | from sklearn.utils._testing import ignore_warnings 5 | 6 | 7 | def test_get_sys_info(): 8 | sys_info = _get_sys_info() 9 | 10 | assert "python" in sys_info 11 | assert "executable" in sys_info 12 | assert "machine" in sys_info 13 | 14 | 15 | def test_get_deps_info(): 16 | with ignore_warnings(): 17 | deps_info = _get_deps_info() 18 | 19 | assert "pip" in deps_info 20 | assert "setuptools" in deps_info 21 | assert "sklearn" in deps_info 22 | assert "numpy" in deps_info 23 | assert "scipy" in deps_info 24 | assert "Cython" in deps_info 25 | assert "pandas" in deps_info 26 | assert "matplotlib" in deps_info 27 | assert "joblib" in deps_info 28 | 29 | 30 | def test_show_versions(capsys): 31 | with ignore_warnings(): 32 | show_versions() 33 | out, err = capsys.readouterr() 34 | 35 | assert "python" in out 36 | assert "numpy" in out 37 | 38 | info = threadpool_info() 39 | if info: 40 | assert "threadpoolctl info:" in out 41 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_typedefs.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from sklearn.utils._typedefs import testing_make_array_from_typed_val 5 | 6 | 7 | @pytest.mark.parametrize( 8 | "type_t, value, expected_dtype", 9 | [ 10 | ("float64_t", 1.0, np.float64), 11 | ("float32_t", 1.0, np.float32), 12 | ("intp_t", 1, np.intp), 13 | ("int8_t", 1, np.int8), 14 | ("int32_t", 1, np.int32), 15 | ("int64_t", 1, np.int64), 16 | ("uint8_t", 1, np.uint8), 17 | ("uint32_t", 1, np.uint32), 18 | ("uint64_t", 1, np.uint64), 19 | ], 20 | ) 21 | def test_types(type_t, value, expected_dtype): 22 | """Check that the types defined in _typedefs correspond to the expected 23 | numpy dtypes. 24 | """ 25 | assert testing_make_array_from_typed_val[type_t](value).dtype == expected_dtype 26 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | import joblib 2 | import pytest 3 | 4 | from sklearn.utils import parallel_backend, register_parallel_backend, tosequence 5 | 6 | 7 | # TODO(1.7): remove 8 | def test_is_pypy_deprecated(): 9 | with pytest.warns(FutureWarning, match="IS_PYPY is deprecated"): 10 | from sklearn.utils import IS_PYPY # noqa 11 | 12 | 13 | # TODO(1.7): remove 14 | def test_tosequence_deprecated(): 15 | with pytest.warns(FutureWarning, match="tosequence was deprecated in 1.5"): 16 | tosequence([1, 2, 3]) 17 | 18 | 19 | # TODO(1.7): remove 20 | def test_parallel_backend_deprecated(): 21 | with pytest.warns(FutureWarning, match="parallel_backend is deprecated"): 22 | parallel_backend("loky", None) 23 | 24 | with pytest.warns(FutureWarning, match="register_parallel_backend is deprecated"): 25 | register_parallel_backend("a_backend", None) 26 | 27 | del joblib.parallel.BACKENDS["a_backend"] 28 | -------------------------------------------------------------------------------- /sklearn/utils/tests/test_weight_vector.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from sklearn.utils._weight_vector import ( 5 | WeightVector32, 6 | WeightVector64, 7 | ) 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "dtype, WeightVector", 12 | [ 13 | (np.float32, WeightVector32), 14 | (np.float64, WeightVector64), 15 | ], 16 | ) 17 | def test_type_invariance(dtype, WeightVector): 18 | """Check the `dtype` consistency of `WeightVector`.""" 19 | weights = np.random.rand(100).astype(dtype) 20 | average_weights = np.random.rand(100).astype(dtype) 21 | 22 | weight_vector = WeightVector(weights, average_weights) 23 | 24 | assert np.asarray(weight_vector.w).dtype is np.dtype(dtype) 25 | assert np.asarray(weight_vector.aw).dtype is np.dtype(dtype) 26 | --------------------------------------------------------------------------------