plot_clf_probabilities: plot_clf_probabilities

View source: R/ranger_clf_plot.R

plot_clf_probabilitiesR Documentation

plot_clf_probabilities

Description

plot_clf_probabilities

Usage

plot_clf_probabilities(
  y,
  rf_clf_model,
  positive_class = NA,
  prefix = "train",
  outdir = NULL
)

Arguments

y

A factor of classes to be used as the true results

rf_clf_model

The rf classification model from rf.out.of.bag

positive_class

an optional character string for the factor level that corresponds to a "positive" result (if that makes sense for your data). If there are only two factor levels, the first level will be used as the "positive" result.

prefix

The prefix of data set.

outdir

The output directory.

Author(s)

Shi Huang

Examples

set.seed(123)
x <- data.frame(rbind(t(rmultinom(7, 75, c(.201,.5,.02,.18,.099))),
            t(rmultinom(8, 75, c(.201,.4,.12,.18,.099))),
            t(rmultinom(15, 75, c(.011,.3,.22,.18,.289))),
            t(rmultinom(15, 75, c(.091,.2,.32,.18,.209))),
            t(rmultinom(15, 75, c(.001,.1,.42,.18,.299)))))
y<-factor(c(rep("1", 20), rep("A", 20), rep("C", 20)))
rf_clf_model<-rf.out.of.bag(x, y)
positive_class="1"
plot_clf_probabilities(y, rf_clf_model, positive_class, outdir='./')

shihuang047/crossRanger documentation built on Feb. 7, 2023, 10:03 p.m.