deepmol.scalers package
Submodules
deepmol.scalers.base_scaler module
- class BaseScaler(scaler, columns: list | None = None)[source]
Bases:
ABC,TransformerAbstract class for all scalers. It is used to define the interface for all scalers.
- load(file_path: str) BaseScaler[source]
Loads the scaler object from a file.
- file_path: str
The path to the file where the scaler object is saved.
- Returns:
The scaler object.
- Return type:
object
- save(file_path: str) None[source]
Saves the scaler object to a file.
- file_path: str
The path to the file where the scaler object will be saved.
- scale(other_object, inplace=False, **kwargs)
Method that modifies an input object inplace or on a copy.
- Parameters:
self (object) – The class instance object.
other_object (object) – The object to apply the method to.
inplace (bool) – Whether to apply the method in place.
kwargs (dict) – Keyword arguments to pass to the method.
- Returns:
new_object – The new object.
- Return type:
object
- property scaler_object
Returns the scaler object.
- Returns:
The scaler object.
- Return type:
object
deepmol.scalers.sklearn_scalers module
- class Binarizer(threshold: float = 0.0, copy: bool = True, columns: list | None = None)[source]
Bases:
BaseScalerBinarize data (set feature values to 0 or 1) according to a threshold.
- class KernelCenterer(columns: list | None = None)[source]
Bases:
BaseScalerCenter a kernel matrix.
- class MaxAbsScaler(copy: bool = True, columns: list | None = None)[source]
Bases:
BaseScalerScale each feature by its maximum absolute value.
- class MinMaxScaler(feature_range: Tuple[int, int] = (0, 1), copy: bool = True, clip: bool = False, columns: list | None = None)[source]
Bases:
BaseScalerTransform features by scaling each feature to a given range.
- class Normalizer(norm: str = 'l2', copy: bool = True, columns: list | None = None)[source]
Bases:
BaseScalerNormalize samples individually to unit norm.
- class PolynomialFeatures(degree: int = 2, interaction_only: bool = False, include_bias: bool = True, order: str = 'C', columns: list | None = None)[source]
Bases:
BaseScalerGenerate polynomial and interaction features.
- class PowerTransformer(method: str = 'yeo-johnson', standardize: bool = True, copy: bool = True, columns: list | None = None)[source]
Bases:
BaseScalerApply a power transform featurewise to make data more Gaussian-like.
- class QuantileTransformer(n_quantiles: int = 1000, output_distribution: str = 'uniform', ignore_implicit_zeros: bool = False, subsample: int = 100000, random_state: int | None = None, copy: bool = True, columns: list | None = None)[source]
Bases:
BaseScalerTransform features using quantiles information.
- class RobustScaler(with_centering: bool = True, with_scaling: bool = True, quantile_range: Tuple[float, float] = (25.0, 75.0), copy: bool = True, unit_variance: bool = False, columns: list | None = None)[source]
Bases:
BaseScalerScale features using statistics that are robust to outliers.
- class StandardScaler(copy: bool = True, with_mean: bool = True, with_std: bool = True, columns: list | None = None)[source]
Bases:
BaseScalerStandardize features by removing the mean and scaling to unit variance.