repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_theil_sen.py
sklearn/linear_model/tests/test_theil_sen.py
""" Testing for Theil-Sen module (sklearn.linear_model.theil_sen) """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import os import re import sys from contextlib import contextmanager import numpy as np import pytest from numpy.testing import ( assert_array_almost_equal, ass...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/__init__.py
sklearn/linear_model/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_coordinate_descent.py
sklearn/linear_model/tests/test_coordinate_descent.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from copy import deepcopy import joblib import numpy as np import pytest from scipy import interpolate, sparse from sklearn.base import clone, config_context from sklearn.datasets import load_diabetes, make_regression from...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_perceptron.py
sklearn/linear_model/tests/test_perceptron.py
import numpy as np import pytest from sklearn.datasets import load_iris from sklearn.linear_model import Perceptron from sklearn.utils import check_random_state from sklearn.utils._testing import assert_allclose, assert_array_almost_equal from sklearn.utils.fixes import CSR_CONTAINERS iris = load_iris() random_state ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_ransac.py
sklearn/linear_model/tests/test_ransac.py
import numpy as np import pytest from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_regression from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model import ( LinearRegression, OrthogonalMatchingPursuit, RANSACRegressor, Ridge,...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_huber.py
sklearn/linear_model/tests/test_huber.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from scipy import optimize from sklearn.datasets import make_regression from sklearn.linear_model import HuberRegressor, LinearRegression, Ridge, SGDRegressor from sklearn.linear_model._huber import _huber_...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_linear_loss.py
sklearn/linear_model/tests/test_linear_loss.py
""" Tests for LinearModelLoss Note that correctness of losses (which compose LinearModelLoss) is already well covered in the _loss module. """ import numpy as np import pytest from numpy.testing import assert_allclose from scipy import linalg, optimize from sklearn._loss.loss import ( HalfBinomialLoss, HalfM...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_sag.py
sklearn/linear_model/tests/test_sag.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import math import re import numpy as np import pytest from sklearn.base import clone from sklearn.datasets import load_iris, make_blobs, make_classification from sklearn.linear_model import LogisticRegression, Ridge from sklearn.linear_m...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_logistic.py
sklearn/linear_model/tests/test_logistic.py
import itertools import os import re import warnings import numpy as np import pytest from numpy.testing import ( assert_allclose, assert_array_almost_equal, assert_array_equal, ) from scipy import sparse from scipy.linalg import LinAlgWarning, svd from sklearn import config_context from sklearn._loss imp...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_bayes.py
sklearn/linear_model/tests/test_bayes.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from math import log import numpy as np import pytest from sklearn import datasets from sklearn.linear_model import ARDRegression, BayesianRidge, Ridge from sklearn.utils import check_random_state from sklearn.utils._testing import ( ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/tests/test_ridge.py
sklearn/linear_model/tests/test_ridge.py
import warnings from itertools import product import numpy as np import pytest from scipy import linalg from sklearn import config_context, datasets from sklearn.base import clone from sklearn.datasets import ( make_classification, make_low_rank_matrix, make_multilabel_classification, make_regression,...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/_glm/glm.py
sklearn/linear_model/_glm/glm.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause """ Generalized Linear Models with Exponential Dispersion Family """ from numbers import Integral, Real import numpy as np import scipy.optimize from sklearn._loss.loss import ( HalfGammaLoss, HalfPoissonLoss, HalfSquaredErro...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/_glm/_newton_solver.py
sklearn/linear_model/_glm/_newton_solver.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause """ Newton solver for Generalized Linear Models """ import warnings from abc import ABC, abstractmethod import numpy as np import scipy.linalg import scipy.optimize from sklearn._loss.loss import HalfSquaredError from sklearn.exceptions ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/_glm/__init__.py
sklearn/linear_model/_glm/__init__.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.linear_model._glm.glm import ( GammaRegressor, PoissonRegressor, TweedieRegressor, _GeneralizedLinearRegressor, ) __all__ = [ "GammaRegressor", "PoissonRegressor", "TweedieRegressor", "_Generali...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/_glm/tests/__init__.py
sklearn/linear_model/_glm/tests/__init__.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/linear_model/_glm/tests/test_glm.py
sklearn/linear_model/_glm/tests/test_glm.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import warnings from functools import partial import numpy as np import pytest import scipy from scipy import linalg from scipy.optimize import minimize, root from sklearn._loss import HalfBinomialLoss, HalfPoissonLoss, H...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/compose/_target.py
sklearn/compose/_target.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np from sklearn.base import BaseEstimator, RegressorMixin, _fit_context, clone from sklearn.exceptions import NotFittedError from sklearn.linear_model import LinearRegression from sklearn.preprocessing impo...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/compose/_column_transformer.py
sklearn/compose/_column_transformer.py
""" The :mod:`sklearn.compose._column_transformer` module implements utilities to work with heterogeneous data and to apply different transformers to different columns. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from collections import Counter from functools imp...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/compose/__init__.py
sklearn/compose/__init__.py
"""Meta-estimators for building composite models with transformers. In addition to its current contents, this module will eventually be home to refurbished versions of :class:`~sklearn.pipeline.Pipeline` and :class:`~sklearn.pipeline.FeatureUnion`. """ # Authors: The scikit-learn developers # SPDX-License-Identifier:...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/compose/tests/test_target.py
sklearn/compose/tests/test_target.py
import warnings import numpy as np import pytest from sklearn import config_context, datasets from sklearn.base import BaseEstimator, TransformerMixin, clone from sklearn.compose import TransformedTargetRegressor from sklearn.dummy import DummyRegressor from sklearn.linear_model import LinearRegression, OrthogonalMat...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/compose/tests/test_column_transformer.py
sklearn/compose/tests/test_column_transformer.py
""" Test the ColumnTransformer. """ import pickle import re import warnings import joblib import numpy as np import pytest from numpy.testing import assert_allclose from scipy import sparse from sklearn import config_context from sklearn.base import BaseEstimator, TransformerMixin from sklearn.compose import ( C...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/compose/tests/__init__.py
sklearn/compose/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_pd_utils.py
sklearn/inspection/_pd_utils.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause def _check_feature_names(X, feature_names=None): """Check feature names. Parameters ---------- X : array-like of shape (n_samples, n_features) Input data. feature_names : None or array-like of shape (n_names,)...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_partial_dependence.py
sklearn/inspection/_partial_dependence.py
"""Partial dependence plots for regression and classification models.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from collections.abc import Iterable import numpy as np from scipy import sparse from scipy.stats.mstats import mquantiles from sklearn.base import ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_permutation_importance.py
sklearn/inspection/_permutation_importance.py
"""Permutation importance for estimators.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import numpy as np from sklearn.ensemble._bagging import _generate_indices from sklearn.metrics import check_scoring, get_scorer_names from sklearn.model_selection._validation i...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/__init__.py
sklearn/inspection/__init__.py
"""Tools for model inspection.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.inspection._partial_dependence import partial_dependence from sklearn.inspection._permutation_importance import permutation_importance from sklearn.inspection._plot.decision_boundary import De...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_plot/decision_boundary.py
sklearn/inspection/_plot/decision_boundary.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np from sklearn.base import is_regressor from sklearn.preprocessing import LabelEncoder from sklearn.utils import _safe_indexing from sklearn.utils._dataframe import is_pandas_df, is_polars_df from sklearn....
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_plot/partial_dependence.py
sklearn/inspection/_plot/partial_dependence.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers from itertools import chain from math import ceil import numpy as np from scipy import sparse from scipy.stats.mstats import mquantiles from sklearn.base import is_regressor from sklearn.inspection import partial_dependence...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_plot/__init__.py
sklearn/inspection/_plot/__init__.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_plot/tests/test_plot_partial_dependence.py
sklearn/inspection/_plot/tests/test_plot_partial_dependence.py
import numpy as np import pytest from numpy.testing import assert_allclose from scipy.stats.mstats import mquantiles from sklearn.compose import make_column_transformer from sklearn.datasets import ( load_diabetes, load_iris, make_classification, make_regression, ) from sklearn.ensemble import Gradient...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_plot/tests/__init__.py
sklearn/inspection/_plot/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/_plot/tests/test_boundary_decision_display.py
sklearn/inspection/_plot/tests/test_boundary_decision_display.py
import warnings import numpy as np import pytest from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.datasets import ( load_diabetes, load_iris, make_classification, make_multilabel_classification, ) from sklearn.ensemble import IsolationForest from sklearn.inspection import DecisionB...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/tests/test_permutation_importance.py
sklearn/inspection/tests/test_permutation_importance.py
import numpy as np import pytest from joblib import parallel_backend from numpy.testing import assert_allclose from sklearn.compose import ColumnTransformer from sklearn.datasets import ( load_diabetes, load_iris, make_classification, make_regression, ) from sklearn.dummy import DummyClassifier from sk...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/tests/test_partial_dependence.py
sklearn/inspection/tests/test_partial_dependence.py
""" Testing for the partial dependence module. """ import re import warnings import numpy as np import pytest import sklearn from sklearn.base import BaseEstimator, ClassifierMixin, clone, is_regressor from sklearn.cluster import KMeans from sklearn.compose import make_column_transformer from sklearn.datasets import...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/tests/__init__.py
sklearn/inspection/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/inspection/tests/test_pd_utils.py
sklearn/inspection/tests/test_pd_utils.py
import numpy as np import pytest from sklearn.inspection._pd_utils import _check_feature_names, _get_feature_index from sklearn.utils._testing import _convert_container @pytest.mark.parametrize( "feature_names, array_type, expected_feature_names", [ (None, "array", ["x0", "x1", "x2"]), (None,...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_dbscan.py
sklearn/cluster/_dbscan.py
""" DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from scipy import sparse from sklearn.base import BaseEstimator, ClusterMixin, _fit_context...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_mean_shift.py
sklearn/cluster/_mean_shift.py
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_affinity_propagation.py
sklearn/cluster/_affinity_propagation.py
"""Affinity Propagation clustering algorithm.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from sklearn._config import config_context from sklearn.base import BaseEstimator, ClusterMixin, _fit_context from skl...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_kmeans.py
sklearn/cluster/_kmeans.py
"""K-means clustering.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from abc import ABC, abstractmethod from numbers import Integral, Real import numpy as np import scipy.sparse as sp from sklearn.base import ( BaseEstimator, ClassNamePrefixFeaturesOutMix...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_bicluster.py
sklearn/cluster/_bicluster.py
"""Spectral biclustering algorithms.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import ABCMeta, abstractmethod from numbers import Integral import numpy as np from scipy.linalg import norm from scipy.sparse import dia_matrix, issparse from scipy.sparse.linalg import ei...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_bisect_k_means.py
sklearn/cluster/_bisect_k_means.py
"""Bisecting K-means clustering.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np import scipy.sparse as sp from sklearn.base import _fit_context from sklearn.cluster._k_means_common import _inertia_dense, _inertia_sparse from sklearn.cluster._kmea...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_feature_agglomeration.py
sklearn/cluster/_feature_agglomeration.py
""" Feature agglomeration. Base classes and functions for performing feature agglomeration. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from scipy.sparse import issparse from sklearn.base import TransformerMixin from sklearn.utils.validation import check_is_f...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_birch.py
sklearn/cluster/_birch.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from math import sqrt from numbers import Integral, Real import numpy as np from scipy import sparse from sklearn._config import config_context from sklearn.base import ( BaseEstimator, ClassNamePrefixFeaturesOutMi...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_optics.py
sklearn/cluster/_optics.py
"""Ordering Points To Identify the Clustering Structure (OPTICS) These routines execute the OPTICS algorithm, and implement various cluster extraction methods of the ordered list. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real im...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/__init__.py
sklearn/cluster/__init__.py
"""Popular unsupervised clustering algorithms.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.cluster._affinity_propagation import ( AffinityPropagation, affinity_propagation, ) from sklearn.cluster._agglomerative import ( AgglomerativeClustering, Featur...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_agglomerative.py
sklearn/cluster/_agglomerative.py
"""Hierarchical Agglomerative Clustering These routines perform some hierarchical agglomerative clustering of some input data. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from heapq import heapify, heappop, heappush, heappushpop from numbers import Integral, Rea...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_spectral.py
sklearn/cluster/_spectral.py
"""Algorithms for spectral clustering""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from scipy.linalg import LinAlgError, qr, svd from scipy.sparse import csc_matrix from sklearn.base import BaseEstimator, Clus...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_hdbscan/hdbscan.py
sklearn/cluster/_hdbscan/hdbscan.py
""" HDBSCAN: Hierarchical Density-Based Spatial Clustering of Applications with Noise """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_hdbscan/__init__.py
sklearn/cluster/_hdbscan/__init__.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_hdbscan/tests/__init__.py
sklearn/cluster/_hdbscan/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/_hdbscan/tests/test_reachibility.py
sklearn/cluster/_hdbscan/tests/test_reachibility.py
import numpy as np import pytest from sklearn.cluster._hdbscan._reachability import mutual_reachability_graph from sklearn.utils._testing import ( _convert_container, assert_allclose, ) def test_mutual_reachability_graph_error_sparse_format(): """Check that we raise an error if the sparse format is not C...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_bicluster.py
sklearn/cluster/tests/test_bicluster.py
"""Testing for Spectral Biclustering methods""" import numpy as np import pytest from scipy.sparse import issparse from sklearn.base import BaseEstimator, BiclusterMixin, clone from sklearn.cluster import SpectralBiclustering, SpectralCoclustering from sklearn.cluster._bicluster import ( _bistochastic_normalize, ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_hierarchical.py
sklearn/cluster/tests/test_hierarchical.py
""" Several basic tests for hierarchical clustering procedures """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import shutil from functools import partial from tempfile import mkdtemp import numpy as np import pytest from scipy.cluster import hierarchy from scipy....
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_affinity_propagation.py
sklearn/cluster/tests/test_affinity_propagation.py
""" Testing for Clustering methods """ import warnings import numpy as np import pytest from sklearn.cluster import AffinityPropagation, affinity_propagation from sklearn.cluster._affinity_propagation import _equal_similarities_and_preferences from sklearn.datasets import make_blobs from sklearn.exceptions import C...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_dbscan.py
sklearn/cluster/tests/test_dbscan.py
""" Tests for DBSCAN clustering algorithm """ import pickle import warnings import numpy as np import pytest from scipy.spatial import distance from sklearn.cluster import DBSCAN, dbscan from sklearn.cluster.tests.common import generate_clustered_data from sklearn.metrics.pairwise import pairwise_distances from skle...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/common.py
sklearn/cluster/tests/common.py
""" Common utilities for testing clustering. """ import numpy as np ############################################################################### # Generate sample data def generate_clustered_data( seed=0, n_clusters=3, n_features=2, n_samples_per_cluster=20, std=0.4 ): prng = np.random.RandomState(seed)...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_hdbscan.py
sklearn/cluster/tests/test_hdbscan.py
""" Tests for HDBSCAN clustering algorithm Based on the DBSCAN test code """ import numpy as np import pytest from scipy import stats from scipy.spatial import distance from sklearn.cluster import HDBSCAN from sklearn.cluster._hdbscan._tree import ( CONDENSED_dtype, _condense_tree, _do_labelling, ) from s...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_mean_shift.py
sklearn/cluster/tests/test_mean_shift.py
""" Testing for mean shift clustering methods """ import warnings import numpy as np import pytest from sklearn.cluster import MeanShift, estimate_bandwidth, get_bin_seeds, mean_shift from sklearn.datasets import make_blobs from sklearn.metrics import v_measure_score from sklearn.utils._testing import assert_allclo...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_spectral.py
sklearn/cluster/tests/test_spectral.py
"""Testing for Spectral Clustering methods""" import pickle import re import numpy as np import pytest from scipy.linalg import LinAlgError from sklearn.cluster import SpectralClustering, spectral_clustering from sklearn.cluster._spectral import cluster_qr, discretize from sklearn.datasets import make_blobs from skl...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_birch.py
sklearn/cluster/tests/test_birch.py
""" Tests for the birch clustering algorithm. """ import numpy as np import pytest from sklearn.cluster import AgglomerativeClustering, Birch from sklearn.cluster.tests.common import generate_clustered_data from sklearn.datasets import make_blobs from sklearn.exceptions import ConvergenceWarning from sklearn.metrics ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_k_means.py
sklearn/cluster/tests/test_k_means.py
"""Testing for K-means""" import re import sys from io import StringIO import numpy as np import pytest from scipy import sparse as sp from threadpoolctl import threadpool_info from sklearn.base import clone from sklearn.cluster import KMeans, MiniBatchKMeans, k_means, kmeans_plusplus from sklearn.cluster._k_means_c...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_feature_agglomeration.py
sklearn/cluster/tests/test_feature_agglomeration.py
""" Tests for sklearn.cluster._feature_agglomeration """ import numpy as np from numpy.testing import assert_array_equal from sklearn.cluster import FeatureAgglomeration from sklearn.datasets import make_blobs from sklearn.utils._testing import assert_array_almost_equal def test_feature_agglomeration(): n_clust...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/__init__.py
sklearn/cluster/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_optics.py
sklearn/cluster/tests/test_optics.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np import pytest from sklearn.cluster import DBSCAN, OPTICS from sklearn.cluster._optics import _extend_region, _extract_xi_labels from sklearn.cluster.tests.common import generate_clustered_data from sklea...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/cluster/tests/test_bisect_k_means.py
sklearn/cluster/tests/test_bisect_k_means.py
import numpy as np import pytest from sklearn.cluster import BisectingKMeans from sklearn.metrics import v_measure_score from sklearn.utils._testing import assert_allclose, assert_array_equal from sklearn.utils.fixes import CSR_CONTAINERS @pytest.mark.parametrize("bisecting_strategy", ["biggest_inertia", "largest_cl...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_base.py
sklearn/decomposition/_base.py
"""Principal Component Analysis Base Classes""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import ABCMeta, abstractmethod import numpy as np from scipy import linalg from sklearn.base import ( BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_kernel_pca.py
sklearn/decomposition/_kernel_pca.py
"""Kernel Principal Components Analysis.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Integral, Real import numpy as np from scipy import linalg from scipy.linalg import eigh from scipy.sparse.linalg import eigsh from sklearn.base import ( BaseEstimator, ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_sparse_pca.py
sklearn/decomposition/_sparse_pca.py
"""Matrix factorization with Sparse PCA.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Integral, Real import numpy as np from sklearn.base import ( BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context, ) from sklearn.d...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_incremental_pca.py
sklearn/decomposition/_incremental_pca.py
"""Incremental Principal Components Analysis.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Integral import numpy as np from scipy import linalg, sparse from sklearn.base import _fit_context from sklearn.decomposition._base import _BasePCA from sklearn.utils i...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_lda.py
sklearn/decomposition/_lda.py
""" ============================================================= Online Latent Dirichlet Allocation with variational inference ============================================================= This implementation is modified from Matthew D. Hoffman's onlineldavb code Link: https://github.com/blei-lab/onlineldavb """ # ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_fastica.py
sklearn/decomposition/_fastica.py
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/__init__.py
sklearn/decomposition/__init__.py
"""Matrix decomposition algorithms. These include PCA, NMF, ICA, and more. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.decomposition._dict_learning import ( Dictionary...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_pca.py
sklearn/decomposition/_pca.py
"""Principal Component Analysis.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from math import lgamma, log, sqrt from numbers import Integral, Real import numpy as np from scipy import linalg from scipy.sparse import issparse from scipy.sparse.linalg import svds from sklearn.bas...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_factor_analysis.py
sklearn/decomposition/_factor_analysis.py
"""Factor Analysis. A latent linear variable model. FactorAnalysis is similar to probabilistic PCA implemented by PCA.score While PCA assumes Gaussian noise with the same variance for each feature, the FactorAnalysis model assumes different variances for each of them. This implementation is based on David Barber's B...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_truncated_svd.py
sklearn/decomposition/_truncated_svd.py
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Integral, Real import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import svds from sklearn.base import ( BaseEstimato...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_nmf.py
sklearn/decomposition/_nmf.py
"""Non-negative matrix factorization.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import time import warnings from abc import ABC from math import sqrt from numbers import Integral, Real import numpy as np import scipy.sparse as sp from scipy import linalg from...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/_dict_learning.py
sklearn/decomposition/_dict_learning.py
"""Dictionary learning.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import sys import time from numbers import Integral, Real import numpy as np from joblib import effective_n_jobs from scipy import linalg from sklearn.base import ( BaseEstimator, Class...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_sparse_pca.py
sklearn/decomposition/tests/test_sparse_pca.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn.datasets import make_low_rank_matrix from sklearn.decomposition import PCA, MiniBatchSparsePCA, SparsePCA from sklearn.utils import check_random_st...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_truncated_svd.py
sklearn/decomposition/tests/test_truncated_svd.py
"""Test truncated SVD transformer.""" import numpy as np import pytest import scipy.sparse as sp from sklearn.decomposition import PCA, TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils._testing import assert_allclose, assert_array_less SVD_SOLVERS = ["arpack", "randomized"] @pytest.fixt...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_kernel_pca.py
sklearn/decomposition/tests/test_kernel_pca.py
import warnings import numpy as np import pytest import sklearn from sklearn.datasets import load_iris, make_blobs, make_circles from sklearn.decomposition import PCA, KernelPCA from sklearn.exceptions import NotFittedError from sklearn.linear_model import Perceptron from sklearn.metrics.pairwise import rbf_kernel fr...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_factor_analysis.py
sklearn/decomposition/tests/test_factor_analysis.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from itertools import combinations import numpy as np import pytest from sklearn.decomposition import FactorAnalysis from sklearn.decomposition._factor_analysis import _ortho_rotation from sklearn.exceptions import ConvergenceWarning from...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_pca.py
sklearn/decomposition/tests/test_pca.py
import os import re import warnings import numpy as np import pytest import scipy as sp from numpy.testing import assert_array_equal from sklearn import config_context, datasets from sklearn.base import clone from sklearn.datasets import load_iris, make_classification, make_low_rank_matrix from sklearn.decomposition ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_incremental_pca.py
sklearn/decomposition/tests/test_incremental_pca.py
"""Tests for Incremental PCA.""" import itertools import warnings import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from sklearn import datasets from sklearn.decomposition import PCA, IncrementalPCA from sklearn.utils._testing import ( assert_allclose_dense_sparse, ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_fastica.py
sklearn/decomposition/tests/test_fastica.py
""" Test the fastica algorithm. """ import itertools import os import warnings import numpy as np import pytest from scipy import stats from sklearn.decomposition import PCA, FastICA, fastica from sklearn.decomposition._fastica import _gs_decorrelation from sklearn.exceptions import ConvergenceWarning from sklearn.u...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/__init__.py
sklearn/decomposition/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_nmf.py
sklearn/decomposition/tests/test_nmf.py
import re import sys from io import StringIO import numpy as np import pytest from scipy import linalg from sklearn.base import clone from sklearn.decomposition import NMF, MiniBatchNMF, non_negative_factorization from sklearn.decomposition import _nmf as nmf # For testing internals from sklearn.exceptions import Co...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_online_lda.py
sklearn/decomposition/tests/test_online_lda.py
import sys from io import StringIO import numpy as np import pytest from numpy.testing import assert_array_equal from scipy.linalg import block_diag from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda_fast import ( _dirichlet_expectation...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/decomposition/tests/test_dict_learning.py
sklearn/decomposition/tests/test_dict_learning.py
import itertools import warnings from functools import partial import numpy as np import pytest import sklearn from sklearn.base import clone from sklearn.decomposition import ( DictionaryLearning, MiniBatchDictionaryLearning, SparseCoder, dict_learning, dict_learning_online, sparse_encode, ) ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/enable_halving_search_cv.py
sklearn/experimental/enable_halving_search_cv.py
"""Enables Successive Halving search-estimators The API and results of these estimators might change without any deprecation cycle. Importing this file dynamically sets the :class:`~sklearn.model_selection.HalvingRandomSearchCV` and :class:`~sklearn.model_selection.HalvingGridSearchCV` as attributes of the `model_sel...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/enable_iterative_imputer.py
sklearn/experimental/enable_iterative_imputer.py
"""Enables IterativeImputer The API and results of this estimator might change without any deprecation cycle. Importing this file dynamically sets :class:`~sklearn.impute.IterativeImputer` as an attribute of the impute module:: >>> # explicitly require this experimental feature >>> from sklearn.experimental ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/enable_hist_gradient_boosting.py
sklearn/experimental/enable_hist_gradient_boosting.py
"""This is now a no-op and can be safely removed from your code. It used to enable the use of :class:`~sklearn.ensemble.HistGradientBoostingClassifier` and :class:`~sklearn.ensemble.HistGradientBoostingRegressor` when they were still :term:`experimental`, but these estimators are now stable and can be imported normall...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/__init__.py
sklearn/experimental/__init__.py
"""Importable modules that enable the use of experimental features or estimators. .. warning:: The features and estimators that are experimental aren't subject to deprecation cycles. Use them at your own risks! """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/tests/test_enable_successive_halving.py
sklearn/experimental/tests/test_enable_successive_halving.py
"""Tests for making sure experimental imports work as expected.""" import textwrap import pytest from sklearn.utils._testing import assert_run_python_script_without_output from sklearn.utils.fixes import _IS_WASM @pytest.mark.xfail(_IS_WASM, reason="cannot start subprocess") def test_imports_strategies(): # Ma...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/tests/test_enable_hist_gradient_boosting.py
sklearn/experimental/tests/test_enable_hist_gradient_boosting.py
"""Tests for making sure experimental imports work as expected.""" import textwrap import pytest from sklearn.utils._testing import assert_run_python_script_without_output from sklearn.utils.fixes import _IS_WASM @pytest.mark.xfail(_IS_WASM, reason="cannot start subprocess") def test_import_raises_warning(): c...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/tests/test_enable_iterative_imputer.py
sklearn/experimental/tests/test_enable_iterative_imputer.py
"""Tests for making sure experimental imports work as expected.""" import textwrap import pytest from sklearn.utils._testing import assert_run_python_script_without_output from sklearn.utils.fixes import _IS_WASM @pytest.mark.xfail(_IS_WASM, reason="cannot start subprocess") def test_imports_strategies(): # Ma...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/experimental/tests/__init__.py
sklearn/experimental/tests/__init__.py
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/manifold/_mds.py
sklearn/manifold/_mds.py
""" Multi-dimensional Scaling (MDS). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from joblib import effective_n_jobs from sklearn.base import BaseEstimator, _fit_context from sklearn.isotonic import Isotonic...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/manifold/_classical_mds.py
sklearn/manifold/_classical_mds.py
""" Classical multi-dimensional scaling (classical MDS). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Integral import numpy as np from scipy import linalg from sklearn.base import BaseEstimator, _fit_context from sklearn.metrics import pairwise_distances fro...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/sklearn/manifold/_isomap.py
sklearn/manifold/_isomap.py
"""Isomap for manifold learning""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from scipy.sparse import issparse from scipy.sparse.csgraph import connected_components, shortest_path from sklearn.base import ( ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false