doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
predict_proba(X) [source]
Apply transforms, and predict_proba of the final estimator Parameters
Xiterable
Data to predict on. Must fulfill input requirements of first step of the pipeline. Returns
y_probaarray-like of shape (n_samples, n_classes) | sklearn.modules.generated.sklearn.pipeline.pipeline#sklearn.pipeline.Pipeline.predict_proba |
score(X, y=None, sample_weight=None) [source]
Apply transforms, and score with the final estimator Parameters
Xiterable
Data to predict on. Must fulfill input requirements of first step of the pipeline.
yiterable, default=None
Targets used for scoring. Must fulfill label requirements for all steps of the pi... | sklearn.modules.generated.sklearn.pipeline.pipeline#sklearn.pipeline.Pipeline.score |
score_samples(X) [source]
Apply transforms, and score_samples of the final estimator. Parameters
Xiterable
Data to predict on. Must fulfill input requirements of first step of the pipeline. Returns
y_scorendarray of shape (n_samples,) | sklearn.modules.generated.sklearn.pipeline.pipeline#sklearn.pipeline.Pipeline.score_samples |
set_params(**kwargs) [source]
Set the parameters of this estimator. Valid parameter keys can be listed with get_params(). Note that you can directly set the parameters of the estimators contained in steps. Returns
self | sklearn.modules.generated.sklearn.pipeline.pipeline#sklearn.pipeline.Pipeline.set_params |
property transform
Apply transforms, and transform with the final estimator This also works where final estimator is None: all prior transformations are applied. Parameters
Xiterable
Data to transform. Must fulfill input requirements of first step of the pipeline. Returns
Xtarray-like of shape (n_samples,... | sklearn.modules.generated.sklearn.pipeline.pipeline#sklearn.pipeline.Pipeline.transform |
sklearn.preprocessing.add_dummy_feature(X, value=1.0) [source]
Augment dataset with an additional dummy feature. This is useful for fitting an intercept term with implementations which cannot otherwise fit it directly. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Data.
valuefloat
... | sklearn.modules.generated.sklearn.preprocessing.add_dummy_feature#sklearn.preprocessing.add_dummy_feature |
sklearn.preprocessing.binarize(X, *, threshold=0.0, copy=True) [source]
Boolean thresholding of array-like or scipy.sparse matrix. Read more in the User Guide. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
The data to binarize, element by element. scipy.sparse matrices should be in CS... | sklearn.modules.generated.sklearn.preprocessing.binarize#sklearn.preprocessing.binarize |
class sklearn.preprocessing.Binarizer(*, threshold=0.0, copy=True) [source]
Binarize data (set feature values to 0 or 1) according to a threshold. Values greater than the threshold map to 1, while values less than or equal to the threshold map to 0. With the default threshold of 0, only positive values map to 1. Bina... | sklearn.modules.generated.sklearn.preprocessing.binarizer#sklearn.preprocessing.Binarizer |
sklearn.preprocessing.Binarizer
class sklearn.preprocessing.Binarizer(*, threshold=0.0, copy=True) [source]
Binarize data (set feature values to 0 or 1) according to a threshold. Values greater than the threshold map to 1, while values less than or equal to the threshold map to 0. With the default threshold of 0, o... | sklearn.modules.generated.sklearn.preprocessing.binarizer |
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.
yNone
Ignored. Returns
selfobject
Fitted transformer. | sklearn.modules.generated.sklearn.preprocessing.binarizer#sklearn.preprocessing.Binarizer.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.binarizer#sklearn.preprocessing.Binarizer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.binarizer#sklearn.preprocessing.Binarizer.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.binarizer#sklearn.preprocessing.Binarizer.set_params |
transform(X, copy=None) [source]
Binarize each element of X. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
The data to binarize, element by element. scipy.sparse matrices should be in CSR format to avoid an un-necessary copy.
copybool
Copy the input X or not. Returns
X_tr{nd... | sklearn.modules.generated.sklearn.preprocessing.binarizer#sklearn.preprocessing.Binarizer.transform |
class sklearn.preprocessing.FunctionTransformer(func=None, inverse_func=None, *, validate=False, accept_sparse=False, check_inverse=True, kw_args=None, inv_kw_args=None) [source]
Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (and optionally y) arguments to a user-defined fu... | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer |
sklearn.preprocessing.FunctionTransformer
class sklearn.preprocessing.FunctionTransformer(func=None, inverse_func=None, *, validate=False, accept_sparse=False, check_inverse=True, kw_args=None, inv_kw_args=None) [source]
Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (and ... | sklearn.modules.generated.sklearn.preprocessing.functiontransformer |
fit(X, y=None) [source]
Fit transformer by checking X. If validate is True, X will be checked. Parameters
Xarray-like, shape (n_samples, n_features)
Input array. Returns
self | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer.get_params |
inverse_transform(X) [source]
Transform X using the inverse function. Parameters
Xarray-like, shape (n_samples, n_features)
Input array. Returns
X_outarray-like, shape (n_samples, n_features)
Transformed input. | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer.set_params |
transform(X) [source]
Transform X using the forward function. Parameters
Xarray-like, shape (n_samples, n_features)
Input array. Returns
X_outarray-like, shape (n_samples, n_features)
Transformed input. | sklearn.modules.generated.sklearn.preprocessing.functiontransformer#sklearn.preprocessing.FunctionTransformer.transform |
class sklearn.preprocessing.KBinsDiscretizer(n_bins=5, *, encode='onehot', strategy='quantile', dtype=None) [source]
Bin continuous data into intervals. Read more in the User Guide. New in version 0.20. Parameters
n_binsint or array-like of shape (n_features,), default=5
The number of bins to produce. Raises ... | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer |
sklearn.preprocessing.KBinsDiscretizer
class sklearn.preprocessing.KBinsDiscretizer(n_bins=5, *, encode='onehot', strategy='quantile', dtype=None) [source]
Bin continuous data into intervals. Read more in the User Guide. New in version 0.20. Parameters
n_binsint or array-like of shape (n_features,), default=5... | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer |
fit(X, y=None) [source]
Fit the estimator. Parameters
Xarray-like of shape (n_samples, n_features)
Data to be discretized.
yNone
Ignored. This parameter exists only for compatibility with Pipeline. Returns
self | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer.get_params |
inverse_transform(Xt) [source]
Transform discretized data back to original feature space. Note that this function does not regenerate the original data due to discretization rounding. Parameters
Xtarray-like of shape (n_samples, n_features)
Transformed data in the binned space. Returns
Xinvndarray, dtype=... | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer.set_params |
transform(X) [source]
Discretize the data. Parameters
Xarray-like of shape (n_samples, n_features)
Data to be discretized. Returns
Xt{ndarray, sparse matrix}, dtype={np.float32, np.float64}
Data in the binned space. Will be a sparse matrix if self.encode='onehot' and ndarray otherwise. | sklearn.modules.generated.sklearn.preprocessing.kbinsdiscretizer#sklearn.preprocessing.KBinsDiscretizer.transform |
sklearn.preprocessing.KernelCenterer
class sklearn.preprocessing.KernelCenterer [source]
Center a kernel matrix. Let K(x, z) be a kernel defined by phi(x)^T phi(z), where phi is a function mapping x to a Hilbert space. KernelCenterer centers (i.e., normalize to have zero mean) the data without explicitly computing ... | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer |
class sklearn.preprocessing.KernelCenterer [source]
Center a kernel matrix. Let K(x, z) be a kernel defined by phi(x)^T phi(z), where phi is a function mapping x to a Hilbert space. KernelCenterer centers (i.e., normalize to have zero mean) the data without explicitly computing phi(x). It is equivalent to centering p... | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer#sklearn.preprocessing.KernelCenterer |
fit(K, y=None) [source]
Fit KernelCenterer Parameters
Kndarray of shape (n_samples, n_samples)
Kernel matrix.
yNone
Ignored. Returns
selfobject
Fitted transformer. | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer#sklearn.preprocessing.KernelCenterer.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer#sklearn.preprocessing.KernelCenterer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer#sklearn.preprocessing.KernelCenterer.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer#sklearn.preprocessing.KernelCenterer.set_params |
transform(K, copy=True) [source]
Center kernel matrix. Parameters
Kndarray of shape (n_samples1, n_samples2)
Kernel matrix.
copybool, default=True
Set to False to perform inplace computation. Returns
K_newndarray of shape (n_samples1, n_samples2) | sklearn.modules.generated.sklearn.preprocessing.kernelcenterer#sklearn.preprocessing.KernelCenterer.transform |
class sklearn.preprocessing.LabelBinarizer(*, neg_label=0, pos_label=1, sparse_output=False) [source]
Binarize labels in a one-vs-all fashion. Several regression and binary classification algorithms are available in scikit-learn. A simple way to extend these algorithms to the multi-class classification case is to use... | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer |
sklearn.preprocessing.LabelBinarizer
class sklearn.preprocessing.LabelBinarizer(*, neg_label=0, pos_label=1, sparse_output=False) [source]
Binarize labels in a one-vs-all fashion. Several regression and binary classification algorithms are available in scikit-learn. A simple way to extend these algorithms to the mu... | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer |
fit(y) [source]
Fit label binarizer. Parameters
yndarray 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
selfreturns an instance of self. | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer.fit |
fit_transform(y) [source]
Fit label binarizer and transform multi-class labels to binary labels. The output of transform is sometimes referred to as the 1-of-K coding scheme. Parameters
y{ndarray, sparse matrix} of shape (n_samples,) or (n_samples, n_classes)
Target values. The 2-d matrix should only contain 0 ... | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer.get_params |
inverse_transform(Y, threshold=None) [source]
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 transformation.
thresholdfloat, default=None
Threshold used in the bin... | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer.set_params |
transform(y) [source]
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_samples, n_classes)
Target values. The 2-d matrix should only contain 0 and 1, represe... | sklearn.modules.generated.sklearn.preprocessing.labelbinarizer#sklearn.preprocessing.LabelBinarizer.transform |
class sklearn.preprocessing.LabelEncoder [source]
Encode target labels with value between 0 and n_classes-1. This transformer should be used to encode target values, i.e. y, and not the input X. Read more in the User Guide. New in version 0.12. Attributes
classes_ndarray of shape (n_classes,)
Holds the label ... | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder |
sklearn.preprocessing.LabelEncoder
class sklearn.preprocessing.LabelEncoder [source]
Encode target labels with value between 0 and n_classes-1. This transformer should be used to encode target values, i.e. y, and not the input X. Read more in the User Guide. New in version 0.12. Attributes
classes_ndarray of ... | sklearn.modules.generated.sklearn.preprocessing.labelencoder |
fit(y) [source]
Fit label encoder. Parameters
yarray-like of shape (n_samples,)
Target values. Returns
selfreturns an instance of self. | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder.fit |
fit_transform(y) [source]
Fit label encoder and return encoded labels. Parameters
yarray-like of shape (n_samples,)
Target values. Returns
yarray-like of shape (n_samples,) | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder.get_params |
inverse_transform(y) [source]
Transform labels back to original encoding. Parameters
yndarray of shape (n_samples,)
Target values. Returns
yndarray of shape (n_samples,) | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder.set_params |
transform(y) [source]
Transform labels to normalized encoding. Parameters
yarray-like of shape (n_samples,)
Target values. Returns
yarray-like of shape (n_samples,) | sklearn.modules.generated.sklearn.preprocessing.labelencoder#sklearn.preprocessing.LabelEncoder.transform |
sklearn.preprocessing.label_binarize(y, *, classes, neg_label=0, pos_label=1, sparse_output=False) [source]
Binarize labels in a one-vs-all fashion. Several regression and binary classification algorithms are available in scikit-learn. A simple way to extend these algorithms to the multi-class classification case is ... | sklearn.modules.generated.sklearn.preprocessing.label_binarize#sklearn.preprocessing.label_binarize |
class sklearn.preprocessing.MaxAbsScaler(*, copy=True) [source]
Scale each feature by its maximum absolute value. This estimator scales and translates each feature individually such that the maximal absolute value of each feature in the training set will be 1.0. It does not shift/center the data, and thus does not de... | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler |
sklearn.preprocessing.MaxAbsScaler
class sklearn.preprocessing.MaxAbsScaler(*, copy=True) [source]
Scale each feature by its maximum absolute value. This estimator scales and translates each feature individually such that the maximal absolute value of each feature in the training set will be 1.0. It does not shift/... | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler |
fit(X, y=None) [source]
Compute the maximum absolute value to be used for later scaling. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
The data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
yNone
Ignored. Returns
selfobje... | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.get_params |
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 data that should be transformed back. Returns
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features)
Transformed array. | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.inverse_transform |
partial_fit(X, y=None) [source]
Online computation of max absolute value of 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
X{array-like, sparse matrix}... | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.partial_fit |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.set_params |
transform(X) [source]
Scale the data Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
The data that should be scaled. Returns
X_tr{ndarray, sparse matrix} of shape (n_samples, n_features)
Transformed array. | sklearn.modules.generated.sklearn.preprocessing.maxabsscaler#sklearn.preprocessing.MaxAbsScaler.transform |
sklearn.preprocessing.maxabs_scale(X, *, axis=0, copy=True) [source]
Scale each feature to the [-1, 1] range without breaking the sparsity. This estimator scales each feature individually such that the maximal absolute value of each feature in the training set will be 1.0. This scaler can also be applied to sparse CS... | sklearn.modules.generated.sklearn.preprocessing.maxabs_scale#sklearn.preprocessing.maxabs_scale |
class sklearn.preprocessing.MinMaxScaler(feature_range=0, 1, *, copy=True, clip=False) [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, e.g. between zero and one. The transformat... | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler |
sklearn.preprocessing.MinMaxScaler
class sklearn.preprocessing.MinMaxScaler(feature_range=0, 1, *, copy=True, clip=False) [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, e.g. ... | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler |
fit(X, y=None) [source]
Compute the minimum and maximum to be used for later scaling. Parameters
Xarray-like of shape (n_samples, n_features)
The data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
yNone
Ignored. Returns
selfobject
Fitted scaler. | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.get_params |
inverse_transform(X) [source]
Undo the scaling of X according to feature_range. Parameters
Xarray-like of shape (n_samples, n_features)
Input data that will be transformed. It cannot be sparse. Returns
Xtndarray of shape (n_samples, n_features)
Transformed data. | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.inverse_transform |
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_... | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.partial_fit |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.set_params |
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.modules.generated.sklearn.preprocessing.minmaxscaler#sklearn.preprocessing.MinMaxScaler.transform |
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 ... | sklearn.modules.generated.sklearn.preprocessing.minmax_scale#sklearn.preprocessing.minmax_scale |
class sklearn.preprocessing.MultiLabelBinarizer(*, classes=None, sparse_output=False) [source]
Transform between iterable of iterables and a multilabel format. Although a list of sets or tuples is a very intuitive format for multilabel data, it is unwieldy to process. This transformer converts between this intuitive ... | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer |
sklearn.preprocessing.MultiLabelBinarizer
class sklearn.preprocessing.MultiLabelBinarizer(*, classes=None, sparse_output=False) [source]
Transform between iterable of iterables and a multilabel format. Although a list of sets or tuples is a very intuitive format for multilabel data, it is unwieldy to process. This ... | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer |
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 | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer.fit |
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... | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer.get_params |
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, ... | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer.set_params |
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_... | sklearn.modules.generated.sklearn.preprocessing.multilabelbinarizer#sklearn.preprocessing.MultiLabelBinarizer.transform |
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.sp... | sklearn.modules.generated.sklearn.preprocessing.normalize#sklearn.preprocessing.normalize |
class sklearn.preprocessing.Normalizer(norm='l2', *, copy=True) [source]
Normalize samples individually to unit norm. Each sample (i.e. each row of the data matrix) with at least one non zero component is rescaled independently of other samples so that its norm (l1, l2 or inf) equals one. This transformer is able to ... | sklearn.modules.generated.sklearn.preprocessing.normalizer#sklearn.preprocessing.Normalizer |
sklearn.preprocessing.Normalizer
class sklearn.preprocessing.Normalizer(norm='l2', *, copy=True) [source]
Normalize samples individually to unit norm. Each sample (i.e. each row of the data matrix) with at least one non zero component is rescaled independently of other samples so that its norm (l1, l2 or inf) equal... | sklearn.modules.generated.sklearn.preprocessing.normalizer |
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
sel... | sklearn.modules.generated.sklearn.preprocessing.normalizer#sklearn.preprocessing.Normalizer.fit |
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_outp... | sklearn.modules.generated.sklearn.preprocessing.normalizer#sklearn.preprocessing.Normalizer.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.normalizer#sklearn.preprocessing.Normalizer.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.normalizer#sklearn.preprocessing.Normalizer.set_params |
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. ... | sklearn.modules.generated.sklearn.preprocessing.normalizer#sklearn.preprocessing.Normalizer.transform |
class sklearn.preprocessing.OneHotEncoder(*, categories='auto', drop=None, sparse=True, dtype=<class 'numpy.float64'>, handle_unknown='error') [source]
Encode categorical features as a one-hot numeric array. The input to this transformer should be an array-like of integers or strings, denoting the values taken on by ... | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder |
sklearn.preprocessing.OneHotEncoder
class sklearn.preprocessing.OneHotEncoder(*, categories='auto', drop=None, sparse=True, dtype=<class 'numpy.float64'>, handle_unknown='error') [source]
Encode categorical features as a one-hot numeric array. The input to this transformer should be an array-like of integers or str... | sklearn.modules.generated.sklearn.preprocessing.onehotencoder |
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 | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.fit |
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 ma... | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.fit_transform |
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_featur... | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.get_feature_names |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.get_params |
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. Ret... | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.set_params |
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. | sklearn.modules.generated.sklearn.preprocessing.onehotencoder#sklearn.preprocessing.OneHotEncoder.transform |
class sklearn.preprocessing.OrdinalEncoder(*, categories='auto', dtype=<class 'numpy.float64'>, handle_unknown='error', unknown_value=None) [source]
Encode categorical features as an integer array. The input to this transformer should be an array-like of integers or strings, denoting the values taken on by categorica... | sklearn.modules.generated.sklearn.preprocessing.ordinalencoder#sklearn.preprocessing.OrdinalEncoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.