beta_calibration: Beta Calibration

Description Usage Arguments See Also Examples

View source: R/beta_calibration.r

Description

Builds a beta calibration model on probability vector p and label vector y, fitting the parameters chosen by the user, with possible values being "abm", "ab" and "am". Returns the calibration model, the calibration map and the chosen parameters.

Usage

1
beta_calibration(p, y, parameters="abm")

Arguments

p

A vector of probabilities that will be used to train the calibration model.

y

A vector of labels that will be used to train the calibration model.

parameters

The parameters that will be fitted by the model.

See Also

beta_predict.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Creating a vector of probabilities
p <- seq(0.01,0.99,0.01)

## Creating a label vector based on the probability vector
y <- rbinom(99,1,p)

## Fitting beta calibration with three parameters
calib <- beta_calibration(p, y, "abm")

## Fitting beta calibration with two shape parameters
calib <- beta_calibration(p, y, "ab")

## Fitting beta calibration with one shape parameter and one location parameter
calib <- beta_calibration(p, y, "am")

Example output

[1] -78.54698
[1] 11.65647

betacal documentation built on May 1, 2019, 10:24 p.m.