repository stringclasses 11
values | repo_id stringlengths 1 3 | target_module_path stringlengths 16 72 | prompt stringlengths 298 21.7k | relavent_test_path stringlengths 50 99 | full_function stringlengths 336 33.8k | function_name stringlengths 2 51 | content_class stringclasses 3
values | external_dependencies stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
scikit-learn | 22 | sklearn/compose/_column_transformer.py | def fit_transform(self, X, y=None, **params):
"""Fit all transformers, transform the data and concatenate results.
Parameters
----------
X : {array-like, dataframe} of shape (n_samples, n_features)
Input data, of which specified subsets are used to fit the
tr... | /usr/src/app/target_test_cases/failed_tests_ColumnTransformer.fit_transform.txt | def fit_transform(self, X, y=None, **params):
"""Fit all transformers, transform the data and concatenate results.
Parameters
----------
X : {array-like, dataframe} of shape (n_samples, n_features)
Input data, of which specified subsets are used to fit the
tr... | ColumnTransformer.fit_transform | repository-level | external |
scikit-learn | 23 | sklearn/compose/_column_transformer.py | def get_feature_names_out(self, input_features=None):
"""Get output feature names for transformation.
Parameters
----------
input_features : array-like of str or None, default=None
Input features.
- If `input_features` is `None`, then `feature_names_in_` is
... | /usr/src/app/target_test_cases/failed_tests_ColumnTransformer.get_feature_names_out.txt | def get_feature_names_out(self, input_features=None):
"""Get output feature names for transformation.
Parameters
----------
input_features : array-like of str or None, default=None
Input features.
- If `input_features` is `None`, then `feature_names_in_` is
... | ColumnTransformer.get_feature_names_out | repository-level | external |
scikit-learn | 24 | sklearn/compose/_column_transformer.py | def get_metadata_routing(self):
"""Get metadata routing of this object.
Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.
.. versionadded:: 1.4
Returns
-------
routing : MetadataRouter
A :class:`~sklearn.utils... | /usr/src/app/target_test_cases/failed_tests_ColumnTransformer.get_metadata_routing.txt | def get_metadata_routing(self):
"""Get metadata routing of this object.
Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.
.. versionadded:: 1.4
Returns
-------
routing : MetadataRouter
A :class:`~sklearn.utils... | ColumnTransformer.get_metadata_routing | repository-level | non_external |
scikit-learn | 25 | sklearn/compose/_column_transformer.py | def set_output(self, *, transform=None):
"""Set the output container when `"transform"` and `"fit_transform"` are called.
Calling `set_output` will set the output of all estimators in `transformers`
and `transformers_`.
Parameters
----------
transform : {"default", ... | /usr/src/app/target_test_cases/failed_tests_ColumnTransformer.set_output.txt | def set_output(self, *, transform=None):
"""Set the output container when `"transform"` and `"fit_transform"` are called.
Calling `set_output` will set the output of all estimators in `transformers`
and `transformers_`.
Parameters
----------
transform : {"default", ... | ColumnTransformer.set_output | repository-level | non_external |
scikit-learn | 26 | sklearn/compose/_column_transformer.py | def transform(self, X, **params):
"""Transform X separately by each transformer, concatenate results.
Parameters
----------
X : {array-like, dataframe} of shape (n_samples, n_features)
The data to be transformed by subset.
**params : dict, default=None
... | /usr/src/app/target_test_cases/failed_tests_ColumnTransformer.transform.txt | def transform(self, X, **params):
"""Transform X separately by each transformer, concatenate results.
Parameters
----------
X : {array-like, dataframe} of shape (n_samples, n_features)
The data to be transformed by subset.
**params : dict, default=None
... | ColumnTransformer.transform | repository-level | external |
scikit-learn | 27 | sklearn/cluster/_dbscan.py | def fit(self, X, y=None, sample_weight=None):
"""Perform DBSCAN clustering from features, or distance matrix.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features), or \
(n_samples, n_samples)
Training instances to cluster, or... | /usr/src/app/target_test_cases/failed_tests_DBSCAN.fit.txt | def fit(self, X, y=None, sample_weight=None):
"""Perform DBSCAN clustering from features, or distance matrix.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features), or \
(n_samples, n_samples)
Training instances to cluster, or... | DBSCAN.fit | repository-level | external |
scikit-learn | 28 | sklearn/tree/_classes.py | def fit(self, X, y, sample_weight=None, check_input=True):
"""Build a decision tree classifier from the training set (X, y).
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The training input samples. Internally, it will be converte... | /usr/src/app/target_test_cases/failed_tests_DecisionTreeClassifier.fit.txt | def fit(self, X, y, sample_weight=None, check_input=True):
"""Build a decision tree classifier from the training set (X, y).
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The training input samples. Internally, it will be converte... | DecisionTreeClassifier.fit | repository-level | non_external |
scikit-learn | 29 | sklearn/tree/_classes.py | def predict_proba(self, X, check_input=True):
"""Predict class probabilities of the input samples X.
The predicted class probability is the fraction of samples of the same
class in a leaf.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_... | /usr/src/app/target_test_cases/failed_tests_DecisionTreeClassifier.predict_proba.txt | def predict_proba(self, X, check_input=True):
"""Predict class probabilities of the input samples X.
The predicted class probability is the fraction of samples of the same
class in a leaf.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_... | DecisionTreeClassifier.predict_proba | repository-level | non_external |
scikit-learn | 30 | sklearn/tree/_classes.py | def fit(self, X, y, sample_weight=None, check_input=True):
"""Build a decision tree regressor from the training set (X, y).
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The training input samples. Internally, it will be converted... | /usr/src/app/target_test_cases/failed_tests_DecisionTreeRegressor.fit.txt | def fit(self, X, y, sample_weight=None, check_input=True):
"""Build a decision tree regressor from the training set (X, y).
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The training input samples. Internally, it will be converted... | DecisionTreeRegressor.fit | repository-level | non_external |
scikit-learn | 31 | sklearn/feature_extraction/_dict_vectorizer.py | def fit(self, X, y=None):
"""Learn a list of feature name -> indices mappings.
Parameters
----------
X : Mapping or iterable over Mappings
Dict(s) or Mapping(s) from feature names (arbitrary Python
objects) to feature values (strings or convertible to dtype).... | /usr/src/app/target_test_cases/failed_tests_DictVectorizer.fit.txt | def fit(self, X, y=None):
"""Learn a list of feature name -> indices mappings.
Parameters
----------
X : Mapping or iterable over Mappings
Dict(s) or Mapping(s) from feature names (arbitrary Python
objects) to feature values (strings or convertible to dtype).... | DictVectorizer.fit | repository-level | external |
scikit-learn | 32 | sklearn/feature_extraction/_dict_vectorizer.py | def inverse_transform(self, X, dict_type=dict):
"""Transform array or sparse matrix X back to feature mappings.
X must have been produced by this DictVectorizer's transform or
fit_transform method; it may only have passed through transformers
that preserve the number of features and... | /usr/src/app/target_test_cases/failed_tests_DictVectorizer.inverse_transform.txt | def inverse_transform(self, X, dict_type=dict):
"""Transform array or sparse matrix X back to feature mappings.
X must have been produced by this DictVectorizer's transform or
fit_transform method; it may only have passed through transformers
that preserve the number of features and... | DictVectorizer.inverse_transform | repository-level | external |
scikit-learn | 33 | sklearn/dummy.py | def fit(self, X, y, sample_weight=None):
"""Fit the baseline classifier.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
Target values.
sampl... | /usr/src/app/target_test_cases/failed_tests_DummyClassifier.fit.txt | def fit(self, X, y, sample_weight=None):
"""Fit the baseline classifier.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
Target values.
sampl... | DummyClassifier.fit | repository-level | external |
scikit-learn | 34 | sklearn/dummy.py | def predict(self, X):
"""Perform classification on test vectors X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test data.
Returns
-------
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
Predict... | /usr/src/app/target_test_cases/failed_tests_DummyClassifier.predict.txt | def predict(self, X):
"""Perform classification on test vectors X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test data.
Returns
-------
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
Predict... | DummyClassifier.predict | repository-level | external |
scikit-learn | 35 | sklearn/dummy.py | def predict_proba(self, X):
"""
Return probability estimates for the test vectors X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test data.
Returns
-------
P : ndarray of shape (n_samples, n_classes) or list of s... | /usr/src/app/target_test_cases/failed_tests_DummyClassifier.predict_proba.txt | def predict_proba(self, X):
"""
Return probability estimates for the test vectors X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test data.
Returns
-------
P : ndarray of shape (n_samples, n_classes) or list of s... | DummyClassifier.predict_proba | repository-level | external |
scikit-learn | 36 | sklearn/dummy.py | def fit(self, X, y, sample_weight=None):
"""Fit the random regressor.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
Target values.
sample_w... | /usr/src/app/target_test_cases/failed_tests_DummyRegressor.fit.txt | def fit(self, X, y, sample_weight=None):
"""Fit the random regressor.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
Target values.
sample_w... | DummyRegressor.fit | repository-level | external |
scikit-learn | 37 | sklearn/dummy.py | def predict(self, X, return_std=False):
"""Perform classification on test vectors X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test data.
return_std : bool, default=False
Whether to return the standard deviation of posteri... | /usr/src/app/target_test_cases/failed_tests_DummyRegressor.predict.txt | def predict(self, X, return_std=False):
"""Perform classification on test vectors X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test data.
return_std : bool, default=False
Whether to return the standard deviation of posteri... | DummyRegressor.predict | repository-level | external |
scikit-learn | 38 | sklearn/linear_model/_coordinate_descent.py | def fit(self, X, y, sample_weight=None, check_input=True):
"""Fit model with coordinate descent.
Parameters
----------
X : {ndarray, sparse matrix, sparse array} of (n_samples, n_features)
Data.
Note that large sparse matrices and arrays requiring `int64`
... | /usr/src/app/target_test_cases/failed_tests_ElasticNet.fit.txt | def fit(self, X, y, sample_weight=None, check_input=True):
"""Fit model with coordinate descent.
Parameters
----------
X : {ndarray, sparse matrix, sparse array} of (n_samples, n_features)
Data.
Note that large sparse matrices and arrays requiring `int64`
... | ElasticNet.fit | repository-level | external |
scikit-learn | 39 | sklearn/covariance/_empirical_covariance.py | def error_norm(self, comp_cov, norm="frobenius", scaling=True, squared=True):
"""Compute the Mean Squared Error between two covariance estimators.
Parameters
----------
comp_cov : array-like of shape (n_features, n_features)
The covariance to compare with.
norm ... | /usr/src/app/target_test_cases/failed_tests_EmpiricalCovariance.error_norm.txt | def error_norm(self, comp_cov, norm="frobenius", scaling=True, squared=True):
"""Compute the Mean Squared Error between two covariance estimators.
Parameters
----------
comp_cov : array-like of shape (n_features, n_features)
The covariance to compare with.
norm ... | EmpiricalCovariance.error_norm | file-level | external |
scikit-learn | 40 | sklearn/covariance/_empirical_covariance.py | def fit(self, X, y=None):
"""Fit the maximum likelihood covariance estimator to X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples and
`n_features` is the number of features.
... | /usr/src/app/target_test_cases/failed_tests_EmpiricalCovariance.fit.txt | def fit(self, X, y=None):
"""Fit the maximum likelihood covariance estimator to X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples and
`n_features` is the number of features.
... | EmpiricalCovariance.fit | repository-level | external |
scikit-learn | 41 | sklearn/covariance/_empirical_covariance.py | def mahalanobis(self, X):
"""Compute the squared Mahalanobis distances of given observations.
Parameters
----------
X : array-like of shape (n_samples, n_features)
The observations, the Mahalanobis distances of the which we
compute. Observations are assumed t... | /usr/src/app/target_test_cases/failed_tests_EmpiricalCovariance.mahalanobis.txt | def mahalanobis(self, X):
"""Compute the squared Mahalanobis distances of given observations.
Parameters
----------
X : array-like of shape (n_samples, n_features)
The observations, the Mahalanobis distances of the which we
compute. Observations are assumed t... | EmpiricalCovariance.mahalanobis | repository-level | external |
scikit-learn | 42 | sklearn/decomposition/_factor_analysis.py | def fit(self, X, y=None):
"""Fit the FactorAnalysis model to X using SVD based approach.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : Ignored
Ignored parameter.
Returns
-------
self... | /usr/src/app/target_test_cases/failed_tests_FactorAnalysis.fit.txt | def fit(self, X, y=None):
"""Fit the FactorAnalysis model to X using SVD based approach.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : Ignored
Ignored parameter.
Returns
-------
self... | FactorAnalysis.fit | repository-level | external |
scikit-learn | 43 | sklearn/decomposition/_factor_analysis.py | def score_samples(self, X):
"""Compute the log-likelihood of each sample.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
The data.
Returns
-------
ll : ndarray of shape (n_samples,)
Log-likelihood of each sample un... | /usr/src/app/target_test_cases/failed_tests_FactorAnalysis.score_samples.txt | def score_samples(self, X):
"""Compute the log-likelihood of each sample.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
The data.
Returns
-------
ll : ndarray of shape (n_samples,)
Log-likelihood of each sample un... | FactorAnalysis.score_samples | repository-level | external |
scikit-learn | 44 | sklearn/decomposition/_factor_analysis.py | def transform(self, X):
"""Apply dimensionality reduction to X using the model.
Compute the expected mean of the latent variables.
See Barber, 21.2.33 (or Bishop, 12.66).
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data... | /usr/src/app/target_test_cases/failed_tests_FactorAnalysis.transform.txt | def transform(self, X):
"""Apply dimensionality reduction to X using the model.
Compute the expected mean of the latent variables.
See Barber, 21.2.33 (or Bishop, 12.66).
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data... | FactorAnalysis.transform | repository-level | external |
scikit-learn | 45 | sklearn/decomposition/_fastica.py | def transform(self, X, copy=True):
"""Recover the sources from X (apply the unmixing matrix).
Parameters
----------
X : array-like of shape (n_samples, n_features)
Data to transform, where `n_samples` is the number of samples
and `n_features` is the number of... | /usr/src/app/target_test_cases/failed_tests_FastICA.transform.txt | def transform(self, X, copy=True):
"""Recover the sources from X (apply the unmixing matrix).
Parameters
----------
X : array-like of shape (n_samples, n_features)
Data to transform, where `n_samples` is the number of samples
and `n_features` is the number of... | FastICA.transform | repository-level | external |
scikit-learn | 46 | sklearn/feature_extraction/_hash.py | def transform(self, raw_X):
"""Transform a sequence of instances to a scipy.sparse matrix.
Parameters
----------
raw_X : iterable over iterable over raw features, length = n_samples
Samples. Each sample must be iterable an (e.g., a list or tuple)
containing/g... | /usr/src/app/target_test_cases/failed_tests_FeatureHasher.transform.txt | def transform(self, raw_X):
"""Transform a sequence of instances to a scipy.sparse matrix.
Parameters
----------
raw_X : iterable over iterable over raw features, length = n_samples
Samples. Each sample must be iterable an (e.g., a list or tuple)
containing/g... | FeatureHasher.transform | file-level | external |
scikit-learn | 47 | sklearn/pipeline.py | def fit(self, X, y=None, **fit_params):
"""Fit all transformers using X.
Parameters
----------
X : iterable or array-like, depending on transformers
Input data, used to fit transformers.
y : array-like of shape (n_samples, n_outputs), default=None
Ta... | /usr/src/app/target_test_cases/failed_tests_FeatureUnion.fit.txt | def fit(self, X, y=None, **fit_params):
"""Fit all transformers using X.
Parameters
----------
X : iterable or array-like, depending on transformers
Input data, used to fit transformers.
y : array-like of shape (n_samples, n_outputs), default=None
Ta... | FeatureUnion.fit | repository-level | non_external |
scikit-learn | 48 | sklearn/pipeline.py | def fit_transform(self, X, y=None, **params):
"""Fit all transformers, transform the data and concatenate results.
Parameters
----------
X : iterable or array-like, depending on transformers
Input data to be transformed.
y : array-like of shape (n_samples, n_out... | /usr/src/app/target_test_cases/failed_tests_FeatureUnion.fit_transform.txt | def fit_transform(self, X, y=None, **params):
"""Fit all transformers, transform the data and concatenate results.
Parameters
----------
X : iterable or array-like, depending on transformers
Input data to be transformed.
y : array-like of shape (n_samples, n_out... | FeatureUnion.fit_transform | repository-level | external |
scikit-learn | 49 | sklearn/pipeline.py | def get_feature_names_out(self, input_features=None):
"""Get output feature names for transformation.
Parameters
----------
input_features : array-like of str or None, default=None
Input features.
Returns
-------
feature_names_out : ndarray of st... | /usr/src/app/target_test_cases/failed_tests_FeatureUnion.get_feature_names_out.txt | def get_feature_names_out(self, input_features=None):
"""Get output feature names for transformation.
Parameters
----------
input_features : array-like of str or None, default=None
Input features.
Returns
-------
feature_names_out : ndarray of st... | FeatureUnion.get_feature_names_out | file-level | non_external |
scikit-learn | 50 | sklearn/pipeline.py | def get_metadata_routing(self):
"""Get metadata routing of this object.
Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.
.. versionadded:: 1.5
Returns
-------
routing : MetadataRouter
A :class:`~sklearn.utils... | /usr/src/app/target_test_cases/failed_tests_FeatureUnion.get_metadata_routing.txt | def get_metadata_routing(self):
"""Get metadata routing of this object.
Please check :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.
.. versionadded:: 1.5
Returns
-------
routing : MetadataRouter
A :class:`~sklearn.utils... | FeatureUnion.get_metadata_routing | repository-level | non_external |
scikit-learn | 51 | sklearn/pipeline.py | def transform(self, X, **params):
"""Transform X separately by each transformer, concatenate results.
Parameters
----------
X : iterable or array-like, depending on transformers
Input data to be transformed.
**params : dict, default=None
Parameters ... | /usr/src/app/target_test_cases/failed_tests_FeatureUnion.transform.txt | def transform(self, X, **params):
"""Transform X separately by each transformer, concatenate results.
Parameters
----------
X : iterable or array-like, depending on transformers
Input data to be transformed.
**params : dict, default=None
Parameters ... | FeatureUnion.transform | repository-level | external |
scikit-learn | 52 | sklearn/model_selection/_classification_threshold.py | def predict(self, X):
"""Predict the target of new samples.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The samples, as accepted by `estimator.predict`.
Returns
-------
class_labels : ndarray of shape (n... | /usr/src/app/target_test_cases/failed_tests_FixedThresholdClassifier.predict.txt | def predict(self, X):
"""Predict the target of new samples.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The samples, as accepted by `estimator.predict`.
Returns
-------
class_labels : ndarray of shape (n... | FixedThresholdClassifier.predict | repository-level | non_external |
scikit-learn | 53 | sklearn/preprocessing/_function_transformer.py | def transform(self, X):
"""Transform X using the forward function.
Parameters
----------
X : {array-like, sparse-matrix} of shape (n_samples, n_features) \
if `validate=True` else any object that `func` can handle
Input array.
Returns
---... | /usr/src/app/target_test_cases/failed_tests_FunctionTransformer.transform.txt | def transform(self, X):
"""Transform X using the forward function.
Parameters
----------
X : {array-like, sparse-matrix} of shape (n_samples, n_features) \
if `validate=True` else any object that `func` can handle
Input array.
Returns
---... | FunctionTransformer.transform | repository-level | external |
scikit-learn | 54 | sklearn/gaussian_process/_gpc.py | def fit(self, X, y):
"""Fit Gaussian process classification model.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Feature vectors or other representations of training data.
y : array-like of shape (n_samples,)
... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessClassifier.fit.txt | def fit(self, X, y):
"""Fit Gaussian process classification model.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Feature vectors or other representations of training data.
y : array-like of shape (n_samples,)
... | GaussianProcessClassifier.fit | repository-level | external |
scikit-learn | 55 | sklearn/gaussian_process/_gpc.py | def log_marginal_likelihood(
self, theta=None, eval_gradient=False, clone_kernel=True
):
"""Return log-marginal likelihood of theta for training data.
In the case of multi-class classification, the mean log-marginal
likelihood of the one-versus-rest classifiers are returned.
... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessClassifier.log_marginal_likelihood.txt | def log_marginal_likelihood(
self, theta=None, eval_gradient=False, clone_kernel=True
):
"""Return log-marginal likelihood of theta for training data.
In the case of multi-class classification, the mean log-marginal
likelihood of the one-versus-rest classifiers are returned.
... | GaussianProcessClassifier.log_marginal_likelihood | repository-level | external |
scikit-learn | 56 | sklearn/gaussian_process/_gpc.py | def predict_proba(self, X):
"""Return probability estimates for the test vector X.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Query points where the GP is evaluated for classification.
Returns
-------
... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessClassifier.predict_proba.txt | def predict_proba(self, X):
"""Return probability estimates for the test vector X.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Query points where the GP is evaluated for classification.
Returns
-------
... | GaussianProcessClassifier.predict_proba | repository-level | non_external |
scikit-learn | 57 | sklearn/gaussian_process/_gpr.py | def fit(self, X, y):
"""Fit Gaussian process regression model.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Feature vectors or other representations of training data.
y : array-like of shape (n_samples,) or (n_samples, ... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessRegressor.fit.txt | def fit(self, X, y):
"""Fit Gaussian process regression model.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Feature vectors or other representations of training data.
y : array-like of shape (n_samples,) or (n_samples, ... | GaussianProcessRegressor.fit | repository-level | external |
scikit-learn | 58 | sklearn/gaussian_process/_gpr.py | def log_marginal_likelihood(
self, theta=None, eval_gradient=False, clone_kernel=True
):
"""Return log-marginal likelihood of theta for training data.
Parameters
----------
theta : array-like of shape (n_kernel_params,) default=None
Kernel hyperparameters for... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessRegressor.log_marginal_likelihood.txt | def log_marginal_likelihood(
self, theta=None, eval_gradient=False, clone_kernel=True
):
"""Return log-marginal likelihood of theta for training data.
Parameters
----------
theta : array-like of shape (n_kernel_params,) default=None
Kernel hyperparameters for... | GaussianProcessRegressor.log_marginal_likelihood | file-level | external |
scikit-learn | 59 | sklearn/gaussian_process/_gpr.py | def predict(self, X, return_std=False, return_cov=False):
"""Predict using the Gaussian process regression model.
We can also predict based on an unfitted model by using the GP prior.
In addition to the mean of the predictive distribution, optionally also
returns its standard deviat... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessRegressor.predict.txt | def predict(self, X, return_std=False, return_cov=False):
"""Predict using the Gaussian process regression model.
We can also predict based on an unfitted model by using the GP prior.
In addition to the mean of the predictive distribution, optionally also
returns its standard deviat... | GaussianProcessRegressor.predict | repository-level | external |
scikit-learn | 60 | sklearn/gaussian_process/_gpr.py | def sample_y(self, X, n_samples=1, random_state=0):
"""Draw samples from Gaussian process and evaluate at X.
Parameters
----------
X : array-like of shape (n_samples_X, n_features) or list of object
Query points where the GP is evaluated.
n_samples : int, defaul... | /usr/src/app/target_test_cases/failed_tests_GaussianProcessRegressor.sample_y.txt | def sample_y(self, X, n_samples=1, random_state=0):
"""Draw samples from Gaussian process and evaluate at X.
Parameters
----------
X : array-like of shape (n_samples_X, n_features) or list of object
Query points where the GP is evaluated.
n_samples : int, defaul... | GaussianProcessRegressor.sample_y | repository-level | external |
scikit-learn | 61 | sklearn/ensemble/_gb.py | def decision_function(self, X):
"""Compute the decision function of ``X``.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samples. Internally, it will be converted to
``dtype=np.float32`` and if a sparse matri... | /usr/src/app/target_test_cases/failed_tests_GradientBoostingClassifier.decision_function.txt | def decision_function(self, X):
"""Compute the decision function of ``X``.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samples. Internally, it will be converted to
``dtype=np.float32`` and if a sparse matri... | GradientBoostingClassifier.decision_function | repository-level | non_external |
scikit-learn | 62 | sklearn/ensemble/_gb.py | def staged_predict(self, X):
"""Predict class at each stage for X.
This method allows monitoring (i.e. determine error on testing set)
after each stage.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samp... | /usr/src/app/target_test_cases/failed_tests_GradientBoostingClassifier.staged_predict.txt | def staged_predict(self, X):
"""Predict class at each stage for X.
This method allows monitoring (i.e. determine error on testing set)
after each stage.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samp... | GradientBoostingClassifier.staged_predict | file-level | external |
scikit-learn | 63 | sklearn/ensemble/_gb.py | def staged_predict_proba(self, X):
"""Predict class probabilities at each stage for X.
This method allows monitoring (i.e. determine error on testing set)
after each stage.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
... | /usr/src/app/target_test_cases/failed_tests_GradientBoostingClassifier.staged_predict_proba.txt | def staged_predict_proba(self, X):
"""Predict class probabilities at each stage for X.
This method allows monitoring (i.e. determine error on testing set)
after each stage.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
... | GradientBoostingClassifier.staged_predict_proba | repository-level | non_external |
scikit-learn | 64 | sklearn/linear_model/_huber.py | def fit(self, X, y, sample_weight=None):
"""Fit the model according to the given training data.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples and
`n_features` is the number of f... | /usr/src/app/target_test_cases/failed_tests_HuberRegressor.fit.txt | def fit(self, X, y, sample_weight=None):
"""Fit the model according to the given training data.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples and
`n_features` is the number of f... | HuberRegressor.fit | repository-level | external |
scikit-learn | 65 | sklearn/decomposition/_incremental_pca.py | def fit(self, X, y=None):
"""Fit the model with X, using minibatches of size batch_size.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples and
`n_features` is the n... | /usr/src/app/target_test_cases/failed_tests_IncrementalPCA.fit.txt | def fit(self, X, y=None):
"""Fit the model with X, using minibatches of size batch_size.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples and
`n_features` is the n... | IncrementalPCA.fit | repository-level | external |
scikit-learn | 66 | sklearn/decomposition/_incremental_pca.py | def partial_fit(self, X, y=None, check_input=True):
"""Incremental fit with X. All of X is processed as a single batch.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples and
`n_feat... | /usr/src/app/target_test_cases/failed_tests_IncrementalPCA.partial_fit.txt | def partial_fit(self, X, y=None, check_input=True):
"""Incremental fit with X. All of X is processed as a single batch.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples and
`n_feat... | IncrementalPCA.partial_fit | repository-level | external |
scikit-learn | 67 | sklearn/ensemble/_iforest.py | def fit(self, X, y=None, sample_weight=None):
"""
Fit estimator.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samples. Use ``dtype=np.float32`` for maximum
efficiency. Sparse matrices are also suppor... | /usr/src/app/target_test_cases/failed_tests_IsolationForest.fit.txt | def fit(self, X, y=None, sample_weight=None):
"""
Fit estimator.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input samples. Use ``dtype=np.float32`` for maximum
efficiency. Sparse matrices are also suppor... | IsolationForest.fit | repository-level | external |
scikit-learn | 68 | sklearn/manifold/_isomap.py | def transform(self, X):
"""Transform X.
This is implemented by linking the points X into the graph of geodesic
distances of the training data. First the `n_neighbors` nearest
neighbors of X are found in the training data, and from these the
shortest geodesic distances from e... | /usr/src/app/target_test_cases/failed_tests_Isomap.transform.txt | def transform(self, X):
"""Transform X.
This is implemented by linking the points X into the graph of geodesic
distances of the training data. First the `n_neighbors` nearest
neighbors of X are found in the training data, and from these the
shortest geodesic distances from e... | Isomap.transform | repository-level | external |
scikit-learn | 69 | sklearn/isotonic.py | def fit(self, X, y, sample_weight=None):
"""Fit the model using X, y as training data.
Parameters
----------
X : array-like of shape (n_samples,) or (n_samples, 1)
Training data.
.. versionchanged:: 0.24
Also accepts 2d array with 1 feature.
... | /usr/src/app/target_test_cases/failed_tests_IsotonicRegression.fit.txt | def fit(self, X, y, sample_weight=None):
"""Fit the model using X, y as training data.
Parameters
----------
X : array-like of shape (n_samples,) or (n_samples, 1)
Training data.
.. versionchanged:: 0.24
Also accepts 2d array with 1 feature.
... | IsotonicRegression.fit | repository-level | external |
scikit-learn | 70 | sklearn/impute/_iterative.py | def fit_transform(self, X, y=None, **params):
"""Fit the imputer on `X` and return the transformed `X`.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number o... | /usr/src/app/target_test_cases/failed_tests_IterativeImputer.fit_transform.txt | def fit_transform(self, X, y=None, **params):
"""Fit the imputer on `X` and return the transformed `X`.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number o... | IterativeImputer.fit_transform | repository-level | external |
scikit-learn | 71 | sklearn/impute/_iterative.py | def transform(self, X):
"""Impute all missing values in `X`.
Note that this is stochastic, and that if `random_state` is not fixed,
repeated calls, or permuted input, results will differ.
Parameters
----------
X : array-like of shape (n_samples, n_features)
... | /usr/src/app/target_test_cases/failed_tests_IterativeImputer.transform.txt | def transform(self, X):
"""Impute all missing values in `X`.
Note that this is stochastic, and that if `random_state` is not fixed,
repeated calls, or permuted input, results will differ.
Parameters
----------
X : array-like of shape (n_samples, n_features)
... | IterativeImputer.transform | repository-level | external |
scikit-learn | 72 | sklearn/preprocessing/_discretization.py | def fit(self, X, y=None, sample_weight=None):
"""
Fit the estimator.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Data to be discretized.
y : None
Ignored. This parameter exists only for compatibility with
... | /usr/src/app/target_test_cases/failed_tests_KBinsDiscretizer.fit.txt | def fit(self, X, y=None, sample_weight=None):
"""
Fit the estimator.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Data to be discretized.
y : None
Ignored. This parameter exists only for compatibility with
... | KBinsDiscretizer.fit | repository-level | external |
scikit-learn | 73 | sklearn/preprocessing/_discretization.py | def inverse_transform(self, X=None, *, Xt=None):
"""
Transform discretized data back to original feature space.
Note that this function does not regenerate the original data
due to discretization rounding.
Parameters
----------
X : array-like of shape (n_sam... | /usr/src/app/target_test_cases/failed_tests_KBinsDiscretizer.inverse_transform.txt | def inverse_transform(self, X=None, *, Xt=None):
"""
Transform discretized data back to original feature space.
Note that this function does not regenerate the original data
due to discretization rounding.
Parameters
----------
X : array-like of shape (n_sam... | KBinsDiscretizer.inverse_transform | repository-level | external |
scikit-learn | 74 | sklearn/preprocessing/_discretization.py | def transform(self, X):
"""
Discretize the data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Data to be discretized.
Returns
-------
Xt : {ndarray, sparse matrix}, dtype={np.float32, np.float64}
Data ... | /usr/src/app/target_test_cases/failed_tests_KBinsDiscretizer.transform.txt | def transform(self, X):
"""
Discretize the data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Data to be discretized.
Returns
-------
Xt : {ndarray, sparse matrix}, dtype={np.float32, np.float64}
Data ... | KBinsDiscretizer.transform | repository-level | external |
scikit-learn | 75 | sklearn/cluster/_kmeans.py | def fit(self, X, y=None, sample_weight=None):
"""Compute k-means clustering.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data
will be converted to C ordering, ... | /usr/src/app/target_test_cases/failed_tests_KMeans.fit.txt | def fit(self, X, y=None, sample_weight=None):
"""Compute k-means clustering.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data
will be converted to C ordering, ... | KMeans.fit | repository-level | external |
scikit-learn | 76 | sklearn/impute/_knn.py | def fit(self, X, y=None):
"""Fit the imputer on X.
Parameters
----------
X : array-like shape of (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number of features.
y : Ignored
Not us... | /usr/src/app/target_test_cases/failed_tests_KNNImputer.fit.txt | def fit(self, X, y=None):
"""Fit the imputer on X.
Parameters
----------
X : array-like shape of (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number of features.
y : Ignored
Not us... | KNNImputer.fit | repository-level | external |
scikit-learn | 77 | sklearn/impute/_knn.py | def transform(self, X):
"""Impute all missing values in X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
The input data to complete.
Returns
-------
X : array-like of shape (n_samples, n_output_features)
The im... | /usr/src/app/target_test_cases/failed_tests_KNNImputer.transform.txt | def transform(self, X):
"""Impute all missing values in X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
The input data to complete.
Returns
-------
X : array-like of shape (n_samples, n_output_features)
The im... | KNNImputer.transform | repository-level | external |
scikit-learn | 78 | sklearn/neighbors/_classification.py | def predict(self, X):
"""Predict the class labels for the provided data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_queries, n_features), \
or (n_queries, n_indexed) if metric == 'precomputed'
Test samples.
Returns
... | /usr/src/app/target_test_cases/failed_tests_KNeighborsClassifier.predict.txt | def predict(self, X):
"""Predict the class labels for the provided data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_queries, n_features), \
or (n_queries, n_indexed) if metric == 'precomputed'
Test samples.
Returns
... | KNeighborsClassifier.predict | repository-level | external |
scikit-learn | 79 | sklearn/neighbors/_regression.py | def predict(self, X):
"""Predict the target for the provided data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_queries, n_features), \
or (n_queries, n_indexed) if metric == 'precomputed'
Test samples.
Returns
------... | /usr/src/app/target_test_cases/failed_tests_KNeighborsRegressor.predict.txt | def predict(self, X):
"""Predict the target for the provided data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_queries, n_features), \
or (n_queries, n_indexed) if metric == 'precomputed'
Test samples.
Returns
------... | KNeighborsRegressor.predict | repository-level | external |
scikit-learn | 80 | sklearn/neighbors/_kde.py | def fit(self, X, y=None, sample_weight=None):
"""Fit the Kernel Density model on the data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
... | /usr/src/app/target_test_cases/failed_tests_KernelDensity.fit.txt | def fit(self, X, y=None, sample_weight=None):
"""Fit the Kernel Density model on the data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
... | KernelDensity.fit | repository-level | external |
scikit-learn | 81 | sklearn/neighbors/_kde.py | def sample(self, n_samples=1, random_state=None):
"""Generate random samples from the model.
Currently, this is implemented only for gaussian and tophat kernels.
Parameters
----------
n_samples : int, default=1
Number of samples to generate.
random_stat... | /usr/src/app/target_test_cases/failed_tests_KernelDensity.sample.txt | def sample(self, n_samples=1, random_state=None):
"""Generate random samples from the model.
Currently, this is implemented only for gaussian and tophat kernels.
Parameters
----------
n_samples : int, default=1
Number of samples to generate.
random_stat... | KernelDensity.sample | repository-level | external |
scikit-learn | 82 | sklearn/neighbors/_kde.py | def score_samples(self, X):
"""Compute the log-likelihood of each sample under the model.
Parameters
----------
X : array-like of shape (n_samples, n_features)
An array of points to query. Last dimension should match dimension
of training data (n_features).
... | /usr/src/app/target_test_cases/failed_tests_KernelDensity.score_samples.txt | def score_samples(self, X):
"""Compute the log-likelihood of each sample under the model.
Parameters
----------
X : array-like of shape (n_samples, n_features)
An array of points to query. Last dimension should match dimension
of training data (n_features).
... | KernelDensity.score_samples | repository-level | external |
scikit-learn | 83 | sklearn/preprocessing/_label.py | def fit(self, y):
"""Fit label binarizer.
Parameters
----------
y : ndarray of shape (n_samples,) or (n_samples, n_classes)
Target values. The 2-d matrix should only contain 0 and 1,
represents multilabel classification.
Returns
-------
... | /usr/src/app/target_test_cases/failed_tests_LabelBinarizer.fit.txt | def fit(self, y):
"""Fit label binarizer.
Parameters
----------
y : ndarray of shape (n_samples,) or (n_samples, n_classes)
Target values. The 2-d matrix should only contain 0 and 1,
represents multilabel classification.
Returns
-------
... | LabelBinarizer.fit | repository-level | external |
scikit-learn | 84 | sklearn/preprocessing/_label.py | def inverse_transform(self, Y, threshold=None):
"""Transform binary labels back to multi-class labels.
Parameters
----------
Y : {ndarray, sparse matrix} of shape (n_samples, n_classes)
Target values. All sparse matrices are converted to CSR before
inverse tr... | /usr/src/app/target_test_cases/failed_tests_LabelBinarizer.inverse_transform.txt | def inverse_transform(self, Y, threshold=None):
"""Transform binary labels back to multi-class labels.
Parameters
----------
Y : {ndarray, sparse matrix} of shape (n_samples, n_classes)
Target values. All sparse matrices are converted to CSR before
inverse tr... | LabelBinarizer.inverse_transform | repository-level | external |
scikit-learn | 85 | sklearn/preprocessing/_label.py | def transform(self, y):
"""Transform multi-class labels to binary labels.
The output of transform is sometimes referred to by some authors as
the 1-of-K coding scheme.
Parameters
----------
y : {array, sparse matrix} of shape (n_samples,) or \
(n_sam... | /usr/src/app/target_test_cases/failed_tests_LabelBinarizer.transform.txt | def transform(self, y):
"""Transform multi-class labels to binary labels.
The output of transform is sometimes referred to by some authors as
the 1-of-K coding scheme.
Parameters
----------
y : {array, sparse matrix} of shape (n_samples,) or \
(n_sam... | LabelBinarizer.transform | repository-level | non_external |
scikit-learn | 86 | sklearn/preprocessing/_label.py | def inverse_transform(self, y):
"""Transform labels back to original encoding.
Parameters
----------
y : array-like of shape (n_samples,)
Target values.
Returns
-------
y : ndarray of shape (n_samples,)
Original encoding.
"""
| /usr/src/app/target_test_cases/failed_tests_LabelEncoder.inverse_transform.txt | def inverse_transform(self, y):
"""Transform labels back to original encoding.
Parameters
----------
y : array-like of shape (n_samples,)
Target values.
Returns
-------
y : ndarray of shape (n_samples,)
Original encoding.
"""
... | LabelEncoder.inverse_transform | repository-level | non_external |
scikit-learn | 87 | sklearn/linear_model/_least_angle.py | def fit(self, X, y, copy_X=None):
"""Fit the model using X, y as training data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,)
Target values. Will be cast to X's dtype if nece... | /usr/src/app/target_test_cases/failed_tests_LassoLarsIC.fit.txt | def fit(self, X, y, copy_X=None):
"""Fit the model using X, y as training data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,)
Target values. Will be cast to X's dtype if nece... | LassoLarsIC.fit | repository-level | external |
scikit-learn | 88 | sklearn/decomposition/_lda.py | def _perplexity_precomp_distr(self, X, doc_topic_distr=None, sub_sampling=False):
"""Calculate approximate perplexity for data X with ability to accept
precomputed doc_topic_distr
Perplexity is defined as exp(-1. * log-likelihood per word)
Parameters
----------
X : ... | /usr/src/app/target_test_cases/failed_tests_LatentDirichletAllocation._perplexity_precomp_distr.txt | def _perplexity_precomp_distr(self, X, doc_topic_distr=None, sub_sampling=False):
"""Calculate approximate perplexity for data X with ability to accept
precomputed doc_topic_distr
Perplexity is defined as exp(-1. * log-likelihood per word)
Parameters
----------
X : ... | LatentDirichletAllocation._perplexity_precomp_distr | file-level | external |
scikit-learn | 89 | sklearn/decomposition/_lda.py | def fit(self, X, y=None):
"""Learn model for the data X with variational Bayes method.
When `learning_method` is 'online', use mini-batch update.
Otherwise, use batch update.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
... | /usr/src/app/target_test_cases/failed_tests_LatentDirichletAllocation.fit.txt | def fit(self, X, y=None):
"""Learn model for the data X with variational Bayes method.
When `learning_method` is 'online', use mini-batch update.
Otherwise, use batch update.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
... | LatentDirichletAllocation.fit | repository-level | external |
scikit-learn | 90 | sklearn/decomposition/_lda.py | def partial_fit(self, X, y=None):
"""Online VB with Mini-Batch update.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Document word matrix.
y : Ignored
Not used, present here for API consistency by convention.
... | /usr/src/app/target_test_cases/failed_tests_LatentDirichletAllocation.partial_fit.txt | def partial_fit(self, X, y=None):
"""Online VB with Mini-Batch update.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Document word matrix.
y : Ignored
Not used, present here for API consistency by convention.
... | LatentDirichletAllocation.partial_fit | repository-level | external |
scikit-learn | 91 | sklearn/decomposition/_lda.py | def score(self, X, y=None):
"""Calculate approximate log-likelihood as score.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Document word matrix.
y : Ignored
Not used, present here for API consistency by conve... | /usr/src/app/target_test_cases/failed_tests_LatentDirichletAllocation.score.txt | def score(self, X, y=None):
"""Calculate approximate log-likelihood as score.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Document word matrix.
y : Ignored
Not used, present here for API consistency by conve... | LatentDirichletAllocation.score | repository-level | non_external |
scikit-learn | 92 | sklearn/decomposition/_lda.py | def transform(self, X):
"""Transform data X according to the fitted model.
.. versionchanged:: 0.18
`doc_topic_distr` is now normalized.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Document word matrix.
... | /usr/src/app/target_test_cases/failed_tests_LatentDirichletAllocation.transform.txt | def transform(self, X):
"""Transform data X according to the fitted model.
.. versionchanged:: 0.18
`doc_topic_distr` is now normalized.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Document word matrix.
... | LatentDirichletAllocation.transform | repository-level | external |
scikit-learn | 93 | sklearn/covariance/_shrunk_covariance.py | def fit(self, X, y=None):
"""Fit the Ledoit-Wolf shrunk covariance model to X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples
and `n_features` is the number of features.
... | /usr/src/app/target_test_cases/failed_tests_LedoitWolf.fit.txt | def fit(self, X, y=None):
"""Fit the Ledoit-Wolf shrunk covariance model to X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples
and `n_features` is the number of features.
... | LedoitWolf.fit | repository-level | external |
scikit-learn | 94 | sklearn/discriminant_analysis.py | def fit(self, X, y):
"""Fit the Linear Discriminant Analysis model.
.. versionchanged:: 0.19
`store_covariance` and `tol` has been moved to main constructor.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
... | /usr/src/app/target_test_cases/failed_tests_LinearDiscriminantAnalysis.fit.txt | def fit(self, X, y):
"""Fit the Linear Discriminant Analysis model.
.. versionchanged:: 0.19
`store_covariance` and `tol` has been moved to main constructor.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
... | LinearDiscriminantAnalysis.fit | repository-level | external |
scikit-learn | 95 | sklearn/discriminant_analysis.py | def predict_log_proba(self, X):
"""Estimate log probability.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input data.
Returns
-------
C : ndarray of shape (n_samples, n_classes)
Estimated log probabilities.
... | /usr/src/app/target_test_cases/failed_tests_LinearDiscriminantAnalysis.predict_log_proba.txt | def predict_log_proba(self, X):
"""Estimate log probability.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input data.
Returns
-------
C : ndarray of shape (n_samples, n_classes)
Estimated log probabilities.
... | LinearDiscriminantAnalysis.predict_log_proba | repository-level | non_external |
scikit-learn | 96 | sklearn/discriminant_analysis.py | def predict_proba(self, X):
"""Estimate probability.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input data.
Returns
-------
C : ndarray of shape (n_samples, n_classes)
Estimated probabilities.
"""
| /usr/src/app/target_test_cases/failed_tests_LinearDiscriminantAnalysis.predict_proba.txt | def predict_proba(self, X):
"""Estimate probability.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input data.
Returns
-------
C : ndarray of shape (n_samples, n_classes)
Estimated probabilities.
"""
... | LinearDiscriminantAnalysis.predict_proba | repository-level | non_external |
scikit-learn | 97 | sklearn/discriminant_analysis.py | def transform(self, X):
"""Project data to maximize class separation.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input data.
Returns
-------
X_new : ndarray of shape (n_samples, n_components) or \
(n_samples... | /usr/src/app/target_test_cases/failed_tests_LinearDiscriminantAnalysis.transform.txt | def transform(self, X):
"""Project data to maximize class separation.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Input data.
Returns
-------
X_new : ndarray of shape (n_samples, n_components) or \
(n_samples... | LinearDiscriminantAnalysis.transform | repository-level | non_external |
scikit-learn | 98 | sklearn/linear_model/_linear_loss.py | def gradient(
self,
coef,
X,
y,
sample_weight=None,
l2_reg_strength=0.0,
n_threads=1,
raw_prediction=None,
):
"""Computes the gradient w.r.t. coef.
Parameters
----------
coef : ndarray of shape (n_dof,), (n_classes,... | /usr/src/app/target_test_cases/failed_tests_LinearModelLoss.gradient.txt | def gradient(
self,
coef,
X,
y,
sample_weight=None,
l2_reg_strength=0.0,
n_threads=1,
raw_prediction=None,
):
"""Computes the gradient w.r.t. coef.
Parameters
----------
coef : ndarray of shape (n_dof,), (n_classes,... | LinearModelLoss.gradient | file-level | external |
scikit-learn | 99 | sklearn/linear_model/_linear_loss.py | def gradient_hessian(
self,
coef,
X,
y,
sample_weight=None,
l2_reg_strength=0.0,
n_threads=1,
gradient_out=None,
hessian_out=None,
raw_prediction=None,
):
"""Computes gradient and hessian w.r.t. coef.
Parameters
... | /usr/src/app/target_test_cases/failed_tests_LinearModelLoss.gradient_hessian.txt | def gradient_hessian(
self,
coef,
X,
y,
sample_weight=None,
l2_reg_strength=0.0,
n_threads=1,
gradient_out=None,
hessian_out=None,
raw_prediction=None,
):
"""Computes gradient and hessian w.r.t. coef.
Parameters
... | LinearModelLoss.gradient_hessian | file-level | external |
scikit-learn | 100 | sklearn/linear_model/_linear_loss.py | def gradient_hessian_product(
self, coef, X, y, sample_weight=None, l2_reg_strength=0.0, n_threads=1
):
"""Computes gradient and hessp (hessian product function) w.r.t. coef.
Parameters
----------
coef : ndarray of shape (n_dof,), (n_classes, n_dof) or (n_classes * n_dof... | /usr/src/app/target_test_cases/failed_tests_LinearModelLoss.gradient_hessian_product.txt | def gradient_hessian_product(
self, coef, X, y, sample_weight=None, l2_reg_strength=0.0, n_threads=1
):
"""Computes gradient and hessp (hessian product function) w.r.t. coef.
Parameters
----------
coef : ndarray of shape (n_dof,), (n_classes, n_dof) or (n_classes * n_dof... | LinearModelLoss.gradient_hessian_product | file-level | external |
scikit-learn | 101 | sklearn/linear_model/_linear_loss.py | def init_zero_coef(self, X, dtype=None):
"""Allocate coef of correct shape with zeros.
Parameters:
-----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data.
dtype : data-type, default=None
Overrides the data type of c... | /usr/src/app/target_test_cases/failed_tests_LinearModelLoss.init_zero_coef.txt | def init_zero_coef(self, X, dtype=None):
"""Allocate coef of correct shape with zeros.
Parameters:
-----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data.
dtype : data-type, default=None
Overrides the data type of c... | LinearModelLoss.init_zero_coef | file-level | external |
scikit-learn | 102 | sklearn/linear_model/_linear_loss.py | def loss(
self,
coef,
X,
y,
sample_weight=None,
l2_reg_strength=0.0,
n_threads=1,
raw_prediction=None,
):
"""Compute the loss as weighted average over point-wise losses.
Parameters
----------
coef : ndarray of shape... | /usr/src/app/target_test_cases/failed_tests_LinearModelLoss.loss.txt | def loss(
self,
coef,
X,
y,
sample_weight=None,
l2_reg_strength=0.0,
n_threads=1,
raw_prediction=None,
):
"""Compute the loss as weighted average over point-wise losses.
Parameters
----------
coef : ndarray of shape... | LinearModelLoss.loss | file-level | external |
scikit-learn | 103 | sklearn/linear_model/_base.py | def fit(self, X, y, sample_weight=None):
"""
Fit linear model.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,) or (n_samples, n_targets)
Target values.... | /usr/src/app/target_test_cases/failed_tests_LinearRegression.fit.txt | def fit(self, X, y, sample_weight=None):
"""
Fit linear model.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,) or (n_samples, n_targets)
Target values.... | LinearRegression.fit | repository-level | external |
scikit-learn | 104 | sklearn/svm/_classes.py | def fit(self, X, y, sample_weight=None):
"""Fit the model according to the given training data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples and
`n_features`... | /usr/src/app/target_test_cases/failed_tests_LinearSVC.fit.txt | def fit(self, X, y, sample_weight=None):
"""Fit the model according to the given training data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples and
`n_features`... | LinearSVC.fit | repository-level | external |
scikit-learn | 105 | sklearn/neighbors/_lof.py | def fit(self, X, y=None):
"""Fit the local outlier factor detector from the training dataset.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features) or \
(n_samples, n_samples) if metric='precomputed'
Training data.
... | /usr/src/app/target_test_cases/failed_tests_LocalOutlierFactor.fit.txt | def fit(self, X, y=None):
"""Fit the local outlier factor detector from the training dataset.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features) or \
(n_samples, n_samples) if metric='precomputed'
Training data.
... | LocalOutlierFactor.fit | repository-level | external |
scikit-learn | 106 | sklearn/neighbors/_lof.py | def score_samples(self, X):
"""Opposite of the Local Outlier Factor of X.
It is the opposite as bigger is better, i.e. large values correspond
to inliers.
**Only available for novelty detection (when novelty is set to True).**
The argument X is supposed to contain *new data... | /usr/src/app/target_test_cases/failed_tests_LocalOutlierFactor.score_samples.txt | def score_samples(self, X):
"""Opposite of the Local Outlier Factor of X.
It is the opposite as bigger is better, i.e. large values correspond
to inliers.
**Only available for novelty detection (when novelty is set to True).**
The argument X is supposed to contain *new data... | LocalOutlierFactor.score_samples | repository-level | external |
scikit-learn | 107 | sklearn/linear_model/_logistic.py | def predict_proba(self, X):
"""
Probability estimates.
The returned estimates for all classes are ordered by the
label of classes.
For a multi_class problem, if multi_class is set to be "multinomial"
the softmax function is used to find the predicted probability of
... | /usr/src/app/target_test_cases/failed_tests_LogisticRegression.predict_proba.txt | def predict_proba(self, X):
"""
Probability estimates.
The returned estimates for all classes are ordered by the
label of classes.
For a multi_class problem, if multi_class is set to be "multinomial"
the softmax function is used to find the predicted probability of
... | LogisticRegression.predict_proba | repository-level | external |
scikit-learn | 108 | sklearn/neural_network/_multilayer_perceptron.py | def partial_fit(self, X, y, classes=None):
"""Update the model with a single iteration over the given data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input data.
y : array-like of shape (n_samples,)
Th... | /usr/src/app/target_test_cases/failed_tests_MLPClassifier.partial_fit.txt | def partial_fit(self, X, y, classes=None):
"""Update the model with a single iteration over the given data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input data.
y : array-like of shape (n_samples,)
Th... | MLPClassifier.partial_fit | repository-level | non_external |
scikit-learn | 109 | sklearn/neural_network/_multilayer_perceptron.py | def predict_proba(self, X):
"""Probability estimates.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input data.
Returns
-------
y_prob : ndarray of shape (n_samples, n_classes)
The predicte... | /usr/src/app/target_test_cases/failed_tests_MLPClassifier.predict_proba.txt | def predict_proba(self, X):
"""Probability estimates.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input data.
Returns
-------
y_prob : ndarray of shape (n_samples, n_classes)
The predicte... | MLPClassifier.predict_proba | repository-level | external |
scikit-learn | 110 | sklearn/cluster/_mean_shift.py | def fit(self, X, y=None):
"""Perform clustering.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Samples to cluster.
y : Ignored
Not used, present for API consistency by convention.
Returns
-------
self ... | /usr/src/app/target_test_cases/failed_tests_MeanShift.fit.txt | def fit(self, X, y=None):
"""Perform clustering.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Samples to cluster.
y : Ignored
Not used, present for API consistency by convention.
Returns
-------
self ... | MeanShift.fit | repository-level | external |
scikit-learn | 111 | sklearn/covariance/_robust_covariance.py | def fit(self, X, y=None):
"""Fit a Minimum Covariance Determinant with the FastMCD algorithm.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples
and `n_features` is the number of fea... | /usr/src/app/target_test_cases/failed_tests_MinCovDet.fit.txt | def fit(self, X, y=None):
"""Fit a Minimum Covariance Determinant with the FastMCD algorithm.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data, where `n_samples` is the number of samples
and `n_features` is the number of fea... | MinCovDet.fit | repository-level | external |
scikit-learn | 112 | sklearn/decomposition/_dict_learning.py | def fit(self, X, y=None):
"""Fit the model from data in X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples
and `n_features` is the number of features.
y : Ignored
... | /usr/src/app/target_test_cases/failed_tests_MiniBatchDictionaryLearning.fit.txt | def fit(self, X, y=None):
"""Fit the model from data in X.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples
and `n_features` is the number of features.
y : Ignored
... | MiniBatchDictionaryLearning.fit | repository-level | external |
scikit-learn | 113 | sklearn/decomposition/_dict_learning.py | def partial_fit(self, X, y=None):
"""Update the model using the data in X as a mini-batch.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples
and `n_features` is the number of feat... | /usr/src/app/target_test_cases/failed_tests_MiniBatchDictionaryLearning.partial_fit.txt | def partial_fit(self, X, y=None):
"""Update the model using the data in X as a mini-batch.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples
and `n_features` is the number of feat... | MiniBatchDictionaryLearning.partial_fit | repository-level | external |
scikit-learn | 114 | sklearn/cluster/_kmeans.py | def fit(self, X, y=None, sample_weight=None):
"""Compute the centroids on X by chunking it into mini-batches.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data
... | /usr/src/app/target_test_cases/failed_tests_MiniBatchKMeans.fit.txt | def fit(self, X, y=None, sample_weight=None):
"""Compute the centroids on X by chunking it into mini-batches.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data
... | MiniBatchKMeans.fit | repository-level | external |
scikit-learn | 115 | sklearn/cluster/_kmeans.py | def partial_fit(self, X, y=None, sample_weight=None):
"""Update k means estimate on a single mini-batch X.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data
wil... | /usr/src/app/target_test_cases/failed_tests_MiniBatchKMeans.partial_fit.txt | def partial_fit(self, X, y=None, sample_weight=None):
"""Update k means estimate on a single mini-batch X.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data
wil... | MiniBatchKMeans.partial_fit | repository-level | external |
scikit-learn | 116 | sklearn/impute/_base.py | def transform(self, X):
"""Generate missing values indicator for `X`.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input data to complete.
Returns
-------
Xt : {ndarray, sparse matrix} of shape (n_sam... | /usr/src/app/target_test_cases/failed_tests_MissingIndicator.transform.txt | def transform(self, X):
"""Generate missing values indicator for `X`.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The input data to complete.
Returns
-------
Xt : {ndarray, sparse matrix} of shape (n_sam... | MissingIndicator.transform | repository-level | external |
scikit-learn | 117 | sklearn/preprocessing/_label.py | def fit_transform(self, y):
"""Fit the label sets binarizer and transform the given label sets.
Parameters
----------
y : iterable of iterables
A set of labels (any orderable and hashable object) for each
sample. If the `classes` parameter is set, `y` will no... | /usr/src/app/target_test_cases/failed_tests_MultiLabelBinarizer.fit_transform.txt | def fit_transform(self, y):
"""Fit the label sets binarizer and transform the given label sets.
Parameters
----------
y : iterable of iterables
A set of labels (any orderable and hashable object) for each
sample. If the `classes` parameter is set, `y` will no... | MultiLabelBinarizer.fit_transform | repository-level | external |
scikit-learn | 118 | sklearn/preprocessing/_label.py | def inverse_transform(self, yt):
"""Transform the given indicator matrix into label sets.
Parameters
----------
yt : {ndarray, sparse matrix} of shape (n_samples, n_classes)
A matrix containing only 1s ands 0s.
Returns
-------
y : list of tuples
... | /usr/src/app/target_test_cases/failed_tests_MultiLabelBinarizer.inverse_transform.txt | def inverse_transform(self, yt):
"""Transform the given indicator matrix into label sets.
Parameters
----------
yt : {ndarray, sparse matrix} of shape (n_samples, n_classes)
A matrix containing only 1s ands 0s.
Returns
-------
y : list of tuples
... | MultiLabelBinarizer.inverse_transform | repository-level | external |
scikit-learn | 119 | sklearn/multioutput.py | def score(self, X, y):
"""Return the mean accuracy on the given test data and labels.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test samples.
y : array-like of shape (n_samples, n_outputs)
True values for X.
Retur... | /usr/src/app/target_test_cases/failed_tests_MultiOutputClassifier.score.txt | def score(self, X, y):
"""Return the mean accuracy on the given test data and labels.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Test samples.
y : array-like of shape (n_samples, n_outputs)
True values for X.
Retur... | MultiOutputClassifier.score | repository-level | external |
scikit-learn | 120 | sklearn/linear_model/_coordinate_descent.py | def fit(self, X, y):
"""Fit MultiTaskElasticNet model with coordinate descent.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
Data.
y : ndarray of shape (n_samples, n_targets)
Target. Will be cast to X's dtype if necessary.
... | /usr/src/app/target_test_cases/failed_tests_MultiTaskElasticNet.fit.txt | def fit(self, X, y):
"""Fit MultiTaskElasticNet model with coordinate descent.
Parameters
----------
X : ndarray of shape (n_samples, n_features)
Data.
y : ndarray of shape (n_samples, n_targets)
Target. Will be cast to X's dtype if necessary.
... | MultiTaskElasticNet.fit | repository-level | external |
scikit-learn | 121 | sklearn/neighbors/_nearest_centroid.py | def fit(self, X, y):
"""
Fit the NearestCentroid model according to the given training data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples and
`n_feat... | /usr/src/app/target_test_cases/failed_tests_NearestCentroid.fit.txt | def fit(self, X, y):
"""
Fit the NearestCentroid model according to the given training data.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training vector, where `n_samples` is the number of samples and
`n_feat... | NearestCentroid.fit | repository-level | external |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.