deepmol.scalers package
Submodules
deepmol.scalers.base_scaler module
- class BaseScaler[source]
Bases:
ABCAbstract class for all scalers. It is used to define the interface for all scalers.
- fit(dataset: Dataset, columns: Optional[list] = None) None[source]
Fits the dataset.
- dataset: Dataset
The dataset to be fitted.
- columns: list
The columns to be fitted.
- fit_transform(dataset: Dataset, columns: Optional[list] = None) None[source]
Fits and transforms the dataset.
- dataset: Dataset
The dataset to be fitted and transformed.
- columns: list
The columns to be fitted and transformed.
- abstract load(file_path: str) object[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
- partial_fit(dataset: Dataset) None[source]
Partially fits the dataset.
- dataset: Dataset
The dataset to be partially fitted.
- 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.
- abstract property scaler_object: 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)[source]
Bases:
BaseScalerBinarize data (set feature values to 0 or 1) according to a threshold.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class KernelCenterer[source]
Bases:
BaseScalerCenter a kernel matrix.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class MaxAbsScaler(copy: bool = True)[source]
Bases:
BaseScalerScale each feature by its maximum absolute value.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class MinMaxScaler(feature_range: Tuple[int, int] = (0, 1), copy: bool = True, clip: bool = False)[source]
Bases:
BaseScalerTransform features by scaling each feature to a given range.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class Normalizer(norm: str = 'l2', copy: bool = True)[source]
Bases:
BaseScalerNormalize samples individually to unit norm.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class PolynomialFeatures(degree: int = 2, interaction_only: bool = False, include_bias: bool = True, order: str = 'C')[source]
Bases:
BaseScalerGenerate polynomial and interaction features.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class PowerTransformer(method: str = 'yeo-johnson', standardize: bool = True, copy: bool = True)[source]
Bases:
BaseScalerApply a power transform featurewise to make data more Gaussian-like.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class QuantileTransformer(n_quantiles: int = 1000, output_distribution: str = 'uniform', ignore_implicit_zeros: bool = False, subsample: int = 100000, random_state: Optional[int] = None, copy: bool = True)[source]
Bases:
BaseScalerTransform features using quantiles information.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- 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)[source]
Bases:
BaseScalerScale features using statistics that are robust to outliers.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object
- class StandardScaler(copy: bool = True, with_mean: bool = True, with_std: bool = True)[source]
Bases:
BaseScalerStandardize features by removing the mean and scaling to unit variance.
- load(file_path: str)[source]
Loads the scaler object from a file.
- Parameters
file_path (str) – The path to the file where the scaler object is saved.
- partial_fit(dataset: Dataset) None[source]
Fits the scaler object to the dataset.
- Parameters
dataset (Dataset) – The dataset to fit the scaler object.
- property scaler_object
Returns the scaler object.
- Returns
The scaler object.
- Return type
object