neulab/docprompting-conala huggingface dataset:
partial_fit(X, y=None) [source]
 
Online computation of min and max on X for later scaling. All of X is processed as a single batch. This is intended for cases when fit is not feasible due to very large number of n_samples or because X is read from a continuous stream.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The data used to compute the mean and standard deviation used for later scaling along the features axis.  
yNone 

Ignored.    Returns 
 
selfobject 

Fitted scaler.
transform(X) [source]
 
Scale features of X according to feature_range.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input data that will be transformed.    Returns 
 
Xtndarray of shape (n_samples, n_features) 

Transformed data.
sklearn.preprocessing.minmax_scale(X, feature_range=0, 1, *, axis=0, copy=True) [source]
 
Transform features by scaling each feature to a given range. This estimator scales and translates each feature individually such that it is in the given range on the training set, i.e. between zero and one. The transformation is given by (when axis=0): X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0))
X_scaled = X_std * (max - min) + min
 where min, max = feature_range. The transformation is calculated as (when axis=0): X_scaled = scale * X + min - X.min(axis=0) * scale
where scale = (max - min) / (X.max(axis=0) - X.min(axis=0))
 This transformation is often used as an alternative to zero mean, unit variance scaling. Read more in the User Guide.  New in version 0.17: minmax_scale function interface to MinMaxScaler.   Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The data.  
feature_rangetuple (min, max), default=(0, 1) 

Desired range of transformed data.  
axisint, default=0 

Axis used to scale along. If 0, independently scale each feature, otherwise (if 1) scale each sample.  
copybool, default=True 

Set to False to perform inplace scaling and avoid a copy (if the input is already a numpy array).    Returns 
 
X_trndarray of shape (n_samples, n_features) 

The transformed data.    Warning Risk of data leak Do not use minmax_scale unless you know what you are doing. A common mistake is to apply it to the entire data before splitting into training and test sets. This will bias the model evaluation because information would have leaked from the test set to the training set. In general, we recommend using MinMaxScaler within a Pipeline in order to prevent most risks of data leaking: pipe = make_pipeline(MinMaxScaler(), LogisticRegression()).     See also  
MinMaxScaler


Performs scaling to a given range using the Transformer API (e.g. as part of a preprocessing Pipeline).    Notes For a comparison of the different scalers, transformers, and normalizers, see examples/preprocessing/plot_all_scaling.py.
fit(y) [source]
 
Fit the label sets binarizer, storing classes_.  Parameters 
 
yiterable of iterables 

A set of labels (any orderable and hashable object) for each sample. If the classes parameter is set, y will not be iterated.    Returns 
 
selfreturns this MultiLabelBinarizer instance
fit_transform(y) [source]
 
Fit the label sets binarizer and transform the given label sets.  Parameters 
 
yiterable of iterables 

A set of labels (any orderable and hashable object) for each sample. If the classes parameter is set, y will not be iterated.    Returns 
 
y_indicator{ndarray, sparse matrix} of shape (n_samples, n_classes) 

A matrix such that y_indicator[i, j] = 1 i.f.f. classes_[j] is in y[i], and 0 otherwise. Sparse matrix will be of CSR format.
inverse_transform(yt) [source]
 
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 
 
ylist of tuples 

The set of labels for each sample such that y[i] consists of classes_[j] for each yt[i, j] == 1.
transform(y) [source]
 
Transform the given label sets.  Parameters 
 
yiterable of iterables 

A set of labels (any orderable and hashable object) for each sample. If the classes parameter is set, y will not be iterated.    Returns 
 
y_indicatorarray or CSR matrix, shape (n_samples, n_classes) 

A matrix such that y_indicator[i, j] = 1 iff classes_[j] is in y[i], and 0 otherwise.
sklearn.preprocessing.normalize(X, norm='l2', *, axis=1, copy=True, return_norm=False) [source]
 
Scale input vectors individually to unit norm (vector length). Read more in the User Guide.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data to normalize, element by element. scipy.sparse matrices should be in CSR format to avoid an un-necessary copy.  
norm{‘l1’, ‘l2’, ‘max’}, default=’l2’ 

The norm to use to normalize each non zero sample (or each non-zero feature if axis is 0).  
axis{0, 1}, default=1 

axis used to normalize the data along. If 1, independently normalize each sample, otherwise (if 0) normalize each feature.  
copybool, default=True 

set to False to perform inplace row normalization and avoid a copy (if the input is already a numpy array or a scipy.sparse CSR matrix and if axis is 1).  
return_normbool, default=False 

whether to return the computed norms    Returns 
 
X{ndarray, sparse matrix} of shape (n_samples, n_features) 

Normalized input X.  
normsndarray of shape (n_samples, ) if axis=1 else (n_features, ) 

An array of norms along given axis for X. When X is sparse, a NotImplementedError will be raised for norm ‘l1’ or ‘l2’.      See also  
Normalizer


Performs normalization using the Transformer API (e.g. as part of a preprocessing Pipeline).    Notes For a comparison of the different scalers, transformers, and normalizers, see examples/preprocessing/plot_all_scaling.py.
fit(X, y=None) [source]
 
Do nothing and return the estimator unchanged This method is just there to implement the usual API and hence work in pipelines.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data to estimate the normalization parameters.  
yNone 

Ignored.    Returns 
 
selfobject 

Fitted transformer.
transform(X, copy=None) [source]
 
Scale each non zero row of X to unit norm  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data to normalize, row by row. scipy.sparse matrices should be in CSR format to avoid an un-necessary copy.  
copybool, default=None 

Copy the input X or not.    Returns 
 
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features) 

Transformed array.
fit(X, y=None) [source]
 
Fit OneHotEncoder to X.  Parameters 
 
Xarray-like, shape [n_samples, n_features] 

The data to determine the categories of each feature.  
yNone 

Ignored. This parameter exists only for compatibility with Pipeline.    Returns 
 self
fit_transform(X, y=None) [source]
 
Fit OneHotEncoder to X, then transform X. Equivalent to fit(X).transform(X) but more convenient.  Parameters 
 
Xarray-like, shape [n_samples, n_features] 

The data to encode.  
yNone 

Ignored. This parameter exists only for compatibility with Pipeline.    Returns 
 
X_outsparse matrix if sparse=True else a 2-d array 

Transformed input.
get_feature_names(input_features=None) [source]
 
Return feature names for output features.  Parameters 
 
input_featureslist of str of shape (n_features,) 

String names for input features if available. By default, “x0”, “x1”, … “xn_features” is used.    Returns 
 
output_feature_namesndarray of shape (n_output_features,) 

Array of feature names.
inverse_transform(X) [source]
 
Convert the data back to the original representation. In case unknown categories are encountered (all zeros in the one-hot encoding), None is used to represent this category.  Parameters 
 
Xarray-like or sparse matrix, shape [n_samples, n_encoded_features] 

The transformed data.    Returns 
 
X_trarray-like, shape [n_samples, n_features] 

Inverse transformed array.
transform(X) [source]
 
Transform X using one-hot encoding.  Parameters 
 
Xarray-like, shape [n_samples, n_features] 

The data to encode.    Returns 
 
X_outsparse matrix if sparse=True else a 2-d array 

Transformed input.
fit(X, y=None) [source]
 
Fit the OrdinalEncoder to X.  Parameters 
 
Xarray-like, shape [n_samples, n_features] 

The data to determine the categories of each feature.  
yNone 

Ignored. This parameter exists only for compatibility with Pipeline.    Returns 
 self
inverse_transform(X) [source]
 
Convert the data back to the original representation.  Parameters 
 
Xarray-like or sparse matrix, shape [n_samples, n_encoded_features] 

The transformed data.    Returns 
 
X_trarray-like, shape [n_samples, n_features] 

Inverse transformed array.
transform(X) [source]
 
Transform X to ordinal codes.  Parameters 
 
Xarray-like, shape [n_samples, n_features] 

The data to encode.    Returns 
 
X_outsparse matrix or a 2-d array 

Transformed input.
fit(X, y=None) [source]
 
Compute number of output features.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data.  
yNone 

Ignored.    Returns 
 
selfobject 

Fitted transformer.
get_feature_names(input_features=None) [source]
 
Return feature names for output features  Parameters 
 
input_featureslist of str of shape (n_features,), default=None 

String names for input features if available. By default, “x0”, “x1”, … “xn_features” is used.    Returns 
 
output_feature_nameslist of str of shape (n_output_features,)
transform(X) [source]
 
Transform data to polynomial features  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data to transform, row by row. Prefer CSR over CSC for sparse input (for speed), but CSC is required if the degree is 4 or higher. If the degree is less than 4 and the input format is CSC, it will be converted to CSR, have its polynomial features generated, then converted back to CSC. If the degree is 2 or 3, the method described in “Leveraging Sparsity to Speed Up Polynomial Feature Expansions of CSR Matrices Using K-Simplex Numbers” by Andrew Nystrom and John Hughes is used, which is much faster than the method used on CSC input. For this reason, a CSC input will be converted to CSR, and the output will be converted back to CSC prior to being returned, hence the preference of CSR.    Returns 
 
XP{ndarray, sparse matrix} of shape (n_samples, NP) 

The matrix of features, where NP is the number of polynomial features generated from the combination of inputs. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.
fit(X, y=None) [source]
 
Estimate the optimal parameter lambda for each feature. The optimal lambda parameter for minimizing skewness is estimated on each feature independently using maximum likelihood.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The data used to estimate the optimal transformation parameters.  
yNone 

Ignored.    Returns 
 
selfobject 

Fitted transformer.
fit_transform(X, y=None) [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.
inverse_transform(X) [source]
 
Apply the inverse power transformation using the fitted lambdas. The inverse of the Box-Cox transformation is given by: if lambda_ == 0:
    X = exp(X_trans)
else:
    X = (X_trans * lambda_ + 1) ** (1 / lambda_)
 The inverse of the Yeo-Johnson transformation is given by: if X >= 0 and lambda_ == 0:
    X = exp(X_trans) - 1
elif X >= 0 and lambda_ != 0:
    X = (X_trans * lambda_ + 1) ** (1 / lambda_) - 1
elif X < 0 and lambda_ != 2:
    X = 1 - (-(2 - lambda_) * X_trans + 1) ** (1 / (2 - lambda_))
elif X < 0 and lambda_ == 2:
    X = 1 - exp(-X_trans)
  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The transformed data.    Returns 
 
Xndarray of shape (n_samples, n_features) 

The original data.
transform(X) [source]
 
Apply the power transform to each feature using the fitted lambdas.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The data to be transformed using a power transformation.    Returns 
 
X_transndarray of shape (n_samples, n_features) 

The transformed data.
sklearn.preprocessing.power_transform(X, method='yeo-johnson', *, standardize=True, copy=True) [source]
 
Power transforms are a family of parametric, monotonic transformations that are applied to make data more Gaussian-like. This is useful for modeling issues related to heteroscedasticity (non-constant variance), or other situations where normality is desired. Currently, power_transform supports the Box-Cox transform and the Yeo-Johnson transform. The optimal parameter for stabilizing variance and minimizing skewness is estimated through maximum likelihood. Box-Cox requires input data to be strictly positive, while Yeo-Johnson supports both positive or negative data. By default, zero-mean, unit-variance normalization is applied to the transformed data. Read more in the User Guide.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The data to be transformed using a power transformation.  
method{‘yeo-johnson’, ‘box-cox’}, default=’yeo-johnson’ 

The power transform method. Available methods are:  ‘yeo-johnson’ [1], works with positive and negative values ‘box-cox’ [2], only works with strictly positive values   Changed in version 0.23: The default value of the method parameter changed from ‘box-cox’ to ‘yeo-johnson’ in 0.23.   
standardizebool, default=True 

Set to True to apply zero-mean, unit-variance normalization to the transformed output.  
copybool, default=True 

Set to False to perform inplace computation during transformation.    Returns 
 
X_transndarray of shape (n_samples, n_features) 

The transformed data.      See also  
PowerTransformer


Equivalent transformation with the Transformer API (e.g. as part of a preprocessing Pipeline).  
quantile_transform


Maps data to a standard normal distribution with the parameter output_distribution='normal'.    Notes NaNs are treated as missing values: disregarded in fit, and maintained in transform. For a comparison of the different scalers, transformers, and normalizers, see examples/preprocessing/plot_all_scaling.py. References  
1  
I.K. Yeo and R.A. Johnson, “A new family of power transformations to improve normality or symmetry.” Biometrika, 87(4), pp.954-959, (2000).  
2  
G.E.P. Box and D.R. Cox, “An Analysis of Transformations”, Journal of the Royal Statistical Society B, 26, 211-252 (1964).   Examples >>> import numpy as np
>>> from sklearn.preprocessing import power_transform
>>> data = [[1, 2], [3, 2], [4, 5]]
>>> print(power_transform(data, method='box-cox'))
[[-1.332... -0.707...]
 [ 0.256... -0.707...]
 [ 1.076...  1.414...]]
  Warning Risk of data leak. Do not use power_transform unless you know what you are doing. A common mistake is to apply it to the entire data before splitting into training and test sets. This will bias the model evaluation because information would have leaked from the test set to the training set. In general, we recommend using PowerTransformer within a Pipeline in order to prevent most risks of data leaking, e.g.: pipe = make_pipeline(PowerTransformer(),
LogisticRegression()).
fit(X, y=None) [source]
 
Compute the quantiles used for transforming.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to scale along the features axis. If a sparse matrix is provided, it will be converted into a sparse csc_matrix. Additionally, the sparse matrix needs to be nonnegative if ignore_implicit_zeros is False.  
yNone 

Ignored.    Returns 
 
selfobject 

Fitted transformer.
inverse_transform(X) [source]
 
Back-projection to the original space.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to scale along the features axis. If a sparse matrix is provided, it will be converted into a sparse csc_matrix. Additionally, the sparse matrix needs to be nonnegative if ignore_implicit_zeros is False.    Returns 
 
Xt{ndarray, sparse matrix} of (n_samples, n_features) 

The projected data.
transform(X) [source]
 
Feature-wise transformation of the data.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to scale along the features axis. If a sparse matrix is provided, it will be converted into a sparse csc_matrix. Additionally, the sparse matrix needs to be nonnegative if ignore_implicit_zeros is False.    Returns 
 
Xt{ndarray, sparse matrix} of shape (n_samples, n_features) 

The projected data.
fit(X, y=None) [source]
 
Compute the median and quantiles to be used for scaling.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to compute the median and quantiles used for later scaling along the features axis.  
yNone 

Ignored.    Returns 
 
selfobject 

Fitted scaler.
inverse_transform(X) [source]
 
Scale back the data to the original representation  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The rescaled data to be transformed back.    Returns 
 
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features) 

Transformed array.
transform(X) [source]
 
Center and scale the data.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to scale along the specified axis.    Returns 
 
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features) 

Transformed array.
sklearn.preprocessing.robust_scale(X, *, axis=0, with_centering=True, with_scaling=True, quantile_range=25.0, 75.0, copy=True, unit_variance=False) [source]
 
Standardize a dataset along any axis Center to the median and component wise scale according to the interquartile range. Read more in the User Guide.  Parameters 
 
X{array-like, sparse matrix} of shape (n_sample, n_features) 

The data to center and scale.  
axisint, default=0 

axis used to compute the medians and IQR along. If 0, independently scale each feature, otherwise (if 1) scale each sample.  
with_centeringbool, default=True 

If True, center the data before scaling.  
with_scalingbool, default=True 

If True, scale the data to unit variance (or equivalently, unit standard deviation).  
quantile_rangetuple (q_min, q_max), 0.0 < q_min < q_max < 100.0 

default=(25.0, 75.0), == (1st quantile, 3rd quantile), == IQR Quantile range used to calculate scale_.  New in version 0.18.   
copybool, default=True 

set to False to perform inplace row normalization and avoid a copy (if the input is already a numpy array or a scipy.sparse CSR matrix and if axis is 1).  
unit_variancebool, default=False 

If True, scale data so that normally distributed features have a variance of 1. In general, if the difference between the x-values of q_max and q_min for a standard normal distribution is greater than 1, the dataset will be scaled down. If less than 1, the dataset will be scaled up.  New in version 0.24.     Returns 
 
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features) 

The transformed data.      See also  
RobustScaler


Performs centering and scaling using the Transformer API (e.g. as part of a preprocessing Pipeline).    Notes This implementation will refuse to center scipy.sparse matrices since it would make them non-sparse and would potentially crash the program with memory exhaustion problems. Instead the caller is expected to either set explicitly with_centering=False (in that case, only variance scaling will be performed on the features of the CSR matrix) or to call X.toarray() if he/she expects the materialized dense array to fit in memory. To avoid memory copy the caller should pass a CSR matrix. For a comparison of the different scalers, transformers, and normalizers, see examples/preprocessing/plot_all_scaling.py.  Warning Risk of data leak Do not use robust_scale unless you know what you are doing. A common mistake is to apply it to the entire data before splitting into training and test sets. This will bias the model evaluation because information would have leaked from the test set to the training set. In general, we recommend using RobustScaler within a Pipeline in order to prevent most risks of data leaking: pipe = make_pipeline(RobustScaler(), LogisticRegression()).
sklearn.preprocessing.scale(X, *, axis=0, with_mean=True, with_std=True, copy=True) [source]
 
Standardize a dataset along any axis. Center to the mean and component wise scale to unit variance. Read more in the User Guide.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data to center and scale.  
axisint, default=0 

axis used to compute the means and standard deviations along. If 0, independently standardize each feature, otherwise (if 1) standardize each sample.  
with_meanbool, default=True 

If True, center the data before scaling.  
with_stdbool, default=True 

If True, scale the data to unit variance (or equivalently, unit standard deviation).  
copybool, default=True 

set to False to perform inplace row normalization and avoid a copy (if the input is already a numpy array or a scipy.sparse CSC matrix and if axis is 1).    Returns 
 
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features) 

The transformed data.      See also  
StandardScaler


Performs scaling to unit variance using the Transformer API (e.g. as part of a preprocessing Pipeline).    Notes This implementation will refuse to center scipy.sparse matrices since it would make them non-sparse and would potentially crash the program with memory exhaustion problems. Instead the caller is expected to either set explicitly with_mean=False (in that case, only variance scaling will be performed on the features of the CSC matrix) or to call X.toarray() if he/she expects the materialized dense array to fit in memory. To avoid memory copy the caller should pass a CSC matrix. NaNs are treated as missing values: disregarded to compute the statistics, and maintained during the data transformation. We use a biased estimator for the standard deviation, equivalent to numpy.std(x, ddof=0). Note that the choice of ddof is unlikely to affect model performance. For a comparison of the different scalers, transformers, and normalizers, see examples/preprocessing/plot_all_scaling.py.  Warning Risk of data leak Do not use scale unless you know what you are doing. A common mistake is to apply it to the entire data before splitting into training and test sets. This will bias the model evaluation because information would have leaked from the test set to the training set. In general, we recommend using StandardScaler within a Pipeline in order to prevent most risks of data leaking: pipe = make_pipeline(StandardScaler(), LogisticRegression()).
fit(X, y=None, sample_weight=None) [source]
 
Compute the mean and std to be used for later scaling.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to compute the mean and standard deviation used for later scaling along the features axis.  
yNone 

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

Individual weights for each sample.  New in version 0.24: parameter sample_weight support to StandardScaler.     Returns 
 
selfobject 

Fitted scaler.
inverse_transform(X, copy=None) [source]
 
Scale back the data to the original representation  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The data used to scale along the features axis.  
copybool, default=None 

Copy the input X or not.    Returns 
 
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features) 

Transformed array.