randomForest: Interfaces for randomForest package for data science...

Description Usage Arguments Details Value Author(s) Examples

Description

Interfaces to randomForest functions that can be used in a pipeline implemented by magrittr.

Usage

1

Arguments

data

data frame, tibble, list, ...

...

Other arguments passed to the corresponding interfaced function.

Details

Interfaces call their corresponding interfaced function.

Value

Object returned by interfaced function.

Author(s)

Roberto Bertolusso

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
library(intubate)
library(magrittr)
library(randomForest)

## randomForest
## Original function to interface
set.seed(71)
iris.rf <- randomForest(Species ~ ., data = iris,
                        importance = TRUE, proximity = TRUE)
print(iris.rf)
plot(iris.rf)

## The interface reverses the order of data and formula
set.seed(71)
iris.rf <- ntbt_randomForest(iris, Species ~ .,
                             importance = TRUE, proximity = TRUE)
print(iris.rf)
plot(iris.rf)

## so it can be used easily in a pipeline.
set.seed(71)
iris %>%
  ntbt_randomForest(Species ~ ., importance = TRUE,
                    proximity = TRUE) %>%
  plot()

## End(Not run)

Example output

randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.

Call:
 randomForest(formula = Species ~ ., data = iris, importance = TRUE,      proximity = TRUE) 
               Type of random forest: classification
                     Number of trees: 500
No. of variables tried at each split: 2

        OOB estimate of  error rate: 5.33%
Confusion matrix:
           setosa versicolor virginica class.error
setosa         50          0         0        0.00
versicolor      0         46         4        0.08
virginica       0          4        46        0.08

Call:
 randomForest(formula = Species ~ ., data = iris, importance = TRUE,      proximity = TRUE) 
               Type of random forest: classification
                     Number of trees: 500
No. of variables tried at each split: 2

        OOB estimate of  error rate: 5.33%
Confusion matrix:
           setosa versicolor virginica class.error
setosa         50          0         0        0.00
versicolor      0         46         4        0.08
virginica       0          4        46        0.08

intubate documentation built on May 2, 2019, 2:46 p.m.