summary.xspliner: Summary method for xspliner object

Description Usage Arguments Details Examples

View source: R/methods-xspliner.R

Description

Summary method for xspliner object

Usage

1
2
3
4
## S3 method for class 'xspliner'
summary(object, predictor, ..., model = NULL,
  newdata = NULL, prediction_funs = list(function(object, newdata)
  predict(object, newdata)), env = parent.frame())

Arguments

object

xspliner object

predictor

predictor for xspliner model formula

...

Another arguments passed into model specific method.

model

Original black box model. Providing enables models comparison. See details.

newdata

Data used for models comparison. By default training data used for black box build.

prediction_funs

List of prediction functions for surrogate and black box model. For classification problem, different statistics are displayed based on predictions type. See details section for more info.

env

Environment in which newdata is stored (if not provided as parameter).

Details

The summary output depends strictly on data provided to it.

Standard output for providing only xspliner model (object parameter) return default glm::summary output.

Providing both xspliner model and predictor returns summary details for selecter variable. The following points decribe the rules:

If both object parameter and model (original black box) was provided, the summary displays comparison of original and surrogate model. The following points decribe the rules (y_s and y_o are predictions of surrogate and original model respectively on provided dataset). When comparing statistic is close to 1, this means surrogate model is similiar to black box one (according to this statistic).

For regression models:

For classification models the result depends on prediction type. When predictions are classified levels:

When predictions are response probabilities:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(randomForest)
set.seed(1)
data <- iris
# regression model
iris.rf <- randomForest(Petal.Width ~  Sepal.Length + Petal.Length + Species, data = data)
iris.xs <- xspline(iris.rf)
# Summary of quantitative variable transition
summary(iris.xs, "Sepal.Length")
# Summary of qualitative variable transition
summary(iris.xs, "Species")
# Comparing surrogate with original model (regression)
summary(iris.xs, model = iris.rf, newdata = data)

# Classification model

xspliner documentation built on Sept. 26, 2019, 1:02 a.m.