deepmol.base package
Submodules
deepmol.base.estimator module
deepmol.base.predictor module
- class Predictor[source]
Bases:
objectAbstract base class for predictors. A predictor is an object that can make predictions on a Dataset object. All predictors must implement the predict(), predict_proba(), and evaluate() methods.
- abstract evaluate(dataset: Dataset, metrics: List[Metric] | Metric, per_task_metrics: bool = False) Tuple[Dict, None | Dict][source]
Evaluates the predictor of this model on specified dataset using specified metrics.
- is_fitted() bool[source]
Whether the predictor is fitted.
- Returns:
True if the predictor is fitted, False otherwise.
- Return type:
bool
- abstract classmethod load(model_dir: str) Predictor[source]
Loads a predictor from disk.
- Parameters:
model_dir (str) – Directory where the predictor is stored.
- Returns:
The loaded predictor.
- Return type:
- property model_dir: str
Directory where the model will be stored.
- Returns:
Directory where the model is stored.
- Return type:
str
- property model_type: str
Type of model.
- Returns:
Type of model.
- Return type:
str
- abstract predict(dataset: Dataset, return_invalid: bool = False) ndarray[source]
Uses self to make predictions on provided Dataset object.
- Parameters:
dataset (Dataset) – Dataset to make prediction on
return_invalid (bool) – Return invalid entries with NaN
- Returns:
A numpy array of predictions.
- Return type:
np.ndarray
- abstract predict_proba(dataset: Dataset, return_invalid: bool = False) ndarray[source]
Uses self to make predictions on provided Dataset object.
- Parameters:
dataset (Dataset) – Dataset to make prediction on
return_invalid (bool) – Return invalid entries with NaN
- Returns:
A numpy array of predictions.
- Return type:
np.ndarray
deepmol.base.transformer module
- class DatasetTransformer(func, **kwargs)[source]
Bases:
TransformerA transformer that transforms a dataset by applying a function to it.
- class PassThroughTransformer(**kwargs)[source]
Bases:
TransformerA transformer that does nothing.
- class Transformer(**kwargs)[source]
Bases:
EstimatorAbstract base class for transformers. A transformer is an object that can transform a Dataset object.