Prediction intervals via conformal inference and quantile regression
Prediction intervals via conformal inference and quantile regression
Nonparametric prediction intervals can be computed for fitted regression workflow objects using the split conformal inference method described by Romano et al (2019). To compute quantiles, this function uses Quantile Random Forests instead of classic quantile regression.
int_conformal_quantile(object,...)## S3 method for class 'workflow'int_conformal_quantile(object, train_data, cal_data, level =0.95,...)
Arguments
object: A fitted workflows::workflow() object.
...: Options to pass to quantregForest::quantregForest() (such as the number of trees).
train_data, cal_data: Data frames with the predictor and outcome data. train_data should be the same data used to produce object and cal_data is used to produce predictions (and residuals). If the workflow used a recipe, these should be the data that were inputs to the recipe (and not the product of a recipe).
level: The confidence level for the intervals.
Returns
An object of class "int_conformal_quantile" containing the information to create intervals (which includes object). The predict() method is used to produce the intervals.
Details
Note that the significance level should be specified in this function (instead of the predict() method).
cal_data should be large enough to get a good estimates of a extreme quantile (e.g., the 95th for 95% interval) and should not include rows that were in the original training set.
Note that the because of the method used to construct the interval, it is possible that the prediction intervals will not include the predicted value.