Learn R Programming

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

mlr (version 2.17.1)

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

8,343

Version

2.17.1

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Patrick Schratz

Last Published

March 24th, 2020

Functions in mlr (2.17.1)

LearnerProperties

Query properties of learners.
FeatSelControl

Create control structures for feature selection.
FeatSelResult

Result of feature selection.
Aggregation

Aggregation object.
makeClassifTask

Create a classification task.
ConfusionMatrix

Confusion matrix
FailureModel

Failure model.
makeCostSensTask

Create a cost-sensitive classification task.
BenchmarkResult

BenchmarkResult object.
makeClusterTask

Create a cluster task.
TaskDesc

Description object for task.
ResampleResult

ResampleResult object.
Task

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

Prediction object.
MeasureProperties

Query properties of measures.
TuneControl

Control object for tuning
makeMultilabelTask

Create a multilabel task.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
makeRegrTask

Create a regression task.
batchmark

Run machine learning benchmarks as distributed experiments.
calculateConfusionMatrix

Confusion matrix.
ResamplePrediction

Prediction from resampling.
agri.task

European Union Agricultural Workforces clustering task.
analyzeFeatSelResult

Show and visualize the steps of feature selection.
RLearner

Internal construction / wrapping of learner object.
addRRMeasure

Compute new measures for existing ResampleResult
benchmark

Benchmark experiment for multiple learners and tasks.
calculateROCMeasures

Calculate receiver operator measures.
TuneMultiCritControl

Create control structures for multi-criteria tuning.
createDummyFeatures

Generate dummy variables for factor features.
bc.task

Wisconsin Breast Cancer classification task.
crossover

Crossover.
convertMLBenchObjToTask

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

Aggregation methods.
cache_helpers

Get or delete mlr cache directory
downsample

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

Create a survival task.
bh.task

Boston Housing regression task.
TuneResult

Result of tuning.
capLargeValues

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

Result of multi-criteria tuning.
costiris.task

Iris cost-sensitive classification task.
createSpatialResamplingPlots

Create (spatial) resampling plot objects.
extractFDADTWKernel

DTW kernel features
dropFeatures

Drop some features of task.
estimateRelativeOverfitting

Estimate relative overfitting.
extractFDAFeatures

Extract features from functional data.
checkLearner

Exported for internal use only.
extractFDAFourier

Fast Fourier transform features.
extractFDAWavelets

Discrete Wavelet transform features.
changeData

Change Task Data
generateFilterValuesData

Calculates feature filter values.
filterFeatures

Filter features by thresholding filter values.
generateCalibrationData

Generate classifier calibration data.
extractFDAMultiResFeatures

Multiresolution feature extraction.
checkPredictLearnerOutput

Check output returned by predictLearner.
generateLearningCurveData

Generates a learning curve.
extractFDATsfeatures

Time-Series Feature Heuristics
fuelsubset.task

FuelSubset functional data regression task.
extractFDAFPCA

Extract functional principal component analysis features.
generatePartialDependenceData

Generate partial dependence.
getBMRPredictions

Extract the predictions from a benchmark result.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
generateHyperParsEffectData

Generate hyperparameter effect data.
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
generateThreshVsPerfData

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

Configures the behavior of the package.
getBMRLearners

Return learners used in benchmark.
getBMRMeasureIds

Return measures IDs used in benchmark.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
getCaretParamSet

Get tuning parameters from a learner of the caret R-package.
getFeatureImportanceLearner.regr.randomForestSRC

Calculates feature importance values for a given learner.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
getParamSet

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

Extract the test performance values from a benchmark result.
getBMRModels

Extract all models from benchmark result.
getTaskTargetNames

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

Extract all task descriptions from benchmark result.
getLearnerParamSet

Get the parameter set of the learner.
getFilteredFeatures

Returns the filtered features.
getBMRMeasures

Return measures used in benchmark.
getBMRTaskDescriptions

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

Extract the tuning results from a benchmark result.
getBMRTaskIds

Return task ids used in benchmark.
getClassWeightParam

Get the class weight parameter of a learner.
getOOBPreds

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

Get the predict type of the learner.
joinClassLevels

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

Return the error dump of a failed Prediction.
getFunctionalFeatures

Get only functional features from a task or a data.frame.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
getLearnerModel

Get underlying R model of learner integrated into mlr.
getFailureModelMsg

Return error message of FailureModel.
getFailureModelDump

Return the error dump of FailureModel.
getMlrOptions

Returns a list of mlr's options.
getMultilabelBinaryPerformances

Retrieve binary classification measures for multilabel classification predictions.
getProbabilities

Deprecated, use getPredictionProbabilities instead.
getPredictionTaskDesc

Get summarizing task description from prediction.
getFeatureImportance

Calculates feature importance values for trained models.
getFeatSelResult

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

Get the note for the learner.
getNestedTuneResultsOptPathDf

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

Extract costs in task.
getNestedTuneResultsX

Get the tuned hyperparameter settings from a nested tuning.
getTaskData

Extract data in task.
getTaskClassLevels

Get the class levels for classification and multilabel tasks.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
extractFDABsignal

Bspline mlq features
getPredictionResponse

Get response / truth from prediction object.
getPredictionProbabilities

Get probabilities for some classes.
getLearnerShortName

Get the short name of the learner.
getLearnerType

Get the type of the learner.
getTaskTargets

Get target data of task.
getTaskNFeats

Get number of features in task.
estimateResidualVariance

Estimate the residual variance.
getTaskId

Get the id of the task.
generateCritDifferencesData

Generate data for critical-differences plot.
getRRDump

Return the error dump of ResampleResult.
getTaskType

Get the type of the task.
gunpoint.task

Gunpoint functional data classification task.
getRRPredictions

Get predictions from resample results.
generateFeatureImportanceData

Generate feature importance.
helpLearnerParam

Get specific help for a learner's parameters.
getRRPredictionList

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

Built-in imputation methods.
hasFunctionalFeatures

Check whether the object contains functional features.
listLearnerProperties

List the supported learner properties
listMeasureProperties

List the supported measure properties.
hasProperties

Deprecated, use hasLearnerProperties instead.
getTaskSize

Get number of observations in task.
listMeasures

Find matching measures.
listTaskTypes

List the supported task types in mlr
getRRTaskDesc

Get task description from resample results (DEPRECATED).
listLearners

Find matching learning algorithms.
lung.task

NCCTG Lung Cancer survival task.
getBMRLearnerIds

Return learner ids used in benchmark.
getBMRLearnerShortNames

Return learner short.names used in benchmark.
getDefaultMeasure

Get default measure.
makeAggregation

Specify your own aggregation of measures.
makeBaseWrapper

Exported for internal use only.
getConfMatrix

Confusion matrix.
makeChainModel

Only exported for internal use.
makeCustomResampledMeasure

Construct your own resampled performance measure.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
helpLearner

Access help page of learner functions.
isFailureModel

Is the model a FailureModel?
getLearnerPackages

Get the required R packages of the learner.
makeFilterEnsemble

Create an ensemble feature filter.
makeFunctionalData

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

Get current parameter settings for a learner.
getRRTaskDescription

Get task description from resample results (DEPRECATED).
getLearnerParVals

Get the parameter values of the learner.
getLearnerId

Get the ID of the learner.
makeCostSensRegrWrapper

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

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

Create a custom imputation method.
getTaskDesc

Get a summarizing task description.
impute

Impute and re-impute data
getResamplingIndices

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

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

Create a feature filter.
makeMulticlassWrapper

Fuse learner with multiclass method.
makeModelMultiplexer

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

Creates a parameter set for model multiplexer tuning.
makeBaggingWrapper

Fuse learner with the bagging technique.
makeMultilabelBinaryRelevanceWrapper

Use binary relevance method to create a multilabel learner.
makeLearners

Create multiple learners at once.
getTaskDescription

getTuneResultOptPath

Get the optimization path of a tuning result.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
makeMeasure

Construct performance measure.
makePreprocWrapperCaret

Fuse learner with preprocessing.
makeMultilabelNestedStackingWrapper

Use nested stacking method to create a multilabel learner.
listFilterEnsembleMethods

List ensemble filter methods.
makeMultilabelStackingWrapper

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

List filter methods.
makeClassificationViaRegressionWrapper

Classification via regression wrapper.
makeConstantClassWrapper

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

Fuse learner with an imputation method.
makeExtractFDAFeatsWrapper

Fuse learner with an extractFDAFeatures method.
getTaskFeatureNames

Get feature names of task.
makeFeatSelWrapper

Fuse learner with feature selection.
makeRLearner.classif.fdausc.kernel

Learner for kernel classification for functional data.
iris.task

Iris classification task.
learnerArgsToControl

Convert arguments to control structure.
getTaskFormula

Get formula of a task.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
makeTaskDescInternal

Exported for internal use.
predictLearner

Predict new data with an R learner.
makeTuneControlCMAES

Create control object for hyperparameter tuning with CMAES.
makeRLearner.classif.fdausc.glm

Classification of functional data by Generalized Linear Models.
learners

List of supported learning algorithms.
makeCostSensClassifWrapper

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

Predict new data.
makeFilterWrapper

Fuse learner with a feature filter method.
plotPartialDependence

Plot a partial dependence with ggplot2.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
makeExtractFDAFeatMethod

Constructor for FDA feature extraction methods.
makeDummyFeaturesWrapper

Fuse learner with dummy feature creator.
makeRLearner.classif.fdausc.np

Learner for nonparametric classification for functional data.
makeLearner

Create learner object.
makePreprocWrapper

Fuse learner with preprocessing.
makeTuneWrapper

Fuse learner with tuning.
makeOverBaggingWrapper

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

Use classifier chains method (CC) to create a multilabel learner.
makeMultilabelDBRWrapper

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

Create control object for hyperparameter tuning with random search.
makeTuneControlGenSA

Create control object for hyperparameter tuning with GenSA.
makeRemoveConstantFeaturesWrapper

Fuse learner with removal of constant features preprocessing.
makeTuneControlGrid

Create control object for hyperparameter tuning with grid search.
makeTuneControlIrace

Create control object for hyperparameter tuning with Irace.
makeSMOTEWrapper

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

Create control object for hyperparameter tuning with MBO.
performance

Measure performance of prediction.
parallelization

Supported parallelization methods
makeStackedLearner

Create a stacked learner object.
makeResampleInstance

Instantiates a resampling strategy object.
mergeBenchmarkResults

Merge different BenchmarkResult objects.
measures

Performance measures.
makeWeightedClassesWrapper

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

Create a description object for a resampling strategy.
makeClassifTaskDesc

Exported for internal use.
makeWrappedModel

Induced model of learner.
makeUndersampleWrapper

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

Re-impute a data set
mergeSmallFactorLevels

Merges small levels of factors into new level.
plotBMRSummary

Plot a benchmark summary.
summarizeLevels

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

Summarize columns of data.frame or task.
setAggregation

Set aggregation function of measure.
plotCalibration

Plot calibration data using ggplot2.
selectFeatures

Feature selection by wrapper approach.
setPredictType

Set the type of predictions the learner should return.
setThreshold

Set threshold of prediction object.
train

Train a learning algorithm.
removeConstantFeatures

Remove constant features from a data set.
phoneme.task

Phoneme functional data multilabel classification task.
mlrFamilies

mlr documentation families
setMeasurePars

Set parameters of performance measures
mlr-package

mlr: Machine Learning in R
resample

Fit models according to a resampling strategy.
tuneThreshold

Tune prediction threshold.
plotCritDifferences

Plot critical differences for a selected measure.
plotROCCurves

Plots a ROC curve using ggplot2.
plotFilterValues

Plot filter values using ggplot2.
setPredictThreshold

Set the probability threshold the learner should use.
setId

Set the id of a learner object.
pid.task

PimaIndiansDiabetes classification task.
plotResiduals

Create residual plots for prediction objects or benchmark results.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task.
mtcars.task

Motor Trend Car Road Tests clustering task.
plotLearningCurve

Plot learning curve data using ggplot2.
makeTuneControlDesign

Create control object for hyperparameter tuning with predefined design.
plotHyperParsEffect

Plot the hyperparameter effects data
setLearnerId

Set the ID of a learner object.
normalizeFeatures

Normalize features.
oversample

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

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

Simplify measure names.
setHyperPars

Set the hyperparameters of a learner object.
plotBMRBoxplots

Create box or violin plots for a BenchmarkResult.
yeast.task

Yeast multilabel classification task.
plotBMRRanksAsBarChart

Create a bar chart for ranks in a BenchmarkResult.
plotLearnerPrediction

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

Hyperparameter tuning for multiple measures at once.
plotThreshVsPerf

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

J. Muenchow's Ecuador landslide data set
reextractFDAFeatures

Re-extract features from a data set
reduceBatchmarkResults

Reduce results of a batch-distributed benchmark.
sonar.task

Sonar classification task.
setHyperPars2

Only exported for internal use.
removeHyperPars

Remove hyperparameters settings of a learner.
plotTuneMultiCritResult

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

Spam classification task.
tuneParams

Hyperparameter tuning.
subsetTask

Subset data in task.
trainLearner

Train an R learner.