summary.stratified_rf: Summary statistics from a model

Description Usage Arguments Details Examples

View source: R/rf_c50.R

Description

Calculates error statistics for out-of-bag samples from a stratified_rf model.

Usage

1
2
## S3 method for class 'stratified_rf'
summary(object, ...)

Arguments

object

A stratified_rf model.

...

other options (not currently used)

Details

Predictions for a class are made by averaging class probabilities across trees rather than by a majority vote. All trees are weighted equally.

Examples

1
2
3
4
5
data(iris)
groups <- list(c("Sepal.Length","Sepal.Width"),c("Petal.Length","Petal.Width"))
mtry <- c(1,1)
m <- stratified_rf(iris,"Species",groups,mtry,ntrees=2,multicore=FALSE)
summary(m)

Example output

Stratified Random Forest object

Out-of-bag prediction error:  5.38%

Confusion Matrix
            pred
real         setosa versicolor virginica
  setosa         29          1         0
  versicolor      0         28         2
  virginica       0          2        31

Class  setosa - Precision: 100% Recall: 96.6% 
Class  versicolor - Precision: 90.3% Recall: 93.3% 
Class  virginica - Precision: 93.9% Recall: 93.9% 

Predictor Variables:
Group 1 :  Sepal.Length, Sepal.Width 
Group 2 :  Petal.Length, Petal.Width 

Target Variable:  Species

Built with 2 trees

StratifiedRF documentation built on May 1, 2019, 10:28 p.m.