Learn R Programming

⚠️There's a newer version (2.19.1) of this package.Take me there.

mlr (version 2.2)

Machine Learning in R.

Description

Interface to a large number of classification and regression techniques, including machine-readable parameter descriptions. There is also an experimental extension for survival analysis, clustering and general, example-specific cost-sensitive learning. Generic resampling, including cross-validation, bootstrapping and subsampling. Hyperparameter tuning with modern optimization techniques, for single- and multi-objective problems. Filter and wrapper methods for feature selection. Extension of basic learners with additional operations common in machine learning, also allowing for easy nested resampling. Most operations can be parallelized.

Copy Link

Version

Install

install.packages('mlr')

Monthly Downloads

7,145

Version

2.2

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

October 29th, 2014

Functions in mlr (2.2)

configureMlr

Configures the behavior of the package.
FailureModel

Failure model.
ResamplePrediction

Prediction from resampling.
estimateResidualVariance

Estimate the residual variance
aggregations

Aggregation methods.
LearnerProperties

Set, add, remove or query properties of learners
predictLearner

Predict new data with an R learner.
makeFilter

Create a feature filter
subsetTask

Subset data in task.
plotThreshVsPerf

Plot threshold vs. performance(s) for 2-class classification.
tuneThreshold

Tune prediction threshold.
costiris.task

Iris cost-sensitive classification task
getCostSensWeightedPairsModels

Returns the list of fitted models.
analyzeFeatSelResult

Show and visualize the steps of feature selection.
isFailureModel

Is the model a FailureModel?
predict.WrappedModel

Predict new data.
makeResampleInstance

Instantiates a resampling strategy object.
learners

List of supported learning algorithms.
mtcars.task

Motor Trend Car Road Tests clustering task
normalizeFeatures

Normalize features
joinClassLevels

Join some class existing levels to new, larger class levels for classification problems.
makeCustomResampledMeasure

Construct your own resampled performance measure.
makeStackedLearner

Create a stacked learner object.
makeUndersampleWrapper

Fuse learner with simple ove/underrsampling for imbalancy correction in binary classification.
getBMRTaskIds

Return task ids used in benchmark.
getBaggingModels

Returns the list of models fitted in bagging.
getCostSensClassifModel

Returns the underlying classification model.
plotLearnerPrediction

Visualizes a learning algorithm on a 1D or 2D data set.
TuneMultiCritResult

Result of multi-criteria tuning.
makeWeightedClassesWrapper

Wraps a classifier for weighted fitting where each class receives a weight.
TuneResult

Result of tuning.
makeCostSensRegrWrapper

Wraps a regression learner for use in cost-sensitive learning.
Prediction

Prediction object.
Aggregation

makeTuneWrapper

Fuse learner with tuning.
TaskDesc

Description object for task.
agri.task

European Union Agricultural Workforces clustering task
crossover

crossover
setId

Set the id of a learner object.
getTaskTargets

Get target column of task.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
makeTuneMultiCritControlGrid

Create control structures for multi-criteria tuning.
makeOverBaggingWrapper

Fuse learner with the bagging technique and oversampling for imbalancy correction.
trainLearner

Train an R learner.
makeAggregation

Specifiy your own aggregation of measures
benchmark

Benchmark experiment for multiple learners and tasks.
downsample

Downsample (subsample) a task or a data.frame.
listFilterMethods

List filter methods
bc.task

Wisconsin Breast Cancer classification task
removeHyperPars

Remove hyperparameters settings of a learner.
makeResampleDesc

Create a description object for a resampling strategy.
listLearners

Find matching learning algorithms.
oversample

Over- or undersample binary classification task to handle class imbalancy.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task
RLearner

Internal construction / wrapping of learner object.
showHyperPars

Display all possible hyperparameter settings for a learner that mlr knows.
makeMeasure

Construct performance measure.
summarizeColumns

Summarize columns of data.frame or task.
makeClassifTask

Create a classification, regression, survival, cluster, or cost-sensitive classification task.
removeConstantFeatures

Remove constant features from a data set.
performance

Measure performance of prediction.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
FeatSelResult

Result of feature selection.
smote

Synthetic Minority Oversampling Technique to handle class imbalancy in binary classification.
pid.task

PimaIndiansDiabetes classification task
getMlrOptions

Returns a list of mlr's options
crossval

Fit models according to a resampling strategy.
createDummyFeatures

Generate dummy variables for factor features.
selectFeatures

Feature selection by wrapper approach.
getLearnerModel

Get underlying R model of learner integrated into mlr.
getFilteredFeatures

Returns the filtered features.
plotFilterValues

Plot filter values.
setThreshold

Set threshold of prediction object.
sonar.task

Sonar classification task
getTaskFormulaAsString

Get formula of a task.
getCostSensRegrModels

Returns the list of fitted models.
getTaskFeatureNames

Get feature names of task.
makeBaggingWrapper

Fuse learner with the bagging technique.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
makeFeatSelControlExhaustive

Create control structures for feature selection.
summarizeLevels

Summarizes factors of a data.frame by tabling them.
reimpute

Re-impute a data set
learnerArgsToControl

Convert arguments to control structure.
makeMulticlassWrapper

Fuse learner with multiclass method.
makeImputeMethod

Create a custom imputation method.
getBMRPerformances

Extract the test performance values from a benchmark result.
makeTuneControlCMAES

Create control structures for tuning.
makeWrappedModel

Induced model of learner.
makeCostSensClassifWrapper

Wraps a classification learner for use in cost-sensitive learning.
plotTuneMultiCritResult

Plots multi-criteria results after tuning.
listMeasures

Find matching measures.
BenchmarkResult

Result of a benchmark run.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
setPredictType

Set the type of predictions the learner should return.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
makeSMOTEWrapper

Fuse learner with SMOTE oversampling for imbalancy correction in binary classification.
getTaskNFeats

Get number of features in task.
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.
tuneParams

Hyperparameter tuning.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
bh.task

Boston Housing regression task
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
makeFilterWrapper

Fuse learner with a feature filter method.
makeLearner

Create learner object.
measures

Performance measures.
getProbabilities

Get probabilities for some classes.
impute

Impute and re-impute data
setHyperPars

Set the hyperparameters of a learner object.
makePreprocWrapper

Fuse learner with preprocessing.
FilterValues

mergeSmallFactorLevels

Merges small levels of factors into new level.
makeImputeWrapper

Fuse learner with an imputation method.
makeModelMultiplexer

Create model multiplexer for model selection to tune over multiple possible models.
train

Train a learning algorithm.
setAggregation

Set aggregation function of measure.
setHyperPars2

Only exported for internal use.
getFeatSelResult

Returns the selected feature set and optimization path after training.
getHyperPars

Get current parameter settings for a learner.
filterFeatures

Filter features by thresholding filter values.
getBMRPredictions

Extract the predictions from a benchmark result.
getConfMatrix

Confusion matrix.
getBMRTuneResults

Extract the tuning results from a benchmark result.
capLargeValues

Convert large/infinite numeric values in a data.frame or task.
getBMRLearnerIds

Return learner ids used in benchmark.
dropFeatures

Drop some features of task.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
iris.task

Iris classification task
getTaskData

Extract data in task.
lung.task

NCCTG Lung Cancer survival task
getTaskCosts

Extract costs in task.
getParamSet

Get a description of all possible parameter settings for a learner.
imputations

Built in imputation methods The built-ins are:
  • imputeConstant(const)for imputation using a constant value,
  • imputeMedian()for imputation using the median,
  • imputeMode()for imputation using the mode,
  • imputeMin(multiplier)for imputing constant values shifted below the minimum usingmin(x) - multiplier * diff(range(x)),
  • imputeMin(multiplier)for imputing constant values shifted above the maximum usingmax(x) + multiplier * diff(range(x)),
  • imputeNormal(mean, sd)for imputation using normally distributed random values. Mean and standard deviation will be calculated from the data if not provided.
  • imputeHist(breaks, use.mids)for imputation using random values with probabilities calculated usingtableorhist.
  • imputeLearner(learner, preimpute)for imputations using the response of a classification or regression learner.
getFailureModelMsg

Return error message of FailureModel.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
makeFeatSelWrapper

Fuse learner with feature selection.
makeCostSensWeightedPairsWrapper

Wraps a classifier for cost-sensitive learning to produce a weighted pairs model.
getFilterValues

Calculates feature filter values.