BAGGING: Classification using Bagging

BAGGINGR Documentation

Classification using Bagging

Description

Ensemble learning, through Bagging Algorithm.

Usage

BAGGING(
  x,
  y,
  learningmethod,
  nsamples = 100,
  bag.size = nrow(x),
  tune = FALSE,
  methodparameters = NULL,
  graph = FALSE,
  seed = NULL,
  ...
)

Arguments

x

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

y

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

learningmethod

The boosted method.

nsamples

The number of samplings.

bag.size

The size of the samples.

tune

If true, the function returns parameters instead of a classification model.

methodparameters

Present for interface consistency with performance (which always passes it when fitting a model). Currently unused: BAGGING does not support reusing pre-tuned parameters (the base learner is fitted afresh on each sample).

graph

Present for interface consistency with performance (which always passes it when fitting a model). Currently unused: BAGGING does not produce a plot.

seed

A specified seed for random number generation.

...

Other specific parameters for the leaning method.

Value

The classification model.

See Also

ADABOOST, predict.boosting

Examples


require (datasets)
data (iris)
BAGGING (iris [, -5], iris [, 5], NB)


fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.