dilimap.models.ToxPredictor

class dilimap.models.ToxPredictor(version='v1', model=None, multioutput=None, model_params=None, local_filepath=None)

ToxPredictor pre-trained v1 or initialize new model for re-training.

It supports multi-output classification and custom hyperparameters for model training.

Parameters:
  • version (str) – Model version; for TGP use ‘v0.1’, for DILImap use ‘v1’.

  • model (str) – The model type to be used, for instance ‘RandomForestClassifier’.

  • multioutput (bool) – Whether to use a multi-output classifier for the model.

  • model_params (dict) – Dictionary of parameters to pass to the model.

Usage:

from dilimap.models import ToxPredictor

model = ToxPredictor('v1')
results = model.predict(data)
safety_margins = model.compute_safety_margin(data, 'compound_name', 'dose_uM', 'Cmax_uM')
__init__(version='v1', model=None, multioutput=None, model_params=None, local_filepath=None)

Initializes the ToxPredictor model.

Methods

__init__([version, model, multioutput, ...])

Initializes the ToxPredictor model.

compute_DILI_dose_regimes([IC50_uM, dose_range])

Determines DILI dose regimes based on specified IC50.

compute_empirical_DILI_risk([IC50_uM, ...])

Calculates the empirical DILI risk likelihoods based on safety margin results.

compute_safety_margin(data[, pert_col, ...])

Computes the margin of safety (MOS) based on predicted toxicity.

cross_validate(X, y[, n_splits, groups, ...])

Performs cross-validation on the model using GroupKFold.

feature_importances([dili_pathways])

Compute feature-level AUC, mean decrease in impurity (MDI), and correlation with the true DILI label (Pearson and Spearman).

plot_DILI_dose_regimes(compound[, ...])

Plots the DILI likelihood dose-response curve for a given compound.

predict(data)

Predicts the DILI risk from pathways signatures.

predict_cv()

Predicts the DILI risk from pathways signatures.

predict_proba(data[, estimators, rescale])

Predicts class probabilities using trained estimators.

predict_proba_across_estimators(data[, ...])

Predict and collects class probabilities across all trained estimators.

predict_proba_cv([estimators, rescale])

Predicts class probabilities for cross-validated models.

pull_data()

Loads the training data from the model.

save_model(filepath[, push_to_s3])

Save the model to S3 registry.

Attributes

DILI_pathways

Returns the groups of pathways associated with DILI predictions.

classes_

Returns the classes of the classifier estimators.

estimators

Returns the trained estimators from cross-validation.

indices

Returns the training/test indices from cross-validation.

multioutput_estimators

Returns the estimators for each output dimension in a multi-output model.

test_fold_assignments