Learn R Programming

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

mlr (version 2.15.0)

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

9,043

Version

2.15.0

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 6th, 2019

Functions in mlr (2.15.0)

LearnerProperties

Query properties of learners.
Aggregation

Aggregation object.
ConfusionMatrix

Confusion matrix
FeatSelResult

Result of feature selection.
makeCostSensTask

Create a cost-sensitive classification task.
makeClassifTask

Create a classification task.
BenchmarkResult

BenchmarkResult object.
FailureModel

Failure model.
makeClusterTask

Create a cluster task.
RLearner

Internal construction / wrapping of learner object.
Prediction

Prediction object.
Task

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

Description object for task.
makeSurvTask

Create a survival task.
ResampleResult

ResampleResult object.
addRRMeasure

Compute new measures for existing ResampleResult
analyzeFeatSelResult

Show and visualize the steps of feature selection.
agri.task

European Union Agricultural Workforces clustering task.
makeRegrTask

Create a regression task.
ResamplePrediction

Prediction from resampling.
FeatSelControl

Create control structures for feature selection.
aggregations

Aggregation methods.
calculateConfusionMatrix

Confusion matrix.
MeasureProperties

Query properties of measures.
TuneMultiCritResult

Result of multi-criteria tuning.
makeMultilabelTask

Create a multilabel task.
bc.task

Wisconsin Breast Cancer classification task.
batchmark

Run machine learning benchmarks as distributed experiments.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
costiris.task

Iris cost-sensitive classification task.
benchmark

Benchmark experiment for multiple learners and tasks.
TuneResult

Result of tuning.
TuneMultiCritControl

Create control structures for multi-criteria tuning.
TuneControl

Control object for tuning
checkLearner

Exported for internal use only.
extractFDAWavelets

Discrete Wavelet transform features.
generateThreshVsPerfData

Generate threshold vs. performance(s) for 2-class classification.
classif.featureless

Featureless classification learner.
filterFeatures

Filter features by thresholding filter values.
checkPredictLearnerOutput

Check output returned by predictLearner.
configureMlr

Configures the behavior of the package.
bh.task

Boston Housing regression task.
createDummyFeatures

Generate dummy variables for factor features.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
createSpatialResamplingPlots

Create (spatial) resampling plot objects.
cache_helpers

Get or delete mlr cache directory
extractFDAFourier

Fast Fourier transform features.
crossover

Crossover.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
getBMRMeasures

Return measures used in benchmark.
generateFilterValuesData

Calculates feature filter values.
getBMRLearnerShortNames

Return learner short.names used in benchmark.
generateHyperParsEffectData

Generate hyperparameter effect data.
getBMRLearnerIds

Return learner ids used in benchmark.
extractFDAMultiResFeatures

Multiresolution feature extraction.
getBMRModels

Extract all models from benchmark result.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
getCaretParamSet

Get tuning parameters from a learner of the caret R-package.
getFailureModelMsg

Return error message of FailureModel.
getPredictionResponse

Get response / truth from prediction object.
getFailureModelDump

Return the error dump of FailureModel.
getPredictionTaskDesc

Get summarizing task description from prediction.
estimateRelativeOverfitting

Estimate relative overfitting.
calculateROCMeasures

Calculate receiver operator measures.
convertMLBenchObjToTask

Convert a machine learning benchmark / demo object from package mlbench to a task.
downsample

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

Estimate the residual variance.
getBMRTuneResults

Extract the tuning results from a benchmark result.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
getBMRTaskIds

Return task ids used in benchmark.
generateCritDifferencesData

Generate data for critical-differences plot.
getHyperPars

Get current parameter settings for a learner.
generateFeatureImportanceData

Generate feature importance.
fuelsubset.task

FuelSubset functional data regression task.
dropFeatures

Drop some features of task.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
generateCalibrationData

Generate classifier calibration data.
getBMRTaskDescs

Extract all task descriptions from benchmark result.
getBMRPerformances

Extract the test performance values from a benchmark result.
getBMRPredictions

Extract the predictions from a benchmark result.
getBMRTaskDescriptions

Extract all task descriptions from benchmark result (DEPRECATED).
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
helpLearnerParam

Get specific help for a learner's parameters.
helpLearner

Access help page of learner functions.
extractFDAFPCA

Extract functional principal component analysis features.
generateLearningCurveData

Generates a learning curve.
capLargeValues

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

Extract features from functional data.
changeData

Change Task Data
generatePartialDependenceData

Generate partial dependence.
getBMRLearners

Return learners used in benchmark.
makeFunctionalData

Create a data.frame containing functional features from a normal data.frame.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
getConfMatrix

Confusion matrix.
getBMRMeasureIds

Return measures IDs used in benchmark.
getLearnerParVals

Get the parameter values of the learner.
makePreprocWrapperCaret

Fuse learner with preprocessing.
makePreprocWrapper

Fuse learner with preprocessing.
makeTaskDescInternal

Exported for internal use.
makeClassifTaskDesc

Exported for internal use.
getRRDump

Return the error dump of ResampleResult.
getProbabilities

Deprecated, use getPredictionProbabilities instead.
getLearnerParamSet

Get the parameter set of the learner.
getResamplingIndices

Get the resampling indices from a tuning or feature selection wrapper..
getDefaultMeasure

Get default measure.
makeTuneControlIrace

Create control object for hyperparameter tuning with Irace.
getLearnerModel

Get underlying R model of learner integrated into mlr.
getNestedTuneResultsOptPathDf

Get the opt.paths from each tuning step from the outer resampling.
getMultilabelBinaryPerformances

Retrieve binary classification measures for multilabel classification predictions.
getPredictionDump

Return the error dump of a failed Prediction.
getLearnerId

Get the ID of the learner.
getLearnerNote

Get the note for the learner.
makeTuneControlMBO

Create control object for hyperparameter tuning with MBO.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
getTaskId

Get the id of the task.
listMeasures

Find matching measures.
getTaskFormula

Get formula of a task.
impute

Impute and re-impute data
imputations

Built-in imputation methods.
getPredictionProbabilities

Get probabilities for some classes.
mlr-package

mlr: Machine Learning in R
getFeatureImportanceLearner.regr.randomForestSRC

Calculates feature importance values for a given learner.
getTaskData

Extract data in task.
getFilteredFeatures

Returns the filtered features.
getLearnerType

Get the type of the learner.
getTaskDescription

getMlrOptions

Returns a list of mlr's options.
getTaskFeatureNames

Get feature names of task.
getLearnerPackages

Get the required R packages of the learner.
getTuneResultOptPath

Get the optimization path of a tuning result.
getNestedTuneResultsX

Get the tuned hyperparameter settings from a nested tuning.
getClassWeightParam

Get the class weight parameter of a learner.
getTaskDesc

Get a summarizing task description.
gunpoint.task

Gunpoint functional data classification task.
makeAggregation

Specify your own aggregation of measures.
makeBaseWrapper

Exported for internal use only.
lung.task

NCCTG Lung Cancer survival task.
makeBaggingWrapper

Fuse learner with the bagging technique.
getOOBPreds

Extracts out-of-bag predictions from trained models.
getRRPredictionList

Get list of predictions for train and test set of each single resample iteration.
getRRPredictions

Get predictions from resample results.
getTaskNFeats

Get number of features in task.
getTaskClassLevels

Get the class levels for classification and multilabel tasks.
getFeatSelResult

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

Get number of observations in task.
makeFilter

Create a feature filter.
makeMulticlassWrapper

Fuse learner with multiclass method.
makeRemoveConstantFeaturesWrapper

Fuse learner with removal of constant features preprocessing.
makeFeatSelWrapper

Fuse learner with feature selection.
makeSMOTEWrapper

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

Creates a parameter set for model multiplexer tuning.
makeRLearner.classif.fdausc.np

Learner for nonparametric classification for functional data.
getTaskCosts

Extract costs in task.
listTaskTypes

List the supported task types in mlr
mlrFamilies

mlr documentation families
predict.WrappedModel

Predict new data.
resample

Fit models according to a resampling strategy.
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task.
selectFeatures

Feature selection by wrapper approach.
yeast.task

Yeast multilabel classification task.
makeStackedLearner

Create a stacked learner object.
getFeatureImportance

Calculates feature importance values for trained models.
learnerArgsToControl

Convert arguments to control structure.
joinClassLevels

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

Get the name(s) of the target column(s).
getLearnerShortName

Get the short name of the learner.
getParamSet

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

Get task description from resample results (DEPRECATED).
getLearnerPredictType

Get the predict type of the learner.
getRRTaskDesc

Get task description from resample results (DEPRECATED).
getOOBPredsLearner

Provides out-of-bag predictions for a given model and the corresponding learner.
makeWrappedModel

Induced model of learner.
measures

Performance measures.
makeCostSensClassifWrapper

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

Check whether the object conatins functional features.
listLearners

Find matching learning algorithms.
hasProperties

Deprecated, use hasLearnerProperties instead.
getTaskTargets

Get target data of task.
getTaskType

Get the type of the task.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
plotLearnerPrediction

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

List the supported measure properties.
reextractFDAFeatures

Re-extract features from a data set
regr.featureless

Featureless regression learner.
iris.task

Iris classification task.
plotLearningCurve

Plot learning curve data using ggplot2.
isFailureModel

Is the model a FailureModel?
makeCostSensWeightedPairsWrapper

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

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

List the supported learner properties
listFilterMethods

List filter methods.
makeConstantClassWrapper

Wraps a classification learner to support problems where the class label is (almost) constant.
makeCustomResampledMeasure

Construct your own resampled performance measure.
makeImputeMethod

Create a custom imputation method.
removeConstantFeatures

Remove constant features from a data set.
removeHyperPars

Remove hyperparameters settings of a learner.
makeImputeWrapper

Fuse learner with an imputation method.
makeMultilabelNestedStackingWrapper

Use nested stacking method to create a multilabel learner.
makeResampleDesc

Create a description object for a resampling strategy.
makeMultilabelDBRWrapper

Use dependent binary relevance method (DBR) to create a multilabel learner.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
performance

Measure performance of prediction.
phoneme.task

Phoneme functional data multilabel classification task.
makeResampleInstance

Instantiates a resampling strategy object.
makeFilterEnsemble

Create an ensemble feature filter.
sonar.task

Sonar classification task.
smote

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

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

Fuse learner with simple downsampling (subsampling).
train

Train a learning algorithm.
makeExtractFDAFeatsWrapper

Fuse learner with an extractFDAFeatures method.
makeClassificationViaRegressionWrapper

Classification via regression wrapper.
makeExtractFDAFeatMethod

Constructor for FDA feature extraction methods.
makeChainModel

Only exported for internal use.
learners

List of supported learning algorithms.
listFilterEnsembleMethods

List ensemble filter methods.
plotCalibration

Plot calibration data using ggplot2.
makeDummyFeaturesWrapper

Fuse learner with dummy feature creator.
plotCritDifferences

Plot critical differences for a selected measure.
predictLearner

Predict new data with an R learner.
makeOverBaggingWrapper

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

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

Use stacking method (stacked generalization) to create a multilabel learner.
makeMeasure

Construct performance measure.
makeTuneControlCMAES

Create control object for hyperparameter tuning with CMAES.
makeLearner

Create learner object.
makeTuneControlGenSA

Create control object for hyperparameter tuning with GenSA.
makeMultilabelBinaryRelevanceWrapper

Use binary relevance method to create a multilabel learner.
makeTuneControlGrid

Create control object for hyperparameter tuning with grid search.
makeMultilabelClassifierChainsWrapper

Use classifier chains method (CC) to create a multilabel learner.
makeRLearner.classif.fdausc.glm

Classification of functional data by Generalized Linear Models.
makeFilterWrapper

Fuse learner with a feature filter method.
makeRLearner.classif.fdausc.kernel

Learner for kernel classification for functional data.
makeTuneControlDesign

Create control object for hyperparameter tuning with predefined design.
makeWeightedClassesWrapper

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

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

PimaIndiansDiabetes classification task.
mergeSmallFactorLevels

Merges small levels of factors into new level.
normalizeFeatures

Normalize features.
mergeBenchmarkResults

Merge different BenchmarkResult objects.
mtcars.task

Motor Trend Car Road Tests clustering task.
plotBMRBoxplots

Create box or violin plots for a BenchmarkResult.
setThreshold

Set threshold of prediction object.
setAggregation

Set aggregation function of measure.
setHyperPars

Set the hyperparameters of a learner object.
simplifyMeasureNames

Simplify measure names.
reduceBatchmarkResults

Reduce results of a batch-distributed benchmark.
plotROCCurves

Plots a ROC curve using ggplot2.
plotPartialDependence

Plot a partial dependence with ggplot2.
regr.randomForest

RandomForest regression learner.
reimpute

Re-impute a data set
makeLearners

Create multiple learners at once.
plotBMRSummary

Plot a benchmark summary.
plotBMRRanksAsBarChart

Create a bar chart for ranks in a BenchmarkResult.
setHyperPars2

Only exported for internal use.
setMeasurePars

Set parameters of performance measures
subsetTask

Subset data in task.
setLearnerId

Set the ID of a learner object.
setId

Set the id of a learner object.
summarizeColumns

Summarize columns of data.frame or task.
spam.task

Spam classification task.
spatial.task

J. Muenchow's Ecuador landslide data set
parallelization

Supported parallelization methods
makeTuneWrapper

Fuse learner with tuning.
makeTuneControlRandom

Create control object for hyperparameter tuning with random search.
plotFilterValues

Plot filter values using ggplot2.
oversample

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

Hyperparameter tuning for multiple measures at once.
plotHyperParsEffect

Plot the hyperparameter effects data
plotResiduals

Create residual plots for prediction objects or benchmark results.
tuneThreshold

Tune prediction threshold.
plotThreshVsPerf

Plot threshold vs. performance(s) for 2-class classification using ggplot2.
setPredictType

Set the type of predictions the learner should return.
tuneParams

Hyperparameter tuning.
trainLearner

Train an R learner.
setPredictThreshold

Set the probability threshold the learner should use.