classp: Extract class assignment probability from models and...

View source: R/extraction.R

classpR Documentation

Extract class assignment probability from models and predictions.

Description

Computes the class assignment probability for classification models.

Usage

classp(x, ...)

## S3 method for class 'predx'
classp(x, ...)

## S3 method for class 'caretx'
classp(x, newdata, ...)

Arguments

x

caretx model or predx prediction object.

...

extra arguments passed to methods, currently none.

newdata

test data set (optional).

Details

Returns NULL for regression models and predictions and throws a warning. The classp is a S3 generic function.

Value

For predx objects, a data frame with the columns .outcome and .fitted representing the true outcome and predicted class assignment, respectively, columns storing class assignment probabilities as welll as the winner_p variable storing the probability for the predicted class. For caretx models, the function returns a list of tibbles described above, each one for the training, resample (CV) and test data sets.


PiotrTymoszuk/caretExtra documentation built on Oct. 15, 2023, 10:03 p.m.