View source: R/performance.glm.R
performance.glm | R Documentation |
Produce indices of model performance for logistic regression
## S3 method for class 'glm' performance(x, data, digits = 4, p = 0.5, plot = TRUE, ...)
x |
an object of class |
data |
a data frame. If no data frame is provided, the model training data is used. |
digits |
integer; number of digits to print (default=4). |
p |
numeric; probability cutoff for classifying cases (default = 0.5) |
plot |
logical; If |
... |
not currently used |
The model in the glm
object is used to predict the
the predicted probability of being a "positive" case for each observation
in the data frame. If a data frame is not specified, the model is
applied to the training data (data frame contained in the model component
of the glm
object).
If the predicted probability is greater then p
, the case is
classified as "positive", "not positive" otherwise. The actual and
predicted classifications are compared to calculate performance
metrics.
The function returns general information
about the model, a confusion matrix and statistics generated by
the confusionMatrix
function from the caret
package, and a graph visualizing the results.
The results of the methods performance.glm
confusionMatrix
, roc_plot
,
lift_plot
.
# performance on training sample fit <- regress(caesarian ~ ., data = caesarian) performance(fit, plot=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.