Description Usage Arguments Value See Also
This is a utility function to simplify and standardize access to model probabilities. The situation is a bit fiddly because not all models return probabilities (e.g. kknn), and those that do are not all in the same format (e.g. fnn.* returns only a single vector of probabilities for the most likely class). This function will return the same structure regardless of model type encountered.
for models that compute probabilities by class, these probabilities will be returned;
for models that compute only the probability of the most likely class, this function will put that probability in the correct column and will fill the remaining cells in the row with equal values such that the row total is 1. Note that these are not the true probabilities, but merely inserted so the assumption that row totals are 1 is satisfied.
for models that do not compute probabilities, 1 will be inserted in the correct column and the remainder will be set to zero.
Also note that this function is only useful for categorical data (isCat returns
).
TRUE
1 | getProb(model)
|
model |
the model from which to recover the probability table |
a matrix of probabilities in which columns are labelled with the class names
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.