epcreg.save: Custom Functions for Disk I/O in 'EnsemblePCReg' Package

Description Usage Arguments Value Author(s) See Also Examples

Description

These functions can be used whether filemethod flag is set to TRUE or FALSE during the epcreg call. Note that epcreg.load ‘returns’ the estimation object (in contrast to the standard load method).

Usage

1
2

Arguments

obj

Object of classes "epcreg" (and possibly "epcreg.file"), typically the output of call to function epcreg.

file

Filepath to where obj must be saved to / loaded from.

Value

Function epcreg.load returns the saved obj, with estimation files automatically copied to R temporary directory, and filepaths inside the obj fields updated to point to these new filepaths (if filemethod was set to TRUE in the call to epcreg).

Author(s)

Mansour T.A. Sharabiani, Alireza S. Mahani

See Also

epcreg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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,]
est <- epcreg(myformula, data.train, ncores=2
  , baselearner.control=epcreg.baselearner.control(
    baselearners="knn"
    , baselearner.configs = make.configs("knn"
      , config.df = expand.grid(kernel = "rectangular"
        , k = c(5, 10)))), filemethod = TRUE)
epcreg.save(est, "somefile")
rm(est) # alternatively, exit and re-launch R session
est.loaded <- epcreg.load("somefile")
newpred <- predict(est.loaded, data.predict)

EnsemblePCReg documentation built on May 1, 2019, 6:28 p.m.