predSummary | R Documentation |
Quick function to calculate performance metrics: confusion matrix, accuracy and balanced accuracy for classification; ROC AUC for binary classification; RMSE, R^2 and MAE for regression. Multi-class AUC is returned for multinomial classification.
predSummary(output, family = "")
output |
data.frame with columns |
family |
Optional character value to support specific glmnet models e.g. 'mgaussian', 'cox'. |
For multinomial classification, multi-class AUC as defined by Hand
and Till is calculated using pROC::multiclass.roc()
.
Multi-class balanced accuracy is calculated as the mean of the Recall for each class.
R^2 (coefficient of determination) is calculated as 1 - rss / tss, where rss = residual sum of squares, tss = total sum of squares. Pearson r^2 is also provided. Pearson r^2 can only range from 0 to 1, whereas R^2 can range from 1 to -Inf.
An object of class 'predSummary'. For classification a list is returned containing the confusion matrix table and a vector containing accuracy and balanced accuracy for classification, ROC AUC for classification. For regression a vector containing RMSE, R^2 and MAE is returned. For glmnet 'cox' models, Harrell's C-index is returned.
For glmnet 'mgaussian' models, an object of class 'predSummaryMulti' is
returned which is a list of vectors with regression metrics (RMSE, R^2,
MAE) for each response variable (i.e. each y
column).
metrics()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.