Description Usage Details Slots Examples
A predx class for binned probabilistic predictions with categorical bins specified by strings.
| 1 2 3 4 5 6 7 8 9 10 11 12 | BinCat(x)
is.BinCat(x)
## S4 method for signature 'BinCat'
predx_to_json(x)
## S4 method for signature 'BinCat'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S4 method for signature 'BinCat'
transform_predx(x, to_class, ...)
 | 
BinCat is flexible as it can be used for any binned predictions. Individual probabilities (prob) must be greater than or equal to 0 and less than or equal to 1 and the vector of probabilities must sum to 1.
In JSON and CSV representations, the bins are named cat and the probabilities are named prob.
predxA data.frame with two columns: cat (character) and prob (numeric).
| 1 2 3 4 5 6 7 8 9 10 11 | x <- BinCat(data.frame(
  cat = c('a', 'b', 'c'),
  prob = c(0, 0.3, 0.7)
))
x
# create predx dataframe
x_df <- as.predx_df(list(
 location = c('Mercury', 'Venus', 'Earth'),
 target = 'habitability',
 predx = list(x, x)
))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.