ConformalRegression: Class ConformalRegression: Conformal Prediction for...

Description Details Author(s) References See Also Examples

Description

R reference class to create and visualize confidence intervals for individual predictions according to the conformal prediction framework.

Details

The reference class ConformalRegression contains the following fields:

The class ConformalRegression contains the following methods:

Author(s)

Isidro Cortes-Ciriano <isidrolauscher@gmail.com>

References

Norinder et al. J. Chem. Inf. Model., 2014, 54 (6), pp 1596-1603 DOI: 10.1021/ci5001168 http://pubs.acs.org/doi/abs/10.1021/ci5001168

See Also

ConformalRegression-class ConformalClassification ConformalClassification-class conformal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
showClass("ConformalRegression")
#############################################
### Example
#############################################

## NOTE: the model built in this example has low predictive power as 
## only little fraction of the training data set is used in order
## to make the example quick to run.
## Thus, the example merely intends to illustrate the code. 

# Optional for parallel training
#library(doMC)
#registerDoMC(cores=4)

data(LogS)

# Remove part of the data to allow for quick training
LogSTrain <- LogSTrain[1:20]
LogSTest <- LogSTest[1:20]
LogSDescsTrain <- LogSDescsTrain[1:20,]
LogSDescsTest <- LogSDescsTest[1:20,]

algorithm <- "svmRadial"
tune.grid <- expand.grid(.sigma = expGrid(power.from=-10, power.to=-6, power.by=2, base=2), 
                         .C = c(1,10,100))
trControl <- trainControl(method = "cv",  number=5,savePredictions=TRUE)
set.seed(1)
model <- train(LogSDescsTrain, LogSTrain, algorithm, 
               tuneGrid=tune.grid, 
               trControl=trControl)


# Train an error model
error_model <- ErrorModel(PointPredictionModel=model,x.train=LogSDescsTrain,
                          savePredictions=TRUE,algorithm=algorithm,
                          trControl=trControl, 
                          tune.grid=tune.grid)

# Instantiate the class and get the confidence intervals
example <- ConformalRegression$new()
example$CalculateAlphas(model=model,error_model=error_model,ConformityMeasure=StandardMeasure)
example$GetConfidenceIntervals(new.data=LogSDescsTest)
example$CorrelationPlot(obs=LogSTest)
example$plot

conformal documentation built on May 30, 2017, 6:49 a.m.