Metrics are one of the most important parts of machine learning. Unlike traditional software, in which algorithms either work or don't work, machine learning models work in degrees. That is, there's a continuous range of "goodness" for a model. "Metrics" are functions which measure how well a model works. There are many different choices of metrics depending on the type of model at hand.
Metric utility functions allow for some common manipulations such as switching to/from one-hot representations.
deepchem.metrics.to_one_hot
deepchem.metrics.from_one_hot
One of the trickiest parts of handling metrics correctly is making sure the shapes of input weights, predictions and labels and processed correctly. This is challenging in particular since DeepChem supports multitask, multiclass models which means that shapes must be handled with care to prevent errors. DeepChem maintains the following utility functions which attempt to facilitate shape handling for you.
deepchem.metrics.normalize_weight_shape
deepchem.metrics.normalize_labels_shape
deepchem.metrics.normalize_prediction_shape
deepchem.metrics.handle_classification_mode
DeepChem has a variety of different metrics which are useful for measuring model performance. A number (but not all) of these metrics are directly sourced from sklearn
.
deepchem.metrics.matthews_corrcoef
deepchem.metrics.recall_score
deepchem.metrics.r2_score
deepchem.metrics.mean_squared_error
deepchem.metrics.mean_absolute_error
deepchem.metrics.precision_score
deepchem.metrics.precision_recall_curve
deepchem.metrics.auc
deepchem.metrics.jaccard_score
deepchem.metrics.f1_score
deepchem.metrics.roc_auc_score
deepchem.metrics.accuracy_score
deepchem.metrics.balanced_accuracy_score
deepchem.metrics.top_k_accuracy_score
deepchem.metrics.pearson_r2_score
deepchem.metrics.jaccard_index
deepchem.metrics.pixel_error
deepchem.metrics.prc_auc_score
deepchem.metrics.rms_score
deepchem.metrics.mae_score
deepchem.metrics.kappa_score
deepchem.metrics.bedroc_score
deepchem.metrics.concordance_index
deepchem.metrics.genomic_metrics.get_motif_scores
deepchem.metrics.genomic_metrics.get_pssm_scores
deepchem.metrics.genomic_metrics.in_silico_mutagenesis
The dc.metrics.Metric
class is a wrapper around metric functions which interoperates with DeepChem dc.models.Model
.
deepchem.metrics.Metric