Learn R Programming

fdm2id (version 0.9.1)

bootstrap: Bootstrap evaluation

Description

Evaluation a classification or regression method using bootstrap approach.

Usage

bootstrap(
  methods,
  x,
  y,
  eval = ifelse(is.factor(y), "accuracy", "r2"),
  nruns = 10,
  seed = NULL,
  methodparameters = NULL,
  names = NULL,
  ...
)

Arguments

methods

The classification or regression method to be evaluated.

x

The dataset (description/predictors), a matrix or data.frame.

y

The target (class labels or numeric values), a factor or vector.

eval

The evaluation function.

nruns

The number of bootstrap runs.

seed

A specified seed for random number generation (useful for testing different method with the same bootstap samplings).

methodparameters

Method parameters (if null tuning is done by cross-validation).

names

Method names.

...

Other specific parameters for the leaning method.

Value

The evaluation of the predictions (numeric value).

See Also

evaluate, evaluation, bootstrap.curves

Examples

Run this code
# NOT RUN {
require ("datasets")
data (iris)
# One method, one evaluation criterion
bootstrap (NB, iris [, -5], iris [, 5], seed = 0)
# One method, two evaluation criteria
bootstrap (NB, iris [, -5], iris [, 5], eval = c ("accuracy", "kappa"), seed = 0)
# Three methods, two evaluation criteria
bootstrap (c (NB, LDA, LR), iris [, -5], iris [, 5], eval = c ("accuracy", "kappa"), seed = 0)
# List of methods in a variable
classif = c (NB, LDA, LR)
bootstrap (classif, iris [, -5], iris [, 5], eval = c ("accuracy", "kappa"), seed = 0,
           names = c ("NB", "LDA", "LR"))
# List of strings (method names)
classif = c ("NB", "LDA", "LR")
bootstrap (classif, iris [, -5], iris [, 5], eval = c ("accuracy", "kappa"), seed = 0)
# }

Run the code above in your browser using DataLab