Compute Performance Metrics for Logistic Regression Models
computeMetrics.Rd
Calculates various performance metrics for an oblr model.
Details
This function calculates the following metrics:
Log-likelihood (LogLik): $$LogLik = \sum_{i=1}^n [y_i \log(p_i) + (1-y_i) \log(1-p_i)]$$ where \(y_i\) are the observed values and \(p_i\) are the predicted probabilities.
Akaike Information Criterion (AIC): $$AIC = 2k - 2LogLik$$ where \(k\) is the number of parameters in the model.
Bayesian Information Criterion (BIC): $$BIC = k\log(n) - 2LogLik$$ where \(n\) is the number of observations.
Area Under the ROC Curve (AUC): AUC is the area under the Receiver Operating Characteristic curve, which plots the true positive rate against the false positive rate.
Gini Coefficient: $$Gini = 2 * AUC - 1$$
Kolmogorov-Smirnov Statistic (KS): $$KS = \max|F_1(x) - F_0(x)|$$ where \(F_1(x)\) and \(F_0(x)\) are the cumulative distribution functions for the positive and negative classes, respectively.
Accuracy: $$Accuracy = \frac{TP + TN}{TP + TN + FP + FN}$$ where TP = True Positives, TN = True Negatives, FP = False Positives, FN = False Negatives.
Recall (Sensitivity): $$Recall = \frac{TP}{TP + FN}$$
Precision: $$Precision = \frac{TP}{TP + FP}$$
F1-Score: $$F1 = 2 * \frac{Precision * Recall}{Precision + Recall}$$
These metrics provide a comprehensive view of the model's performance, including its predictive capability (AUC, KS), fit to the data (LogLik, AIC, BIC), and performance in classification tasks (Accuracy, Recall, Precision, F1-Score).