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/utils/_testing.py
sklearn/utils/_testing.py
"""Testing utilities.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import atexit import contextlib import functools import importlib import inspect import os import os.path as op import re import shutil import sys import tempfile import textwrap import unittest import warnings 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/utils/_indexing.py
sklearn/utils/_indexing.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import sys import warnings from collections import UserList from itertools import compress, islice import numpy as np from scipy.sparse import issparse from sklearn.utils._array_api import ( _is_numpy_namespace, get...
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/utils/_available_if.py
sklearn/utils/_available_if.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from functools import update_wrapper, wraps from types import MethodType class _AvailableIfDescriptor: """Implements a conditional property using the descriptor protocol. Using this class to create a decorator will raise an ``Att...
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/utils/fixes.py
sklearn/utils/fixes.py
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fix is no longer needed. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import platform import struct import numpy as np 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/utils/validation.py
sklearn/utils/validation.py
"""Functions to validate input and parameters within scikit-learn estimators.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import operator import warnings from collections.abc import Sequence from contextlib import suppress from functools import reduce, wraps from 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/utils/_mocking.py
sklearn/utils/_mocking.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils._metadata_requests import RequestMethod from sklearn.utils.metaestimators import available_if from sklearn.utils.validation import ( _check_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/utils/_dataframe.py
sklearn/utils/_dataframe.py
"""Functions to determine if an object is a dataframe or series.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import sys def is_df_or_series(X): """Return True if the X is a dataframe or series. Parameters ---------- X : {array-like, dataframe} The array...
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/utils/random.py
sklearn/utils/random.py
"""Utilities for random sampling.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import array import numpy as np import scipy.sparse as sp from sklearn.utils import check_random_state from sklearn.utils._random import sample_without_replacement __all__ = ["sample_without_replacem...
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/utils/_pprint.py
sklearn/utils/_pprint.py
"""This module contains the _EstimatorPrettyPrinter class used in BaseEstimator.__repr__ for pretty-printing estimators""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013, 2014, 2015, 2016, 20...
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/utils/__init__.py
sklearn/utils/__init__.py
"""Various utilities to help with development.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.exceptions import DataConversionWarning from sklearn.utils import metadata_routing from sklearn.utils._bunch import Bunch from sklearn.utils._chunking import gen_batches, gen_e...
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/utils/_plotting.py
sklearn/utils/_plotting.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from collections.abc import Mapping import numpy as np from sklearn.utils import check_consistent_length from sklearn.utils._optional_dependencies import check_matplotlib_support from sklearn.utils._response import _get_res...
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/utils/_user_interface.py
sklearn/utils/_user_interface.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import timeit from contextlib import contextmanager def _message_with_time(source, message, time): """Create one line message for logging purposes. Parameters ---------- source : str String indicating the source o...
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/utils/_optional_dependencies.py
sklearn/utils/_optional_dependencies.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause def check_matplotlib_support(caller_name): """Raise ImportError with detailed error message if mpl is not installed. Plot utilities like any of the Display's plotting functions should lazily import matplotlib and call this hel...
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/utils/_unique.py
sklearn/utils/_unique.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from sklearn.utils._array_api import get_namespace def _attach_unique(y): """Attach unique values of y to y and return the result. The result is a view of y, and the metadata (unique) is not attached to y. ...
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/utils/stats.py
sklearn/utils/stats.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.utils._array_api import ( _find_matching_floating_dtype, get_namespace_and_device, ) def _weighted_percentile( array, sample_weight, percentile_rank=50, average=False, xp=None ): """Compute the weighted percen...
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/utils/parallel.py
sklearn/utils/parallel.py
"""Customizations of :mod:`joblib` and :mod:`threadpoolctl` tools for scikit-learn usage. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import functools import warnings from functools import update_wrapper import joblib from threadpoolctl import ThreadpoolController 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/utils/_chunking.py
sklearn/utils/_chunking.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from itertools import islice from numbers import Integral import numpy as np from sklearn._config import get_config from sklearn.utils._param_validation import Interval, validate_params def chunk_generator(gen, chunksize...
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/utils/class_weight.py
sklearn/utils/class_weight.py
"""Utilities for handling weights based on class labels.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from scipy import sparse from sklearn.utils._param_validation import StrOptions, validate_params from sklearn.utils.validation import _check_sample_weight @v...
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/utils/_test_common/__init__.py
sklearn/utils/_test_common/__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/utils/_test_common/instance_generator.py
sklearn/utils/_test_common/instance_generator.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re import sys import warnings from contextlib import suppress from functools import partial from inspect import isfunction import numpy as np from sklearn import clone, config_context from sklearn.calibration import CalibratedClas...
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/utils/tests/test_metaestimators.py
sklearn/utils/tests/test_metaestimators.py
import pickle import pytest from sklearn.utils.metaestimators import available_if class AvailableParameterEstimator: """This estimator's `available` parameter toggles the presence of a method""" def __init__(self, available=True, return_value=1): self.available = available self.return_value...
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/utils/tests/test_arrayfuncs.py
sklearn/utils/tests/test_arrayfuncs.py
import numpy as np import pytest from sklearn.utils._testing import assert_allclose from sklearn.utils.arrayfuncs import _all_with_any_reduction_axis_1, min_pos def test_min_pos(): # Check that min_pos returns a positive value and that it's consistent # between float and double X = np.random.RandomState(...
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/utils/tests/test_unique.py
sklearn/utils/tests/test_unique.py
import numpy as np from numpy.testing import assert_array_equal from sklearn.utils._unique import attach_unique, cached_unique from sklearn.utils.validation import check_array def test_attach_unique_attaches_unique_to_array(): arr = np.array([1, 2, 2, 3, 4, 4, 5]) arr_ = attach_unique(arr) assert_array_e...
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/utils/tests/test_param_validation.py
sklearn/utils/tests/test_param_validation.py
from numbers import Integral, Real import numpy as np import pytest from scipy.sparse import csr_matrix from sklearn._config import config_context, get_config from sklearn.base import BaseEstimator, _fit_context from sklearn.model_selection import LeaveOneOut from sklearn.utils import deprecated 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/utils/tests/test_multiclass.py
sklearn/utils/tests/test_multiclass.py
import warnings from itertools import product import numpy as np import pytest from scipy.sparse import issparse from sklearn import config_context, datasets from sklearn.model_selection import ShuffleSplit from sklearn.svm import SVC from sklearn.utils._array_api import ( _get_namespace_device_dtype_ids, yie...
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/utils/tests/test_chunking.py
sklearn/utils/tests/test_chunking.py
import warnings from itertools import chain import pytest from sklearn import config_context from sklearn.utils._chunking import gen_even_slices, get_chunk_n_rows from sklearn.utils._testing import assert_array_equal def test_gen_even_slices(): # check that gen_even_slices contains all samples some_range = ...
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/utils/tests/test_deprecation.py
sklearn/utils/tests/test_deprecation.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import pickle from inspect import signature import pytest from sklearn.utils.deprecation import _is_deprecated, deprecated @deprecated("qwerty") class MockClass1: pass class MockClass2: @deprecated("mockclass2_method") 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/utils/tests/test_stats.py
sklearn/utils/tests/test_stats.py
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from pytest import approx from sklearn._config import config_context from sklearn.utils._array_api import ( _convert_to_numpy, get_namespace, yield_namespace_device_dtype_combinations, ) from sklearn.utils._array...
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/utils/tests/test_indexing.py
sklearn/utils/tests/test_indexing.py
import warnings from copy import copy from unittest import SkipTest import numpy as np import pytest from scipy.stats import kstest import sklearn from sklearn.externals._packaging.version import parse as parse_version from sklearn.utils import _safe_indexing, resample, shuffle from sklearn.utils._array_api 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/utils/tests/test_tags.py
sklearn/utils/tests/test_tags.py
from dataclasses import dataclass, fields import numpy as np import pytest from sklearn.base import ( BaseEstimator, ClassifierMixin, RegressorMixin, TransformerMixin, ) from sklearn.pipeline import Pipeline from sklearn.utils import ( Tags, get_tags, ) from sklearn.utils.estimator_checks 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/utils/tests/test_random.py
sklearn/utils/tests/test_random.py
import numpy as np import pytest import scipy.sparse as sp from numpy.testing import assert_array_almost_equal from scipy.special import comb from sklearn.utils._random import _our_rand_r_py from sklearn.utils.random import _random_choice_csc, sample_without_replacement ##############################################...
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/utils/tests/test_murmurhash.py
sklearn/utils/tests/test_murmurhash.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.utils.murmurhash import murmurhash3_32 def test_mmhash3_int(): assert murmurhash3_32(3) == 847579505 assert murmurhash3_32(3,...
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/utils/tests/test_pprint.py
sklearn/utils/tests/test_pprint.py
import re from pprint import PrettyPrinter import numpy as np import pytest from sklearn import config_context from sklearn.base import BaseEstimator, TransformerMixin from sklearn.feature_selection import SelectKBest, chi2 from sklearn.linear_model import LogisticRegressionCV from sklearn.pipeline import make_pipeli...
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/utils/tests/test_estimator_checks.py
sklearn/utils/tests/test_estimator_checks.py
# We can not use pytest here, because we run # build_tools/azure/test_pytest_soft_dependency.sh on these # tests to make sure estimator_checks works without pytest. import importlib import re import sys import unittest import warnings from inspect import isgenerator from numbers import Integral, Real import 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/utils/tests/test_array_api.py
sklearn/utils/tests/test_array_api.py
import os from functools import partial import numpy import pytest import scipy import scipy.sparse as sp from numpy.testing import assert_allclose from sklearn._config import config_context from sklearn._loss import HalfMultinomialLoss from sklearn.base import BaseEstimator from sklearn.utils._array_api 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/utils/tests/test_missing.py
sklearn/utils/tests/test_missing.py
import numpy as np import pytest from sklearn.utils._missing import is_scalar_nan @pytest.mark.parametrize( "value, result", [ (float("nan"), True), (np.nan, True), (float(np.nan), True), (np.float32(np.nan), True), (np.float64(np.nan), True), (0, False), ...
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/utils/tests/test_parallel.py
sklearn/utils/tests/test_parallel.py
import itertools import re import time import warnings import joblib import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn import config_context, get_config from sklearn.compose import make_column_transformer from sklearn.datasets import load_iris from sklearn.ensemble import Rand...
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/utils/tests/test_mocking.py
sklearn/utils/tests/test_mocking.py
import numpy as np import pytest from numpy.testing import assert_array_equal from scipy import sparse from sklearn.datasets import load_iris from sklearn.utils import _safe_indexing, check_array from sklearn.utils._mocking import ( CheckingClassifier, _MockEstimatorOnOffPrediction, ) from sklearn.utils._testi...
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/utils/tests/test_fast_dict.py
sklearn/utils/tests/test_fast_dict.py
"""Test fast_dict.""" import numpy as np from numpy.testing import assert_allclose, assert_array_equal from sklearn.utils._fast_dict import IntFloatDict, argmin def test_int_float_dict(): rng = np.random.RandomState(0) keys = np.unique(rng.randint(100, size=10).astype(np.intp)) values = rng.rand(len(key...
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/utils/tests/test_seq_dataset.py
sklearn/utils/tests/test_seq_dataset.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from functools import partial from itertools import product import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn.datasets import load_iris from sklearn.utils._seq_dataset import ( ArrayDataset32, ...
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/utils/tests/test_testing.py
sklearn/utils/tests/test_testing.py
import atexit import os import warnings import numpy as np import pytest from scipy import sparse from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.tree import DecisionTreeClassifier from sklearn.utils._testing import ( TempMemmap, _convert_container, _delete_folder, _g...
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/utils/tests/test_extmath.py
sklearn/utils/tests/test_extmath.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools import numpy as np import pytest from scipy import linalg, sparse from scipy.linalg import eigh from scipy.sparse.linalg import eigsh from sklearn import config_context from sklearn.datasets import make_low_rank_matrix, m...
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/utils/tests/test_shortest_path.py
sklearn/utils/tests/test_shortest_path.py
from collections import defaultdict import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.utils.graph import single_source_shortest_path_length def floyd_warshall_slow(graph, directed=False): N = graph.shape[0] # set nonzero entries to infinity graph[np.where(graph == 0)] ...
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/utils/tests/test_cython_blas.py
sklearn/utils/tests/test_cython_blas.py
import numpy as np import pytest from sklearn.utils._cython_blas import ( BLAS_Order, BLAS_Trans, _asum_memview, _axpy_memview, _copy_memview, _dot_memview, _gemm_memview, _gemv_memview, _ger_memview, _nrm2_memview, _rot_memview, _rotg_memview, _scal_memview, ) 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/utils/tests/test_fixes.py
sklearn/utils/tests/test_fixes.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from sklearn.utils._testing import assert_array_equal from sklearn.utils.fixes import _object_dtype_isnan, _smallest_admissible_index_dtype @pytest.mark.parametrize("dtype, val", ([object, 1], [object, "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/utils/tests/test_graph.py
sklearn/utils/tests/test_graph.py
import numpy as np import pytest from scipy.sparse.csgraph import connected_components from sklearn.metrics.pairwise import pairwise_distances from sklearn.neighbors import kneighbors_graph from sklearn.utils.graph import _fix_connected_components def test_fix_connected_components(): # Test that _fix_connected_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/utils/tests/test_arpack.py
sklearn/utils/tests/test_arpack.py
import pytest from numpy.testing import assert_allclose from sklearn.utils import check_random_state from sklearn.utils._arpack import _init_arpack_v0 @pytest.mark.parametrize("seed", range(100)) def test_init_arpack_v0(seed): # check that the initialization a sampling from an uniform distribution # where we...
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/utils/tests/test_response.py
sklearn/utils/tests/test_response.py
import warnings import numpy as np import pytest from sklearn.base import clone from sklearn.datasets import ( load_iris, make_classification, make_multilabel_classification, make_regression, ) from sklearn.ensemble import IsolationForest from sklearn.linear_model import ( LinearRegression, Lo...
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/utils/tests/test_mask.py
sklearn/utils/tests/test_mask.py
import pytest from sklearn.utils._mask import safe_mask from sklearn.utils.fixes import CSR_CONTAINERS from sklearn.utils.validation import check_random_state @pytest.mark.parametrize("csr_container", CSR_CONTAINERS) def test_safe_mask(csr_container): random_state = check_random_state(0) X = random_state.ran...
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/utils/tests/test_encode.py
sklearn/utils/tests/test_encode.py
import pickle import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn.utils._encode import _check_unknown, _encode, _get_counts, _unique @pytest.mark.parametrize( "values, expected", [ (np.array([2, 1, 3, 1, 3], dtype="int64"), np.array([1, 2, 3], dtype="int64")), ...
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/utils/tests/test_dataframe.py
sklearn/utils/tests/test_dataframe.py
"""Tests for dataframe detection functions.""" import numpy as np import pytest from sklearn._min_dependencies import dependent_packages from sklearn.utils._dataframe import is_df_or_series, is_pandas_df, is_polars_df from sklearn.utils._testing import _convert_container @pytest.mark.parametrize("constructor_name",...
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/utils/tests/test_plotting.py
sklearn/utils/tests/test_plotting.py
import numpy as np import pytest from sklearn.linear_model import LogisticRegression from sklearn.utils._plotting import ( _BinaryClassifierCurveDisplayMixin, _deprecate_estimator_name, _despine, _interval_max_min_ratio, _validate_score_name, _validate_style_kwargs, ) from sklearn.utils._respon...
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/utils/tests/test_typedefs.py
sklearn/utils/tests/test_typedefs.py
import numpy as np import pytest from sklearn.utils._typedefs import testing_make_array_from_typed_val @pytest.mark.parametrize( "type_t, value, expected_dtype", [ ("float64_t", 1.0, np.float64), ("float32_t", 1.0, np.float32), ("intp_t", 1, np.intp), ("int8_t", 1, np.int8), ...
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/utils/tests/__init__.py
sklearn/utils/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/utils/tests/test_validation.py
sklearn/utils/tests/test_validation.py
"""Tests for input validation functions""" import numbers import re import warnings from itertools import product from operator import itemgetter from tempfile import NamedTemporaryFile import numpy as np import pytest import scipy.sparse as sp from pytest import importorskip import sklearn from sklearn._config 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/utils/tests/test_show_versions.py
sklearn/utils/tests/test_show_versions.py
from threadpoolctl import threadpool_info from sklearn.utils._show_versions import _get_deps_info, _get_sys_info, show_versions from sklearn.utils._testing import ignore_warnings def test_get_sys_info(): sys_info = _get_sys_info() assert "python" in sys_info assert "executable" in sys_info assert "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/utils/tests/test_bunch.py
sklearn/utils/tests/test_bunch.py
import warnings import numpy as np import pytest from sklearn.utils import Bunch def test_bunch_attribute_deprecation(): """Check that bunch raises deprecation message with `__getattr__`.""" bunch = Bunch() values = np.asarray([1, 2, 3]) msg = ( "Key: 'values', is deprecated in 1.3 and will ...
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/utils/tests/test_set_output.py
sklearn/utils/tests/test_set_output.py
import importlib from collections import namedtuple import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn._config import config_context, get_config from sklearn.preprocessing import StandardScaler from sklearn.utils._set_output import ( ADAPTERS_MANAGER, ContainerAdapterPr...
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/utils/tests/test_class_weight.py
sklearn/utils/tests/test_class_weight.py
import numpy as np import pytest from numpy.testing import assert_allclose from sklearn.datasets import make_blobs from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.utils._testing import assert_almost_equal, assert_array_almost_equal from sklearn.utils.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/utils/tests/test_optimize.py
sklearn/utils/tests/test_optimize.py
import warnings import numpy as np import pytest from scipy.optimize import fmin_ncg from sklearn.exceptions import ConvergenceWarning from sklearn.utils._bunch import Bunch from sklearn.utils._testing import assert_allclose from sklearn.utils.optimize import _check_optimize_result, _newton_cg def test_newton_cg(gl...
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/utils/tests/test_user_interface.py
sklearn/utils/tests/test_user_interface.py
import string import timeit import pytest from sklearn.utils._user_interface import _message_with_time, _print_elapsed_time @pytest.mark.parametrize( ["source", "message", "is_long"], [ ("ABC", string.ascii_lowercase, False), ("ABCDEF", string.ascii_lowercase, False), ("ABC", string....
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/utils/tests/test_weight_vector.py
sklearn/utils/tests/test_weight_vector.py
import numpy as np import pytest from sklearn.utils._weight_vector import ( WeightVector32, WeightVector64, ) @pytest.mark.parametrize( "dtype, WeightVector", [ (np.float32, WeightVector32), (np.float64, WeightVector64), ], ) def test_type_invariance(dtype, WeightVector): """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/utils/tests/test_sparsefuncs.py
sklearn/utils/tests/test_sparsefuncs.py
import numpy as np import pytest import scipy.sparse as sp from numpy.random import RandomState from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy import linalg from sklearn.datasets import make_classification from sklearn.utils._testing import assert_allclose from sklearn.utils.fixes 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/utils/_repr_html/params.py
sklearn/utils/_repr_html/params.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import html import inspect import re import reprlib from collections import UserDict from functools import lru_cache from urllib.parse import quote from sklearn.externals._numpydoc import docscrape from sklearn.utils._repr_html.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/utils/_repr_html/estimator.py
sklearn/utils/_repr_html/estimator.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import html from contextlib import closing from inspect import isclass from io import StringIO from pathlib import Path from string import Template from sklearn import config_context class _IDCounter: """Generate sequential ids with ...
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/utils/_repr_html/__init__.py
sklearn/utils/_repr_html/__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/utils/_repr_html/base.py
sklearn/utils/_repr_html/base.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import itertools from sklearn import __version__ from sklearn._config import get_config from sklearn.utils.fixes import parse_version class _HTMLDocumentationLinkMixin: """Mixin class allowing to generate a link to the API documentat...
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/utils/_repr_html/tests/test_js.py
sklearn/utils/_repr_html/tests/test_js.py
import socket import threading from http.server import BaseHTTPRequestHandler, HTTPServer from pathlib import Path import pytest @pytest.fixture(scope="session", autouse=True) def check_playwright(): """Skip tests if playwright is not installed. This fixture is used by the next fixture (which is autouse) to...
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/utils/_repr_html/tests/test_params.py
sklearn/utils/_repr_html/tests/test_params.py
import re import pytest from sklearn import config_context from sklearn.utils._repr_html.params import ( ParamsDict, _generate_link_to_param_doc, _params_html_repr, _read_params, ) def test_params_dict_content(): """Check the behavior of the ParamsDict class.""" params = ParamsDict(params={"...
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/utils/_repr_html/tests/__init__.py
sklearn/utils/_repr_html/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/utils/_repr_html/tests/test_estimator.py
sklearn/utils/_repr_html/tests/test_estimator.py
import html import locale import re import types from contextlib import closing from functools import partial from io import StringIO from unittest.mock import patch import numpy as np import pytest from sklearn import config_context from sklearn.base import BaseEstimator, clone from sklearn.cluster import Agglomerat...
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/cross_decomposition/_pls.py
sklearn/cross_decomposition/_pls.py
""" The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from abc import ABCMeta, abstractmethod from numbers import Integral, Real import numpy as np from scipy.linalg import pinv, svd from sklearn.b...
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/cross_decomposition/__init__.py
sklearn/cross_decomposition/__init__.py
"""Algorithms for cross decomposition.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.cross_decomposition._pls import CCA, PLSSVD, PLSCanonical, PLSRegression __all__ = ["CCA", "PLSSVD", "PLSCanonical", "PLSRegression"]
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/cross_decomposition/tests/test_pls.py
sklearn/cross_decomposition/tests/test_pls.py
import warnings import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal from sklearn.cross_decomposition import CCA, PLSSVD, PLSCanonical, PLSRegression from sklearn.cross_decomposition._pls import ( _center_scale_xy, _get_first_singular_vector...
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/cross_decomposition/tests/__init__.py
sklearn/cross_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/linear_model/_passive_aggressive.py
sklearn/linear_model/_passive_aggressive.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Real from sklearn.base import _fit_context from sklearn.linear_model._stochastic_gradient import ( DEFAULT_EPSILON, BaseSGDClassifier, BaseSGDRegressor, ) from sklearn.utils import deprecated from sklearn.ut...
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/_base.py
sklearn/linear_model/_base.py
""" Generalized Linear Models. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from abc import ABCMeta, abstractmethod from numbers import Integral, Real import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from scipy.sparse.linalg...
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/_coordinate_descent.py
sklearn/linear_model/_coordinate_descent.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import sys import warnings from abc import ABC, abstractmethod from functools import partial from numbers import Integral, Real import numpy as np from joblib import effective_n_jobs from scipy import sparse from sklearn.ba...
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/_linear_loss.py
sklearn/linear_model/_linear_loss.py
""" Loss functions for linear models with raw_prediction = X @ coef """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np from scipy import sparse from sklearn.utils.extmath import safe_sparse_dot, squared_norm def sandwich_dot(X, W): """Compute the sandwich prod...
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/_omp.py
sklearn/linear_model/_omp.py
"""Orthogonal matching pursuit algorithms""" # 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 linalg from scipy.linalg.lapack import get_lapack_funcs from sklearn.base import M...
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/_ridge.py
sklearn/linear_model/_ridge.py
""" Ridge regression """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import warnings from abc import ABCMeta, abstractmethod from functools import partial from numbers import Integral, Real import numpy as np from scipy import linalg, optimize, sparse from scipy.spar...
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/_perceptron.py
sklearn/linear_model/_perceptron.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Real from sklearn.linear_model._stochastic_gradient import BaseSGDClassifier from sklearn.utils._param_validation import Interval, StrOptions class Perceptron(BaseSGDClassifier): """Linear perceptron classifier. ...
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/_theil_sen.py
sklearn/linear_model/_theil_sen.py
""" A Theil-Sen Estimator for Multiple Linear Regression Model """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from itertools import combinations from numbers import Integral, Real import numpy as np from joblib import effective_n_jobs from scipy import linalg 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/linear_model/_least_angle.py
sklearn/linear_model/_least_angle.py
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import sys import warnings from math import log from numbers import Integral, Real import numpy as np from scipy 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/linear_model/_stochastic_gradient.py
sklearn/linear_model/_stochastic_gradient.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause """Classification, regression and One-Class SVM using Stochastic Gradient Descent (SGD). """ import warnings from abc import ABCMeta, abstractmethod from numbers import Integral, Real import numpy as np from sklearn._loss._loss import Cy...
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/_bayes.py
sklearn/linear_model/_bayes.py
""" Various bayesian regression """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from math import log from numbers import Integral, Real import numpy as np from scipy import linalg from scipy.linalg import pinvh from sklearn.base import RegressorMixin, _fit_context from sklearn.lin...
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/_sag.py
sklearn/linear_model/_sag.py
"""Solvers for Ridge and LogisticRegression using SAG algorithm""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model._base import make_dataset from sklearn.linear_model._sag_fa...
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/__init__.py
sklearn/linear_model/__init__.py
"""A variety of linear models.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # See http://scikit-learn.sourceforge.net/modules/sgd.html and # http://scikit-learn.sourceforge.net/modules/linear_model.html for # complete documentation. from sklearn.linear_model._base import LinearRe...
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/_quantile.py
sklearn/linear_model/_quantile.py
# 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 from scipy.optimize import linprog from sklearn.base import BaseEstimator, RegressorMixin, _fit_context from sklearn.exceptions import ConvergenceWarning...
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/_logistic.py
sklearn/linear_model/_logistic.py
""" Logistic Regression """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numbers import warnings from numbers import Integral, Real import numpy as np from scipy import optimize from sklearn._loss.loss import HalfBinomialLoss, HalfMultinomialLoss from sklearn.base import _fi...
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/_huber.py
sklearn/linear_model/_huber.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Integral, Real import numpy as np from scipy import optimize from sklearn.base import BaseEstimator, RegressorMixin, _fit_context from sklearn.linear_model._base import LinearModel from sklearn.utils._mask import axis0...
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/_ransac.py
sklearn/linear_model/_ransac.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings from numbers import Integral, Real import numpy as np from sklearn.base import ( BaseEstimator, MetaEstimatorMixin, MultiOutputMixin, RegressorMixin, _fit_context, clone, ) from sklearn.exceptions 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/linear_model/tests/test_quantile.py
sklearn/linear_model/tests/test_quantile.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from pytest import approx from scipy.optimize import minimize from sklearn.datasets import make_regression from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model import HuberRegressor, ...
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_passive_aggressive.py
sklearn/linear_model/tests/test_passive_aggressive.py
import numpy as np import pytest from numpy.testing import assert_allclose from scipy.sparse import issparse from sklearn.base import ClassifierMixin from sklearn.datasets import load_iris, make_classification, make_regression from sklearn.linear_model import ( PassiveAggressiveClassifier, PassiveAggressiveReg...
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_sparse_coordinate_descent.py
sklearn/linear_model/tests/test_sparse_coordinate_descent.py
import numpy as np import pytest import scipy.sparse as sp from numpy.testing import assert_allclose from sklearn.datasets import make_regression from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model import ElasticNet, ElasticNetCV, Lasso, LassoCV from sklearn.utils._testing import ( assert_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/linear_model/tests/test_omp.py
sklearn/linear_model/tests/test_omp.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import numpy as np import pytest from sklearn.datasets import make_sparse_coded_signal from sklearn.linear_model import ( LinearRegression, OrthogonalMatchingPursuit, OrthogonalMatchingPursuitCV, orthogonal_mp, orthogo...
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_common.py
sklearn/linear_model/tests/test_common.py
# SPDX-License-Identifier: BSD-3-Clause import inspect import numpy as np import pytest from sklearn.base import clone, is_classifier from sklearn.datasets import make_classification, make_low_rank_matrix, make_regression from sklearn.linear_model import ( ARDRegression, BayesianRidge, ElasticNet, El...
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_least_angle.py
sklearn/linear_model/tests/test_least_angle.py
import warnings import numpy as np import pytest from scipy import linalg from sklearn import datasets, linear_model from sklearn.base import clone from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model import ( Lars, LarsCV, LassoLars, LassoLarsCV, LassoLarsIC, lars_path,...
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_base.py
sklearn/linear_model/tests/test_base.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings import numpy as np import pytest from scipy import linalg, sparse from sklearn.datasets import load_iris, make_regression, make_sparse_uncorrelated from sklearn.linear_model import LinearRegression from sklearn.linear_mode...
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_sgd.py
sklearn/linear_model/tests/test_sgd.py
import pickle import warnings from unittest.mock import Mock import joblib import numpy as np import pytest import scipy.sparse as sp from scipy.optimize import minimize from sklearn import datasets, linear_model, metrics from sklearn.base import clone, is_classifier from sklearn.datasets import make_blobs from sklea...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
true