Learn R Programming

What is Medley?

Medley is an R package which implements the Caruana et al., 2004 algorithm for greedy stepwise ensemble selection for regression models.

The idea behind medley is to make the creation of "ensembles" or "blends" of models as simple as possible. Individual models can be produced by varying hyperparameters or input feature sets, as well as by changing the underlying model code.

Usage example

require(medley);
require(randomForest);
require(e1071);

# x and y are the training predictors and responses respectively
m <- create.medley(x, y, errfunc=rmse);

# add SVMs for a variety of gamma parameters
for (g in 1:10) {
  m <- add.medley(m, svm, list(gamma=1e-3 * g));
}

# add random forests with varying mtry parameter
for (mt in c(5, 10, 20, 50)) {
  m <- add.medley(m, randomForest, list(mtry=mt));
}

# use only the best 80% of individual models
m <- prune.medley(m, 0.8);

# predict using new predictor matrix newx
p <- predict(m, newx);

Copy Link

Version

Version

0.1.0

License

BSD

Maintainer

Martin OLeary

Last Published

February 15th, 2017

Functions in medley (0.1.0)

loess.fit

Wrapper for loess fit
add.medley

Add a new model to an existing medley
combine.medley

Recursively combine two or more medley objects for the same problem
predict.constant

Trivial regression model which returns a given constant
mae

Calculate mean absolute error metric
predict.medley

Make a prediction based on a medley
medley

Greedy ensemble selection for regression model
prune.medley

Prune the models in a medley
rmse

Calculate root-mean-square error metric
constant

Trivial regression model which returns a given constant
create.medley

Create a new (empty) medley object
logloss

Calculate log-loss error metric