decorate.ranger {r2pmml}R Documentation

Decorates a "ranger" object with a "variable.levels" element.

Description

Decorates a "ranger" object with a "variable.levels" element.

Usage

## S3 method for class 'ranger'
decorate(x, data, ...)

Arguments

x

A "ranger" object.

data

The training dataset.

...

Arguments to pass on to the "decorate.default" function.

Examples


library("ranger")
library("r2pmml")

data(iris)
iris.ranger = ranger(Species ~ ., data = iris, num.trees = 17,
    write.forest = TRUE, probability = TRUE)
iris.ranger = decorate(iris.ranger, data = iris)
r2pmml(iris.ranger, file.path(tempdir(), "Iris-Ranger.pmml"))


[Package r2pmml version 0.28.0 Index]