Simple approach to balance the probabilities from an inbalanced multiclass/multinomial model. Divides the probability by the class frequency used in the training dataset. Note: this calculates based on the named columns and the named frequencies matching so makes sure they match ok
1 | balanceMultiProbs(probs, freqs)
|
probs |
a dataframe of the probabilities, each column with the class name in factor order |
freqs |
named proportions from the training data as from prop.table(table(target)) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.