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

1
  prepareForSave(object)

Arguments

object

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

Value

Nothing is returned.

Author(s)

Jaak Simm

Examples

1
2
3
4
5
6
7
8
9
  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])