Learn R Programming

EnsembleBase (version 1.0.0)

Regression.CV.Batch.Fit: CV Batch Training and Diagnostics of Regression Base Learners

Description

CV Batch Training and Diagnostics of Regression Base Learners.

Usage

Regression.CV.Batch.Fit(instance.list, formula, data
  , ncores = 1, filemethod = FALSE, print.level = 1
  , preschedule = TRUE
  , schedule.method = c("random", "as.is", "task.length")
  , task.length)
## S3 method for class 'Regression.CV.Batch.FitObj':
predict(object, ..., ncores=1
  , preschedule = TRUE)
## S3 method for class 'Regression.CV.Batch.FitObj':
plot(x, errfun=rmse.error, ylim.adj = NULL, ...)

Arguments

instance.list
An object of class Instance.List, containing all combinations of base learner configurations and data partitions to perform CV batch training.
formula
Formula object expressing response variable and covariates.
data
Data frame expressing response variable and covariates.
ncores
Number of cores in parallel training.
filemethod
Boolean flag, indicating whether to save estimation objects to file or not.
print.level
Verbosity level.
preschedule
Boolean flag, indicating whether parallel jobs must be scheduled statically (TRUE) or dynamically (FALSE).
schedule.method
Method used for scheduling tasks across threads. In as.is, tasks are distributed in round-robin fashion. In random, tasks are randomly shuffled before round-robin distribution. In task.length, estimated task executio
task.length
Estimation task execution times, to be used for loading balancing during parallel execution.
object
Output of Regression.CV.Batch.Fit, object of class Regression.CV.Batch.FitObj.
...
Arguments passed from/to other functions.
x
Object of class Regression.CV.Batch.FitObj, to creates a plot from.
errfun
Error function used in generating plot.
ylim.adj
Optional numeric argument to use for adjusting the range of y-axis.

Value

  • Function Regression.CV.Batch.Fit produces an object of class Regression.CV.Batch.FitObj. The predict method produces a matrix, whose columns each represent training-set predictions from one of the batch of base learners (in CV fashion).

See Also

Regression.CV.Batch.FitObj

Examples

Run this code
data(servo)
myformula <- class~motor+screw+pgain+vgain

perc.train <- 0.7
index.train <- sample(1:nrow(servo)
  , size = round(perc.train*nrow(servo)))
data.train <- servo[index.train,]
data.predict <- servo[-index.train,]

parts <- generate.partitions(1, nrow(data.train))
myconfigs <- make.configs("knn"
  , config.df = expand.grid(kernel = "rectangular", k = c(5, 10)))
instances <- make.instances(myconfigs, parts)

ret <- Regression.CV.Batch.Fit(instances, myformula, data.train)
newpred <- predict(ret, data.predict)

Run the code above in your browser using DataLab