binaryClassifierEffect: Binary Classifier Effects

Description Usage Arguments Value See Also Examples

View source: R/binaryClassification.R

Description

Produce a list of ggplots, showing the relationship between each predictor variable and a probability.

Given a data frame and a vector of probabilities, such as those produced by a binary classifier model, this function produces a list of ggplots, showing the relationship between each of the named variables and the probability.

It produces a violin plot for factors, a scatter plot with a loess fitted curve for numeric, and an error otherwise.

Usage

1
2
binaryClassifierEffect(probs, df, var.names, max.n = 1000, display = FALSE,
  log.names = NULL)

Arguments

probs

A vector of estimated probabilities, from 0 to 1.

df

A data frame containing variables that were used to predict some binary outcome.

var.names

A vector of column names from df.

max.n

The maximum number of points to include in the resulting scatter plots.

display

A logical, that determines is the resulting plots are displayed or just returned.

log.names

A vector of column names to plot in log scale

Value

A list of ggplot objects, suitable for printing or saving.

See Also

qplot

Examples

1
2
3
4
5
df<-mtcars
df$am<-as.factor(df$am)
model<-glm(vs ~ am*mpg, data=df, family=binomial)
probs<-model$fit
binaryClassifierEffect(probs,df,c('am','mpg'))

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.