neulab/docprompting-conala huggingface dataset:
sklearn.base.ClassifierMixin  
class sklearn.base.ClassifierMixin [source]
 
Mixin class for all classifiers in scikit-learn. Methods  
score(X, y[, sample_weight]) Return the mean accuracy on the given test data and labels.    
score(X, y, sample_weight=None) [source]
 
Return the mean accuracy on the given test data and labels. In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True labels for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

Mean accuracy of self.predict(X) wrt. y.
class sklearn.base.ClassifierMixin [source]
 
Mixin class for all classifiers in scikit-learn. Methods  
score(X, y[, sample_weight]) Return the mean accuracy on the given test data and labels.    
score(X, y, sample_weight=None) [source]
 
Return the mean accuracy on the given test data and labels. In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True labels for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

Mean accuracy of self.predict(X) wrt. y.
score(X, y, sample_weight=None) [source]
 
Return the mean accuracy on the given test data and labels. In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True labels for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

Mean accuracy of self.predict(X) wrt. y.
sklearn.base.clone(estimator, *, safe=True) [source]
 
Constructs a new unfitted estimator with the same parameters. Clone does a deep copy of the model in an estimator without actually copying attached data. It yields a new estimator with the same parameters that has not been fitted on any data. If the estimator’s random_state parameter is an integer (or if the estimator doesn’t have a random_state parameter), an exact clone is returned: the clone and the original estimator will give the exact same results. Otherwise, statistical clone is returned: the clone might yield different results from the original estimator. More details can be found in Controlling randomness.  Parameters 
 
estimator{list, tuple, set} of estimator instance or a single estimator instance 

The estimator or group of estimators to be cloned.  
safebool, default=True 

If safe is False, clone will fall back to a deep copy on objects that are not estimators.
sklearn.base.ClusterMixin  
class sklearn.base.ClusterMixin [source]
 
Mixin class for all cluster estimators in scikit-learn. Methods  
fit_predict(X[, y]) Perform clustering on X and returns cluster labels.    
fit_predict(X, y=None) [source]
 
Perform clustering on X and returns cluster labels.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input data.  
yIgnored 

Not used, present for API consistency by convention.    Returns 
 
labelsndarray of shape (n_samples,), dtype=np.int64 

Cluster labels.
class sklearn.base.ClusterMixin [source]
 
Mixin class for all cluster estimators in scikit-learn. Methods  
fit_predict(X[, y]) Perform clustering on X and returns cluster labels.    
fit_predict(X, y=None) [source]
 
Perform clustering on X and returns cluster labels.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input data.  
yIgnored 

Not used, present for API consistency by convention.    Returns 
 
labelsndarray of shape (n_samples,), dtype=np.int64 

Cluster labels.
fit_predict(X, y=None) [source]
 
Perform clustering on X and returns cluster labels.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input data.  
yIgnored 

Not used, present for API consistency by convention.    Returns 
 
labelsndarray of shape (n_samples,), dtype=np.int64 

Cluster labels.
sklearn.base.DensityMixin  
class sklearn.base.DensityMixin [source]
 
Mixin class for all density estimators in scikit-learn. Methods  
score(X[, y]) Return the score of the model on the data X.    
score(X, y=None) [source]
 
Return the score of the model on the data X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples.  
yIgnored 

Not used, present for API consistency by convention.    Returns 
 
scorefloat
class sklearn.base.DensityMixin [source]
 
Mixin class for all density estimators in scikit-learn. Methods  
score(X[, y]) Return the score of the model on the data X.    
score(X, y=None) [source]
 
Return the score of the model on the data X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples.  
yIgnored 

Not used, present for API consistency by convention.    Returns 
 
scorefloat
score(X, y=None) [source]
 
Return the score of the model on the data X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples.  
yIgnored 

Not used, present for API consistency by convention.    Returns 
 
scorefloat
sklearn.base.is_classifier(estimator) [source]
 
Return True if the given estimator is (probably) a classifier.  Parameters 
 
estimatorobject 

Estimator object to test.    Returns 
 
outbool 

True if estimator is a classifier and False otherwise.
sklearn.base.is_regressor(estimator) [source]
 
Return True if the given estimator is (probably) a regressor.  Parameters 
 
estimatorestimator instance 

Estimator object to test.    Returns 
 
outbool 

True if estimator is a regressor and False otherwise.
class sklearn.base.RegressorMixin [source]
 
Mixin class for all regression estimators in scikit-learn. Methods  
score(X, y[, sample_weight]) Return the coefficient of determination \(R^2\) of the prediction.    
score(X, y, sample_weight=None) [source]
 
Return the coefficient of determination \(R^2\) of the prediction. The coefficient \(R^2\) is defined as \((1 - \frac{u}{v})\), where \(u\) is the residual sum of squares ((y_true - y_pred)
** 2).sum() and \(v\) is the total sum of squares ((y_true -
y_true.mean()) ** 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a \(R^2\) score of 0.0.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples. For some estimators this may be a precomputed kernel matrix or a list of generic objects instead with shape (n_samples, n_samples_fitted), where n_samples_fitted is the number of samples used in the fitting for the estimator.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True values for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

\(R^2\) of self.predict(X) wrt. y.     Notes The \(R^2\) score used when calling score on a regressor uses multioutput='uniform_average' from version 0.23 to keep consistent with default value of r2_score. This influences the score method of all the multioutput regressors (except for MultiOutputRegressor).
sklearn.base.RegressorMixin  
class sklearn.base.RegressorMixin [source]
 
Mixin class for all regression estimators in scikit-learn. Methods  
score(X, y[, sample_weight]) Return the coefficient of determination \(R^2\) of the prediction.    
score(X, y, sample_weight=None) [source]
 
Return the coefficient of determination \(R^2\) of the prediction. The coefficient \(R^2\) is defined as \((1 - \frac{u}{v})\), where \(u\) is the residual sum of squares ((y_true - y_pred)
** 2).sum() and \(v\) is the total sum of squares ((y_true -
y_true.mean()) ** 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a \(R^2\) score of 0.0.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples. For some estimators this may be a precomputed kernel matrix or a list of generic objects instead with shape (n_samples, n_samples_fitted), where n_samples_fitted is the number of samples used in the fitting for the estimator.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True values for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

\(R^2\) of self.predict(X) wrt. y.     Notes The \(R^2\) score used when calling score on a regressor uses multioutput='uniform_average' from version 0.23 to keep consistent with default value of r2_score. This influences the score method of all the multioutput regressors (except for MultiOutputRegressor).
score(X, y, sample_weight=None) [source]
 
Return the coefficient of determination \(R^2\) of the prediction. The coefficient \(R^2\) is defined as \((1 - \frac{u}{v})\), where \(u\) is the residual sum of squares ((y_true - y_pred)
** 2).sum() and \(v\) is the total sum of squares ((y_true -
y_true.mean()) ** 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a \(R^2\) score of 0.0.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test samples. For some estimators this may be a precomputed kernel matrix or a list of generic objects instead with shape (n_samples, n_samples_fitted), where n_samples_fitted is the number of samples used in the fitting for the estimator.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True values for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

\(R^2\) of self.predict(X) wrt. y.     Notes The \(R^2\) score used when calling score on a regressor uses multioutput='uniform_average' from version 0.23 to keep consistent with default value of r2_score. This influences the score method of all the multioutput regressors (except for MultiOutputRegressor).
sklearn.base.TransformerMixin  
class sklearn.base.TransformerMixin [source]
 
Mixin class for all transformers in scikit-learn. Methods  
fit_transform(X[, y]) Fit to data, then transform it.    
fit_transform(X, y=None, **fit_params) [source]
 
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None 

Target values (None for unsupervised transformations).  
**fit_paramsdict 

Additional fit parameters.    Returns 
 
X_newndarray array of shape (n_samples, n_features_new) 

Transformed array.     
 
 Examples using sklearn.base.TransformerMixin
 
  Approximate nearest neighbors in TSNE
class sklearn.base.TransformerMixin [source]
 
Mixin class for all transformers in scikit-learn. Methods  
fit_transform(X[, y]) Fit to data, then transform it.    
fit_transform(X, y=None, **fit_params) [source]
 
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None 

Target values (None for unsupervised transformations).  
**fit_paramsdict 

Additional fit parameters.    Returns 
 
X_newndarray array of shape (n_samples, n_features_new) 

Transformed array.
fit_transform(X, y=None, **fit_params) [source]
 
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None 

Target values (None for unsupervised transformations).  
**fit_paramsdict 

Additional fit parameters.    Returns 
 
X_newndarray array of shape (n_samples, n_features_new) 

Transformed array.
fit(X, y, sample_weight=None) [source]
 
Fit the calibrated model.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data.  
yarray-like of shape (n_samples,) 

Target values.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted.    Returns 
 
selfobject 

Returns an instance of self.
predict(X) [source]
 
Predict the target of new samples. The predicted class is the class that has the highest probability, and can thus be different from the prediction of the uncalibrated classifier.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The samples.    Returns 
 
Cndarray of shape (n_samples,) 

The predicted class.
predict_proba(X) [source]
 
Calibrated probabilities of classification. This function returns calibrated probabilities of classification according to each class on an array of test vectors X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The samples.    Returns 
 
Cndarray of shape (n_samples, n_classes) 

The predicted probas.
sklearn.calibration.calibration_curve(y_true, y_prob, *, normalize=False, n_bins=5, strategy='uniform') [source]
 
Compute true and predicted probabilities for a calibration curve. The method assumes the inputs come from a binary classifier, and discretize the [0, 1] interval into bins. Calibration curves may also be referred to as reliability diagrams. Read more in the User Guide.  Parameters 
 
y_truearray-like of shape (n_samples,) 

True targets.  
y_probarray-like of shape (n_samples,) 

Probabilities of the positive class.  
normalizebool, default=False 

Whether y_prob needs to be normalized into the [0, 1] interval, i.e. is not a proper probability. If True, the smallest value in y_prob is linearly mapped onto 0 and the largest one onto 1.  
n_binsint, default=5 

Number of bins to discretize the [0, 1] interval. A bigger number requires more data. Bins with no samples (i.e. without corresponding values in y_prob) will not be returned, thus the returned arrays may have less than n_bins values.  
strategy{‘uniform’, ‘quantile’}, default=’uniform’ 

Strategy used to define the widths of the bins.  uniform

The bins have identical widths.  quantile

The bins have the same number of samples and depend on y_prob.      Returns 
 
prob_truendarray of shape (n_bins,) or smaller 

The proportion of samples whose class is the positive class, in each bin (fraction of positives).  
prob_predndarray of shape (n_bins,) or smaller 

The mean predicted probability in each bin.     References Alexandru Niculescu-Mizil and Rich Caruana (2005) Predicting Good Probabilities With Supervised Learning, in Proceedings of the 22nd International Conference on Machine Learning (ICML). See section 4 (Qualitative Analysis of Predictions). Examples >>> import numpy as np
>>> from sklearn.calibration import calibration_curve
>>> y_true = np.array([0, 0, 0, 0, 1, 1, 1, 1, 1])
>>> y_pred = np.array([0.1, 0.2, 0.3, 0.4, 0.65, 0.7, 0.8, 0.9,  1.])
>>> prob_true, prob_pred = calibration_curve(y_true, y_pred, n_bins=3)
>>> prob_true
array([0. , 0.5, 1. ])
>>> prob_pred
array([0.2  , 0.525, 0.85 ])
fit(X, y=None) [source]
 
Fit the clustering from features, or affinity matrix.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features), or array-like of shape (n_samples, n_samples) 

Training instances to cluster, or similarities / affinities between instances if affinity='precomputed'. If a sparse feature matrix is provided, it will be converted into a sparse csr_matrix.  
yIgnored 

Not used, present here for API consistency by convention.    Returns 
 self
fit_predict(X, y=None) [source]
 
Fit the clustering from features or affinity matrix, and return cluster labels.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features), or array-like of shape (n_samples, n_samples) 

Training instances to cluster, or similarities / affinities between instances if affinity='precomputed'. If a sparse feature matrix is provided, it will be converted into a sparse csr_matrix.  
yIgnored 

Not used, present here for API consistency by convention.    Returns 
 
labelsndarray of shape (n_samples,) 

Cluster labels.
predict(X) [source]
 
Predict the closest cluster each sample in X belongs to.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

New data to predict. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
labelsndarray of shape (n_samples,) 

Cluster labels.
sklearn.cluster.affinity_propagation(S, *, preference=None, convergence_iter=15, max_iter=200, damping=0.5, copy=True, verbose=False, return_n_iter=False, random_state='warn') [source]
 
Perform Affinity Propagation Clustering of data. Read more in the User Guide.  Parameters 
 
Sarray-like of shape (n_samples, n_samples) 

Matrix of similarities between points.  
preferencearray-like of shape (n_samples,) or float, default=None 

Preferences for each point - points with larger values of preferences are more likely to be chosen as exemplars. The number of exemplars, i.e. of clusters, is influenced by the input preferences value. If the preferences are not passed as arguments, they will be set to the median of the input similarities (resulting in a moderate number of clusters). For a smaller amount of clusters, this can be set to the minimum value of the similarities.  
convergence_iterint, default=15 

Number of iterations with no change in the number of estimated clusters that stops the convergence.  
max_iterint, default=200 

Maximum number of iterations  
dampingfloat, default=0.5 

Damping factor between 0.5 and 1.  
copybool, default=True 

If copy is False, the affinity matrix is modified inplace by the algorithm, for memory efficiency.  
verbosebool, default=False 

The verbosity level.  
return_n_iterbool, default=False 

Whether or not to return the number of iterations.  
random_stateint, RandomState instance or None, default=0 

Pseudo-random number generator to control the starting state. Use an int for reproducible results across function calls. See the Glossary.  New in version 0.23: this parameter was previously hardcoded as 0.     Returns 
 
cluster_centers_indicesndarray of shape (n_clusters,) 

Index of clusters centers.  
labelsndarray of shape (n_samples,) 

Cluster labels for each point.  
n_iterint 

Number of iterations run. Returned only if return_n_iter is set to True.     Notes For an example, see examples/cluster/plot_affinity_propagation.py. When the algorithm does not converge, it returns an empty array as cluster_center_indices and -1 as label for each training sample. When all training samples have equal similarities and equal preferences, the assignment of cluster centers and labels depends on the preference. If the preference is smaller than the similarities, a single cluster center and label 0 for every sample will be returned. Otherwise, every training sample becomes its own cluster center and is assigned a unique label. References Brendan J. Frey and Delbert Dueck, “Clustering by Passing Messages Between Data Points”, Science Feb. 2007
fit(X, y=None) [source]
 
Fit the hierarchical clustering from features, or distance matrix.  Parameters 
 
Xarray-like, shape (n_samples, n_features) or (n_samples, n_samples) 

Training instances to cluster, or distances between instances if affinity='precomputed'.  
yIgnored 

Not used, present here for API consistency by convention.    Returns 
 self
fit_predict(X, y=None) [source]
 
Fit the hierarchical clustering from features or distance matrix, and return cluster labels.  Parameters 
 
Xarray-like of shape (n_samples, n_features) or (n_samples, n_samples) 

Training instances to cluster, or distances between instances if affinity='precomputed'.  
yIgnored 

Not used, present here for API consistency by convention.    Returns 
 
labelsndarray of shape (n_samples,) 

Cluster labels.
fit(X, y=None) [source]
 
Build a CF Tree for the input data.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Input data.  
yIgnored 

Not used, present here for API consistency by convention.    Returns 
 self

Fitted estimator.
partial_fit(X=None, y=None) [source]
 
Online learning. Prevents rebuilding of CFTree from scratch.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features), default=None 

Input data. If X is not provided, only the global clustering step is done.  
yIgnored 

Not used, present here for API consistency by convention.    Returns 
 self

Fitted estimator.
predict(X) [source]
 
Predict data using the centroids_ of subclusters. Avoid computation of the row norms of X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Input data.    Returns 
 
labelsndarray of shape(n_samples,) 

Labelled data.
transform(X) [source]
 
Transform X into subcluster centroids dimension. Each dimension represents the distance from the sample point to each cluster centroid.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Input data.    Returns 
 
X_trans{array-like, sparse matrix} of shape (n_samples, n_clusters) 

Transformed data.
sklearn.cluster.cluster_optics_dbscan(*, reachability, core_distances, ordering, eps) [source]
 
Performs DBSCAN extraction for an arbitrary epsilon. Extracting the clusters runs in linear time. Note that this results in labels_ which are close to a DBSCAN with similar settings and eps, only if eps is close to max_eps.  Parameters 
 
reachabilityarray of shape (n_samples,) 

Reachability distances calculated by OPTICS (reachability_)  
core_distancesarray of shape (n_samples,) 

Distances at which points become core (core_distances_)  
orderingarray of shape (n_samples,) 

OPTICS ordered point indices (ordering_)  
epsfloat 

DBSCAN eps parameter. Must be set to < max_eps. Results will be close to DBSCAN algorithm if eps and max_eps are close to one another.    Returns 
 
labels_array of shape (n_samples,) 

The estimated labels.