Skip to content

bagging

EvolutionaryBaggingClassifier(model=AUTOML_CLASSIFICATION_PIPELINE, param_grid=CLASSIFICATION_PARAM_GRID, population_size=10, sampling_size=1, metric=metrics.Accuracy, sampling_rate=1000, seed=42)

Bases: EvolutionaryBaggingEstimator, base.Classifier

Evolutionary Bagging Classifier follows the Oza Bagging approach to update the population of estimator pipelines.

PARAMETER DESCRIPTION
model

A river model or model pipeline that can be configured by the parameter grid.

DEFAULT: AUTOML_CLASSIFICATION_PIPELINE

param_grid

A parameter grid, that represents the configuration space of the model.

DEFAULT: CLASSIFICATION_PARAM_GRID

population_size

The population size estimates the size of the population as well as the size of the ensemble used for the prediction.

DEFAULT: 10

sampling_size

The sampling size estimates how many models are mutated within one mutation step.

DEFAULT: 1

metric

The river metric that should be optimised.

DEFAULT: metrics.Accuracy

sampling_rate

The sampling rate estimates the number of samples that are executed before a mutation step takes place.

DEFAULT: 1000

seed

Random number generator seed for reproducibility.

DEFAULT: 42

Examples:

>>> from river import datasets, ensemble, evaluate, metrics, compose, optim
>>> from river import preprocessing, neighbors, naive_bayes, tree
>>> from river import linear_model
>>> from EvOAutoML import classification, pipelinehelper
>>> dataset = datasets.Phishing()
>>> model = classification.EvolutionaryBaggingClassifier(seed=42)
>>> metric = metrics.F1()
>>> for x, y in dataset:
...     y_pred = model.predict_one(x)  # make a prediction
...     metric = metric.update(y, y_pred)  # update the metric
...     model = model.learn_one(x,y)  # make the model learn

predict_proba_one(x)

Averages the predictions of each classifier.

EvolutionaryOldestBaggingClassifier(model=AUTOML_CLASSIFICATION_PIPELINE, param_grid=CLASSIFICATION_PARAM_GRID, population_size=10, sampling_size=1, metric=metrics.Accuracy, sampling_rate=1000, seed=42)

Bases: EvolutionaryBaggingOldestEstimator, base.Classifier

Evolutionary Oldest Bagging Classifier follows the Oza Bagging approach to update the population of estimator pipelines. It mutates the population by removing the oldest model configuration.

PARAMETER DESCRIPTION
model

A river model or model pipeline that can be configured by the parameter grid.

DEFAULT: AUTOML_CLASSIFICATION_PIPELINE

param_grid

A parameter grid, that represents the configuration space of the model.

DEFAULT: CLASSIFICATION_PARAM_GRID

population_size

The population size estimates the size of the population as well as the size of the ensemble used for the prediction.

DEFAULT: 10

sampling_size

The sampling size estimates how many models are mutated within one mutation step.

DEFAULT: 1

metric

The river metric that should be optimised.

DEFAULT: metrics.Accuracy

sampling_rate

The sampling rate estimates the number of samples that are executed before a mutation step takes place.

DEFAULT: 1000

seed

Random number generator seed for reproducibility.

DEFAULT: 42

Examples:

>>> from river import datasets, ensemble, evaluate, metrics, compose, optim
>>> from river import preprocessing, neighbors, naive_bayes, tree
>>> from river import linear_model
>>> from EvOAutoML import classification, pipelinehelper
>>> dataset = datasets.Phishing()
>>> model = classification.EvolutionaryOldestBaggingClassifier(seed=42)
>>> metric = metrics.F1()
>>> for x, y in dataset:
...     y_pred = model.predict_one(x)  # make a prediction
...     metric = metric.update(y, y_pred)  # update the metric
...     model = model.learn_one(x,y)  # make the model learn

predict_proba_one(x)

Averages the predictions of each classifier.