Learn R Programming

extraTrees (version 1.0.5)

prepareForSave: Prepares ExtraTrees object for save() function

Description

This function prepares ExtraTrees for saving by serializing the trees in Java VM. It is equivalent to calling .jcache(et$jobject). Afterwards the object can be saved by save (or automatic R session saving) and will be fully recovered after load.

Note: the object can still be used as usual after prepareForSave.

Usage

prepareForSave(object)

Arguments

object
extraTrees (S3) object, created by extraTrees().

Value

Nothing is returned.

Examples

Run this code
  et <- extraTrees(iris[,1:4], iris$Species)
  prepareForSave(et)
  ## saving to a file
  save(et, file="temp.Rdata")

  ## testing: remove et and load it back from file
  rm(list = "et")
  load("temp.Rdata")
  predict(et, iris[,1:4])

Run the code above in your browser using DataLab