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/gaussian_process/tests/test_gpr.py
sklearn/gaussian_process/tests/test_gpr.py
"""Testing for Gaussian process regression""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re import sys import warnings import numpy as np import pytest from scipy.optimize import approx_fprime from sklearn.exceptions import ConvergenceWarning from sklearn.gaussian_process ...
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/model_selection/_plot.py
sklearn/model_selection/_plot.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from sklearn.model_selection._validation import learning_curve, validation_curve from sklearn.utils._optional_dependencies import check_matplotlib_support from sklearn.utils._plotting import _interval_max_min_ratio, _val...
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/model_selection/_split.py
sklearn/model_selection/_split.py
""" The :mod:`sklearn.model_selection._split` module includes classes and functions to split the data based on a preset strategy. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import warnings from abc import ABCMeta, abstractmethod from collections import defaultdic...
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/model_selection/_classification_threshold.py
sklearn/model_selection/_classification_threshold.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from collections.abc import MutableMapping from numbers import Integral, Real import numpy as np from sklearn.base import ( BaseEstimator, ClassifierMixin, MetaEstimatorMixin, _fit_context, clone, ) from sklearn.except...
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/model_selection/_search_successive_halving.py
sklearn/model_selection/_search_successive_halving.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import abstractmethod from math import ceil, floor, log from numbers import Integral, Real import numpy as np from sklearn.base import _fit_context, is_classifier from sklearn.metrics._scorer import get_scorer_names from sklearn....
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/model_selection/_search.py
sklearn/model_selection/_search.py
""" The :mod:`sklearn.model_selection._search` includes utilities to fine-tune the parameters of an estimator. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import operator import time import warnings from abc import ABCMeta, abstractmethod from collections import d...
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/model_selection/_validation.py
sklearn/model_selection/_validation.py
""" The :mod:`sklearn.model_selection._validation` module includes classes and functions to validate the model. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import time import warnings from collections import Counter from contextlib import suppress from functools i...
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/model_selection/__init__.py
sklearn/model_selection/__init__.py
"""Tools for model selection, such as cross validation and hyper-parameter tuning.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import typing from sklearn.model_selection._classification_threshold import ( FixedThresholdClassifier, TunedThresholdClassifierCV, ) 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/model_selection/tests/test_classification_threshold.py
sklearn/model_selection/tests/test_classification_threshold.py
import numpy as np import pytest from sklearn import config_context from sklearn.base import clone from sklearn.datasets import ( load_breast_cancer, load_iris, make_classification, make_multilabel_classification, ) from sklearn.dummy import DummyClassifier from sklearn.ensemble import GradientBoosting...
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/model_selection/tests/test_split.py
sklearn/model_selection/tests/test_split.py
"""Test the split module""" import re import warnings from itertools import combinations, combinations_with_replacement, permutations import numpy as np import pytest from scipy import stats from scipy.sparse import issparse from scipy.special import comb from sklearn import config_context from sklearn.datasets impo...
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/model_selection/tests/common.py
sklearn/model_selection/tests/common.py
""" Common utilities for testing model selection. """ import numpy as np from sklearn.model_selection import KFold class OneTimeSplitter: """A wrapper to make KFold single entry cv iterator""" def __init__(self, n_splits=4, n_samples=99): self.n_splits = n_splits self.n_samples = n_samples ...
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/model_selection/tests/test_successive_halving.py
sklearn/model_selection/tests/test_successive_halving.py
from math import ceil import numpy as np import pytest from scipy.stats import expon, norm, randint from sklearn.datasets import make_classification from sklearn.dummy import DummyClassifier from sklearn.experimental import enable_halving_search_cv # noqa: F401 from sklearn.model_selection import ( GroupKFold, ...
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/model_selection/tests/__init__.py
sklearn/model_selection/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/model_selection/tests/test_validation.py
sklearn/model_selection/tests/test_validation.py
"""Test the validation module""" import os import re import tempfile import warnings from functools import partial from time import sleep import numpy as np import pytest from scipy.sparse import issparse from sklearn import config_context from sklearn.base import BaseEstimator, ClassifierMixin, clone, is_classifier...
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/model_selection/tests/test_plot.py
sklearn/model_selection/tests/test_plot.py
import numpy as np import pytest from sklearn.datasets import load_iris from sklearn.model_selection import ( LearningCurveDisplay, ValidationCurveDisplay, learning_curve, validation_curve, ) from sklearn.tree import DecisionTreeClassifier from sklearn.utils import shuffle from sklearn.utils._testing 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/model_selection/tests/test_search.py
sklearn/model_selection/tests/test_search.py
"""Test the search module""" import pickle import re import sys import warnings from collections.abc import Iterable, Sized from functools import partial from io import StringIO from itertools import chain, product from types import GeneratorType import numpy as np import pytest from scipy.stats import bernoulli, exp...
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/_loss/link.py
sklearn/_loss/link.py
""" Module contains classes for invertible (and differentiable) link functions. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import ABC, abstractmethod from dataclasses import dataclass import numpy as np from scipy.special import expit, logit from scipy.stats import gm...
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/_loss/loss.py
sklearn/_loss/loss.py
""" This module contains loss classes suitable for fitting. It is not part of the public API. Specific losses are used for regression, binary classification or multiclass classification. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # Goals: # - Provide a common private module fo...
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/_loss/__init__.py
sklearn/_loss/__init__.py
""" The :mod:`sklearn._loss` module includes loss function classes suitable for fitting classification and regression tasks. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn._loss.loss import ( AbsoluteError, HalfBinomialLoss, HalfGammaLoss, HalfMultinomi...
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/_loss/tests/test_loss.py
sklearn/_loss/tests/test_loss.py
import pickle import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from pytest import approx from scipy.optimize import ( LinearConstraint, minimize, minimize_scalar, newton, ) from scipy.special import logsumexp from sklearn._loss.link import IdentityLink, _i...
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/_loss/tests/test_link.py
sklearn/_loss/tests/test_link.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from sklearn._loss.link import ( _LINKS, HalfLogitLink, Interval, MultinomialLogit, _inclusive_low_high, ) LINK_FUNCTIONS = list(_LINKS.values()) def test_interval_raises(): """Test that interval w...
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/_loss/tests/__init__.py
sklearn/_loss/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/ensemble/_base.py
sklearn/ensemble/_base.py
"""Base class for ensemble-based estimators.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import ABCMeta, abstractmethod import numpy as np from joblib import effective_n_jobs from sklearn.base import ( BaseEstimator, MetaEstimatorMixin, clone, is_classi...
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/ensemble/_stacking.py
sklearn/ensemble/_stacking.py
"""Stacking classifier and regressor.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import ABCMeta, abstractmethod from copy import deepcopy from numbers import Integral import numpy as np import scipy.sparse as sparse from sklearn.base import ( ClassifierMixin, ...
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/ensemble/_forest.py
sklearn/ensemble/_forest.py
""" Forest of trees-based ensemble methods. Those methods include random forests and extremely randomized trees. The module structure is the following: - The ``BaseForest`` base class implements a common ``fit`` method for all the estimators in the module. The ``fit`` method of the base ``Forest`` class calls th...
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/ensemble/_iforest.py
sklearn/ensemble/_iforest.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import threading from numbers import Integral, Real from warnings import warn import numpy as np from scipy.sparse import issparse from sklearn.base import OutlierMixin, _fit_context from sklearn.ensemble._bagging import Ba...
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/ensemble/_bagging.py
sklearn/ensemble/_bagging.py
"""Bagging meta-estimator.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import numbers from abc import ABCMeta, abstractmethod from functools import partial from numbers import Integral from warnings import warn import numpy as np from sklearn.base import Classi...
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/ensemble/__init__.py
sklearn/ensemble/__init__.py
"""Ensemble-based methods for classification, regression and anomaly detection.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.ensemble._bagging import BaggingClassifier, BaggingRegressor from sklearn.ensemble._base import BaseEnsemble from sklearn.ensemble._forest 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/ensemble/_gb.py
sklearn/ensemble/_gb.py
"""Gradient Boosted Regression Trees. This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressi...
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/ensemble/_weight_boosting.py
sklearn/ensemble/_weight_boosting.py
"""Weight Boosting. This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The `BaseWeightBoosting` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each oth...
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/ensemble/_voting.py
sklearn/ensemble/_voting.py
""" Soft Voting/Majority Rule classifier and Voting regressor. This module contains: - A Soft Voting/Majority Rule classifier for classification estimators. - A Voting regressor for regression estimators. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from abc import abstractmet...
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/ensemble/_hist_gradient_boosting/grower.py
sklearn/ensemble/_hist_gradient_boosting/grower.py
""" This module contains the TreeGrower class. TreeGrower builds a regression tree fitting a Newton-Raphson step, based on the gradients and hessians of the training data. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers from heapq import heappop, heappush from timeit...
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/ensemble/_hist_gradient_boosting/predictor.py
sklearn/ensemble/_hist_gradient_boosting/predictor.py
""" This module contains the TreePredictor class which is used for prediction. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from sklearn.ensemble._hist_gradient_boosting._predictor import ( _compute_partial_dependence, _predict_from_binned_data, _p...
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/ensemble/_hist_gradient_boosting/utils.py
sklearn/ensemble/_hist_gradient_boosting/utils.py
"""This module contains utility routines.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.base import is_classifier from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper def get_equivalent_estimator(estimator, lib="lightgbm", n_classes=None): """R...
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/ensemble/_hist_gradient_boosting/__init__.py
sklearn/ensemble/_hist_gradient_boosting/__init__.py
"""This module implements histogram-based gradient boosting estimators. The implementation is a port from pygbm which is itself strongly inspired from LightGBM. """ # 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/ensemble/_hist_gradient_boosting/gradient_boosting.py
sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py
"""Fast Gradient Boosting decision trees for classification and regression.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools from abc import ABC, abstractmethod from contextlib import contextmanager, nullcontext, suppress from functools import partial from numbers 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/ensemble/_hist_gradient_boosting/binning.py
sklearn/ensemble/_hist_gradient_boosting/binning.py
""" This module contains the BinMapper class. BinMapper is used for mapping a real-valued dataset into integer-valued bins. Bin thresholds are computed with the quantiles so that each bin contains approximately the same number of samples. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Cla...
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/ensemble/_hist_gradient_boosting/tests/test_warm_start.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_warm_start.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from sklearn.base import clone from sklearn.datasets import make_classification, make_regression from sklearn.ensemble import ( HistGradientBoostingClassifier, HistGradientBoostingRegressor, ) from sklearn.metrics im...
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/ensemble/_hist_gradient_boosting/tests/test_grower.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_grower.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from pytest import approx from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper from sklearn.ensemble._hist_gradient_boosting.common import ( G_H_DTYPE, X_BINNED_DTYPE, X_BITSET_INNER_DTYPE, ...
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/ensemble/_hist_gradient_boosting/tests/test_predictor.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_predictor.py
import numpy as np import pytest from numpy.testing import assert_allclose from sklearn.datasets import make_regression from sklearn.ensemble._hist_gradient_boosting._bitset import ( set_bitset_memoryview, set_raw_bitset_from_binned_bitset, ) from sklearn.ensemble._hist_gradient_boosting.binning import _BinMap...
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/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
import copyreg import io import pickle import re import warnings from unittest.mock import Mock import joblib import numpy as np import pytest from joblib.numpy_pickle import NumpyPickler from numpy.testing import assert_allclose, assert_array_equal import sklearn.ensemble._hist_gradient_boosting.gradient_boosting as...
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/ensemble/_hist_gradient_boosting/tests/test_histogram.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_histogram.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from sklearn.ensemble._hist_gradient_boosting.common import ( G_H_DTYPE, HISTOGRAM_DTYPE, X_BINNED_DTYPE, ) from sklearn.ensemble._hist_gradient_boosting.histogram import ( _build_histogram, _build_histog...
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/ensemble/_hist_gradient_boosting/tests/test_bitset.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_bitset.py
import numpy as np import pytest from numpy.testing import assert_allclose from sklearn.ensemble._hist_gradient_boosting._bitset import ( in_bitset_memoryview, set_bitset_memoryview, set_raw_bitset_from_binned_bitset, ) from sklearn.ensemble._hist_gradient_boosting.common import X_DTYPE @pytest.mark.para...
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/ensemble/_hist_gradient_boosting/tests/test_splitting.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_splitting.py
import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn.ensemble._hist_gradient_boosting.common import ( G_H_DTYPE, HISTOGRAM_DTYPE, X_BINNED_DTYPE, MonotonicConstraint, ) from sklearn.ensemble._hist_gradient_boosting.histogram import HistogramBuilder from sklearn.ens...
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/ensemble/_hist_gradient_boosting/tests/__init__.py
sklearn/ensemble/_hist_gradient_boosting/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/ensemble/_hist_gradient_boosting/tests/test_compare_lightgbm.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_compare_lightgbm.py
import numpy as np import pytest from sklearn.datasets import make_classification, make_regression from sklearn.ensemble import ( HistGradientBoostingClassifier, HistGradientBoostingRegressor, ) from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper from sklearn.ensemble._hist_gradient_boostin...
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/ensemble/_hist_gradient_boosting/tests/test_monotonic_constraints.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_monotonic_constraints.py
import re import numpy as np import pytest from sklearn.ensemble import ( HistGradientBoostingClassifier, HistGradientBoostingRegressor, ) from sklearn.ensemble._hist_gradient_boosting.common import ( G_H_DTYPE, X_BINNED_DTYPE, MonotonicConstraint, ) from sklearn.ensemble._hist_gradient_boosting.g...
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/ensemble/_hist_gradient_boosting/tests/test_binning.py
sklearn/ensemble/_hist_gradient_boosting/tests/test_binning.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from sklearn.ensemble._hist_gradient_boosting.binning import ( _BinMapper, _find_binning_thresholds, _map_to_bins, ) from sklearn.ensemble._hist_gradient_boosting.common import ( ALMOST_INF, X_BINNED_DTYP...
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/ensemble/tests/test_stacking.py
sklearn/ensemble/tests/test_stacking.py
"""Test the stacking classifier and regressor.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re from unittest.mock import Mock import numpy as np import pytest from numpy.testing import assert_array_equal from scipy import sparse from sklearn import config_context from skl...
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/ensemble/tests/test_gradient_boosting.py
sklearn/ensemble/tests/test_gradient_boosting.py
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import re import warnings import numpy as np import pytest from numpy.testing import assert_allclose from sklearn import datasets from sklearn.base import clone from sklearn.datasets import make_classification, make_regression fro...
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/ensemble/tests/test_common.py
sklearn/ensemble/tests/test_common.py
import numpy as np import pytest from sklearn.base import ClassifierMixin, clone, is_classifier from sklearn.datasets import ( load_diabetes, load_iris, make_classification, make_regression, ) from sklearn.ensemble import ( RandomForestClassifier, RandomForestRegressor, StackingClassifier, ...
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/ensemble/tests/test_base.py
sklearn/ensemble/tests/test_base.py
""" Testing for the base module (sklearn.ensemble.base). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from collections import OrderedDict import numpy as np from sklearn.datasets import load_iris from sklearn.discriminant_analysis import LinearDiscriminantAnalysis 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/ensemble/tests/test_iforest.py
sklearn/ensemble/tests/test_iforest.py
""" Testing for Isolation Forest algorithm (sklearn.ensemble.iforest). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from unittest.mock import Mock, patch import numpy as np import pytest from joblib import parallel_backend from sklearn.datasets import load_diabe...
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/ensemble/tests/test_voting.py
sklearn/ensemble/tests/test_voting.py
"""Testing for the VotingClassifier and VotingRegressor""" import re import numpy as np import pytest from sklearn import config_context, datasets from sklearn.base import BaseEstimator, ClassifierMixin, clone from sklearn.calibration import CalibratedClassifierCV from sklearn.datasets import make_multilabel_classif...
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/ensemble/tests/test_forest.py
sklearn/ensemble/tests/test_forest.py
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import math import pickle from collections import defaultdict from functools import partial from itertools import combinations, product from typing import An...
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/ensemble/tests/__init__.py
sklearn/ensemble/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/ensemble/tests/test_weight_boosting.py
sklearn/ensemble/tests/test_weight_boosting.py
"""Testing for the boost module (sklearn.ensemble.boost).""" import re import numpy as np import pytest from sklearn import datasets from sklearn.base import BaseEstimator, clone from sklearn.dummy import DummyClassifier, DummyRegressor from sklearn.ensemble import AdaBoostClassifier, AdaBoostRegressor 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/ensemble/tests/test_bagging.py
sklearn/ensemble/tests/test_bagging.py
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re import warnings from itertools import cycle, product import joblib import numpy as np import pytest from sklearn import config_context 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/neighbors/_base.py
sklearn/neighbors/_base.py
"""Base and mixin classes for nearest neighbors.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import numbers import warnings from abc import ABCMeta, abstractmethod from functools import partial from numbers import Integral, Real import numpy as np from joblib 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/neighbors/_graph.py
sklearn/neighbors/_graph.py
"""Nearest Neighbors graph functions""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools from sklearn.base import ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context from sklearn.neighbors._base import ( VALID_METRICS, KNeighborsMixin, NeighborsB...
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/neighbors/_nca.py
sklearn/neighbors/_nca.py
""" Neighborhood Component Analysis """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import sys import time from numbers import Integral, Real from warnings import warn import numpy as np from scipy.optimize import minimize from sklearn.base import ( BaseEstimator, ClassNam...
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/neighbors/_nearest_centroid.py
sklearn/neighbors/_nearest_centroid.py
""" Nearest Centroid Classification """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Real import numpy as np from scipy import sparse as sp from sklearn.base import BaseEstimator, ClassifierMixin, _fit_context from sklearn.discriminant_analysis 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/neighbors/_classification.py
sklearn/neighbors/_classification.py
"""Nearest Neighbor Classification""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral import numpy as np from sklearn.base import ClassifierMixin, _fit_context from sklearn.metrics._pairwise_distances_reduction import ( ArgKminClassMode...
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/neighbors/__init__.py
sklearn/neighbors/__init__.py
"""The k-nearest neighbors algorithms.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.neighbors._ball_tree import BallTree from sklearn.neighbors._base import ( VALID_METRICS, VALID_METRICS_SPARSE, sort_graph_by_row_values, ) from sklearn.neighbors._classifi...
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/neighbors/_kde.py
sklearn/neighbors/_kde.py
""" Kernel Density Estimation ------------------------- """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools from numbers import Integral, Real import numpy as np from scipy.special import gammainc from sklearn.base import BaseEstimator, _fit_context from sklearn.neigh...
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/neighbors/_unsupervised.py
sklearn/neighbors/_unsupervised.py
"""Unsupervised nearest neighbors learner""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.base import _fit_context from sklearn.neighbors._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin class NearestNeighbors(KNeighborsMixin, RadiusNeighborsMixin, Nei...
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/neighbors/_lof.py
sklearn/neighbors/_lof.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Real import numpy as np from sklearn.base import OutlierMixin, _fit_context from sklearn.neighbors._base import KNeighborsMixin, NeighborsBase from sklearn.utils import check_array from sklearn.utils._p...
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/neighbors/_regression.py
sklearn/neighbors/_regression.py
"""Nearest Neighbor Regression.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np from sklearn.base import RegressorMixin, _fit_context from sklearn.metrics import DistanceMetric from sklearn.neighbors._base import ( KNeighborsMixin, Neighbo...
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/neighbors/tests/test_neighbors_pipeline.py
sklearn/neighbors/tests/test_neighbors_pipeline.py
""" This is testing the equivalence between some estimators with internal nearest neighbors computations, and the corresponding pipeline versions with KNeighborsTransformer or RadiusNeighborsTransformer to precompute the neighbors. """ import numpy as np from sklearn.base import clone from sklearn.cluster import DBSC...
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/neighbors/tests/test_quad_tree.py
sklearn/neighbors/tests/test_quad_tree.py
import pickle import numpy as np import pytest from sklearn.neighbors._quad_tree import _QuadTree from sklearn.utils import check_random_state def test_quadtree_boundary_computation(): # Introduce a point into a quad tree with boundaries not easy to compute. Xs = [] # check a random case Xs.append(...
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/neighbors/tests/test_kde.py
sklearn/neighbors/tests/test_kde.py
import joblib import numpy as np import pytest from sklearn.datasets import make_blobs from sklearn.exceptions import NotFittedError from sklearn.model_selection import GridSearchCV from sklearn.neighbors import KDTree, KernelDensity, NearestNeighbors from sklearn.neighbors._ball_tree import kernel_norm from sklearn.p...
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/neighbors/tests/test_lof.py
sklearn/neighbors/tests/test_lof.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re from math import sqrt import numpy as np import pytest from sklearn import metrics, neighbors from sklearn.datasets import load_iris from sklearn.metrics import roc_auc_score from sklearn.utils import check_random_state 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/neighbors/tests/test_kd_tree.py
sklearn/neighbors/tests/test_kd_tree.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_equal from sklearn.neighbors._kd_tree import KDTree, KDTree32, KDTree64 from sklearn.neighbors.tests.test_ball_tree import get_dataset_for_binary_tree from sklearn.utils.parallel import Parallel, delayed DIMENSION = 3 METRICS = {"eucl...
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/neighbors/tests/test_neighbors.py
sklearn/neighbors/tests/test_neighbors.py
import re import warnings from itertools import product import joblib import numpy as np import pytest from scipy.sparse import issparse from sklearn import ( config_context, datasets, metrics, neighbors, ) from sklearn.base import clone from sklearn.exceptions import EfficiencyWarning, NotFittedError...
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/neighbors/tests/test_neighbors_tree.py
sklearn/neighbors/tests/test_neighbors_tree.py
# SPDX-License-Identifier: BSD-3-Clause import itertools import pickle import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_almost_equal from sklearn.metrics import DistanceMetric from sklearn.neighbors._ball_tree import ( BallTree, kernel_norm, ) from sklearn.neighbors._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/neighbors/tests/test_graph.py
sklearn/neighbors/tests/test_graph.py
import numpy as np import pytest from sklearn.metrics import euclidean_distances from sklearn.neighbors import KNeighborsTransformer, RadiusNeighborsTransformer from sklearn.neighbors._base import _is_sorted_by_data from sklearn.utils._testing import assert_array_equal def test_transformer_result(): # Test the n...
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/neighbors/tests/__init__.py
sklearn/neighbors/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/neighbors/tests/test_nca.py
sklearn/neighbors/tests/test_nca.py
""" Testing for Neighborhood Component Analysis module (sklearn.neighbors.nca) """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re import numpy as np import pytest from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy.optimize import check_grad 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/neighbors/tests/test_ball_tree.py
sklearn/neighbors/tests/test_ball_tree.py
import itertools import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_almost_equal, assert_equal from sklearn.neighbors._ball_tree import BallTree, BallTree32, BallTree64 from sklearn.utils import check_random_state from sklearn.utils._testing import _convert_container 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/neighbors/tests/test_nearest_centroid.py
sklearn/neighbors/tests/test_nearest_centroid.py
""" Testing for the nearest centroid module. """ import numpy as np import pytest from sklearn import datasets from sklearn.neighbors import NearestCentroid from sklearn.utils._testing import ( assert_allclose, assert_array_almost_equal, assert_array_equal, ) from sklearn.utils.fixes import CSR_CONTAINERS...
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/covariance/_robust_covariance.py
sklearn/covariance/_robust_covariance.py
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # 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 linalg from scipy.stats import ch...
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/covariance/_graph_lasso.py
sklearn/covariance/_graph_lasso.py
"""GraphicalLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import operator import sys import time import warnings from numbers import Integral, Real import numpy as np from scipy import linalg from sklear...
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/covariance/_elliptic_envelope.py
sklearn/covariance/_elliptic_envelope.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Real import numpy as np from sklearn.base import OutlierMixin, _fit_context from sklearn.covariance._robust_covariance import MinCovDet from sklearn.metrics import accuracy_score from sklearn.utils._param_validation im...
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/covariance/_empirical_covariance.py
sklearn/covariance/_empirical_covariance.py
""" Maximum likelihood covariance estimator. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # avoid division truncation import warnings import numpy as np from scipy import linalg from sklearn import config_context from sklearn.base import BaseEstimator, _fit_context from sklear...
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/covariance/__init__.py
sklearn/covariance/__init__.py
"""Methods and algorithms to robustly estimate covariance. They estimate the covariance of features at given sets of points, as well as the precision matrix defined as the inverse of the covariance. Covariance estimation is closely related to the theory of Gaussian graphical models. """ # Authors: The scikit-learn 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/covariance/_shrunk_covariance.py
sklearn/covariance/_shrunk_covariance.py
""" Covariance estimators using shrinkage. Shrinkage corresponds to regularising `cov` using a convex combination: shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # avoid division truncation import warnings from numbe...
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/covariance/tests/test_robust_covariance.py
sklearn/covariance/tests/test_robust_covariance.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import numpy as np import pytest from sklearn import datasets from sklearn.covariance import MinCovDet, empirical_covariance, fast_mcd from sklearn.utils._testing import assert_array_almost_equal X = datasets.load_iris()...
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/covariance/tests/test_graphical_lasso.py
sklearn/covariance/tests/test_graphical_lasso.py
"""Test the graphical_lasso module.""" import sys from io import StringIO import numpy as np import pytest from numpy.testing import assert_allclose from scipy import linalg from sklearn import config_context, datasets from sklearn.covariance import ( GraphicalLasso, GraphicalLassoCV, empirical_covarianc...
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/covariance/tests/__init__.py
sklearn/covariance/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/covariance/tests/test_elliptic_envelope.py
sklearn/covariance/tests/test_elliptic_envelope.py
""" Testing for Elliptic Envelope algorithm (sklearn.covariance.elliptic_envelope). """ import numpy as np import pytest from sklearn.covariance import EllipticEnvelope from sklearn.exceptions import NotFittedError from sklearn.utils._testing import ( assert_almost_equal, assert_array_almost_equal, assert...
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/covariance/tests/test_covariance.py
sklearn/covariance/tests/test_covariance.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from sklearn import datasets from sklearn.covariance import ( OAS, EmpiricalCovariance, LedoitWolf, ShrunkCovariance, empirical_covariance, ledoit_wolf, ledoit_wolf_shrinkage, ...
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/feature_extraction/image.py
sklearn/feature_extraction/image.py
"""Utilities to extract features from images.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from itertools import product from numbers import Integral, Number, Real import numpy as np from numpy.lib.stride_tricks import as_strided from scipy import sparse from sklearn.base 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/feature_extraction/_stop_words.py
sklearn/feature_extraction/_stop_words.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # This list of English stop words is taken from the "Glasgow Information # Retrieval Group". The original list can be found at # http://ir.dcs.gla.ac.uk/resources/linguistic_utils/stop_words ENGLISH_STOP_WORDS = frozenset( [ "a"...
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/feature_extraction/_hash.py
sklearn/feature_extraction/_hash.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from itertools import chain from numbers import Integral import numpy as np import scipy.sparse as sp from sklearn.base import BaseEstimator, TransformerMixin, _fit_context from sklearn.feature_extraction._hashing_fast import transform as...
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/feature_extraction/__init__.py
sklearn/feature_extraction/__init__.py
"""Feature extraction from raw data.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.feature_extraction import image, text from sklearn.feature_extraction._dict_vectorizer import DictVectorizer from sklearn.feature_extraction._hash import FeatureHasher from sklearn.featu...
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/feature_extraction/text.py
sklearn/feature_extraction/text.py
"""Utilities to build feature vectors from text documents.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import array import re import unicodedata import warnings from collections import defaultdict from collections.abc import Mapping from functools import partial from numbers impo...
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/feature_extraction/_dict_vectorizer.py
sklearn/feature_extraction/_dict_vectorizer.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from array import array from collections.abc import Iterable, Mapping from numbers import Number from operator import itemgetter import numpy as np import scipy.sparse as sp from sklearn.base import BaseEstimator, TransformerMixin, _fit_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/feature_extraction/tests/test_feature_hasher.py
sklearn/feature_extraction/tests/test_feature_hasher.py
import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn.feature_extraction import FeatureHasher from sklearn.feature_extraction._hashing_fast import transform as _hashing_transform def test_feature_hasher_dicts(): feature_hasher = FeatureHasher(n_features=16) assert "dict" ...
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/feature_extraction/tests/test_image.py
sklearn/feature_extraction/tests/test_image.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from scipy import ndimage from scipy.sparse.csgraph import connected_components from sklearn.feature_extraction.image import ( PatchExtractor, _extract_patches, extract_patches_2d, grid_to_g...
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/feature_extraction/tests/test_text.py
sklearn/feature_extraction/tests/test_text.py
import pickle import re import uuid import warnings from collections import defaultdict from collections.abc import Mapping from functools import partial from io import StringIO from itertools import product import numpy as np import pytest from numpy.testing import assert_array_almost_equal, assert_array_equal from s...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true