Learn R Programming

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

mlr (version 2.14.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

8,314

Version

2.14.0

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Patrick Schratz

Last Published

April 25th, 2019

Functions in mlr (2.14.0)

makeClassifTask

Create a classification task.
FailureModel

Failure model.
TuneControl

Control object for tuning
TuneMultiCritControl

Create control structures for multi-criteria tuning.
makeRegrTask

Create a regression task.
capLargeValues

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

Aggregation object.
ResamplePrediction

Prediction from resampling.
FeatSelResult

Result of feature selection.
FeatSelControl

Create control structures for feature selection.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
BenchmarkResult

BenchmarkResult object.
ConfusionMatrix

Confusion matrix
batchmark

Run machine learning benchmarks as distributed experiments.
checkLearner

Exported for internal use only.
LearnerProperties

Query properties of learners.
bc.task

Wisconsin Breast Cancer classification task.
benchmark

Benchmark experiment for multiple learners and tasks.
classif.featureless

Featureless classification learner.
configureMlr

Configures the behavior of the package.
checkPredictLearnerOutput

Check output returned by predictLearner.
makeSurvTask

Create a survival task.
changeData

Change Task Data
ResampleResult

ResampleResult object.
makeCostSensTask

Create a cost-sensitive classification task.
downsample

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

Prediction object.
TuneMultiCritResult

Result of multi-criteria tuning.
RLearner

Internal construction / wrapping of learner object.
dropFeatures

Drop some features of task.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
createDummyFeatures

Generate dummy variables for factor features.
extractFDAFeatures

Extract features from functional data.
extractFDAFPCA

Extract functional principal component analysis features.
costiris.task

Iris cost-sensitive classification task.
TuneResult

Result of tuning.
agri.task

European Union Agricultural Workforces clustering task.
analyzeFeatSelResult

Show and visualize the steps of feature selection.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
convertMLBenchObjToTask

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

Generates a learning curve.
MeasureProperties

Query properties of measures.
generateThreshVsPerfData

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

Return learner short.names used in benchmark.
getBMRLearnerIds

Return learner ids used in benchmark.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
makeMultilabelTask

Create a multilabel task.
addRRMeasure

Compute new measures for existing ResampleResult
calculateConfusionMatrix

Confusion matrix.
generatePartialDependenceData

Generate partial dependence.
getBMRLearners

Return learners used in benchmark.
extractFDAWavelets

Discrete Wavelet transform features.
filterFeatures

Filter features by thresholding filter values.
getBMRPerformances

Extract the test performance values from a benchmark result.
generateFilterValuesData

Calculates feature filter values.
generateHyperParsEffectData

Generate hyperparameter effect data.
calculateROCMeasures

Calculate receiver operator measures.
getBMRTaskDescriptions

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

Aggregation methods.
getBMRMeasureIds

Return measures IDs used in benchmark.
getBMRPredictions

Extract the predictions from a benchmark result.
bh.task

Boston Housing regression task.
createSpatialResamplingPlots

Create (spatial) resampling plot objects.
extractFDAFourier

Fast Fourier transform features.
cache_helpers

Get or delete mlr cache directory
getFailureModelDump

Return the error dump of FailureModel.
extractFDAMultiResFeatures

Multiresolution feature extraction.
getFailureModelMsg

Return error message of FailureModel.
crossover

Crossover.
getBMRTaskIds

Return task ids used in benchmark.
getBMRTaskDescs

Extract all task descriptions from benchmark result.
getFeatureImportanceLearner.regr.randomForestSRC

Calculates feature importance values for a given learner.
estimateRelativeOverfitting

Estimate relative overfitting.
estimateResidualVariance

Estimate the residual variance.
generateCritDifferencesData

Generate data for critical-differences plot.
getLearnerId

Get the ID of the learner.
getFilteredFeatures

Returns the filtered features.
fuelsubset.task

FuelSubset functional data regression task.
getLearnerModel

Get underlying R model of learner integrated into mlr.
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
getParamSet

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

Returns a list of mlr's options.
generateFeatureImportanceData

Generate feature importance.
getBMRTuneResults

Extract the tuning results from a benchmark result.
generateCalibrationData

Generate classifier calibration data.
getLearnerPackages

Get the required R packages of the learner.
getBMRMeasures

Return measures used in benchmark.
getBMRModels

Extract all models from benchmark result.
getLearnerParVals

Get the parameter values of the learner.
getPredictionDump

Return the error dump of a failed Prediction.
getFeatSelResult

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

Convert arguments to control structure.
getNestedTuneResultsOptPathDf

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

Get the tuned hyperparameter settings from a nested tuning.
getConfMatrix

Confusion matrix.
getOOBPreds

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

Calculates feature importance values for trained models.
getOOBPredsLearner

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

Get default measure.
getRRPredictions

Get predictions from resample results.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
getRRTaskDesc

Get task description from resample results (DEPRECATED).
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
learners

List of supported learning algorithms.
getHyperPars

Get current parameter settings for a learner.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
getCaretParamSet

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

Return the error dump of ResampleResult.
getRRPredictionList

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

Get the class levels for classification and multilabel tasks.
getLearnerShortName

Get the short name of the learner.
makeBaggingWrapper

Fuse learner with the bagging technique.
gunpoint.task

Gunpoint functional data classification task.
getTaskDesc

Get a summarizing task description.
getMultilabelBinaryPerformances

Retrieve binary classification measures for multilabel classification predictions.
getClassWeightParam

Get the class weight parameter of a learner.
makeBaseWrapper

Exported for internal use only.
getPredictionTaskDesc

Get summarizing task description from prediction.
getProbabilities

Deprecated, use getPredictionProbabilities instead.
getLearnerParamSet

Get the parameter set of the learner.
getTaskFeatureNames

Get feature names of task.
getTaskDescription

hasFunctionalFeatures

Check whether the object conatins functional features.
getTaskFormula

Get formula of a task.
getLearnerType

Get the type of the learner.
getTaskTargets

Get target data of task.
getLearnerPredictType

Get the predict type of the learner.
getTaskCosts

Extract costs in task.
isFailureModel

Is the model a FailureModel?
makeFilterWrapper

Fuse learner with a feature filter method.
getTaskId

Get the id of the task.
joinClassLevels

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

Extract data in task.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
getPredictionProbabilities

Get probabilities for some classes.
listLearners

Find matching learning algorithms.
getTuneResultOptPath

Get the optimization path of a tuning result.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
listMeasureProperties

List the supported measure properties.
getTaskNFeats

Get number of features in task.
makeConstantClassWrapper

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

Deprecated, use hasLearnerProperties instead.
getTaskType

Get the type of the task.
helpLearner

Access help page of learner functions.
getPredictionResponse

Get response / truth from prediction object.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
listMeasures

Find matching measures.
listTaskTypes

List the supported task types in mlr
makeLearners

Create multiple learners at once.
makeCostSensClassifWrapper

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

Fuse learner with an imputation method.
makeLearner

Create learner object.
makeCostSensRegrWrapper

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

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

Impute and re-impute data
getRRTaskDescription

Get task description from resample results (DEPRECATED).
getResamplingIndices

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

Construct performance measure.
makeOverBaggingWrapper

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

Fuse learner with preprocessing.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
makeExtractFDAFeatMethod

Constructor for FDA feature extraction methods.
makeExtractFDAFeatsWrapper

Fuse learner with an extractFDAFeatures method.
makeMulticlassWrapper

Fuse learner with multiclass method.
makeMultilabelBinaryRelevanceWrapper

Use binary relevance method to create a multilabel learner.
makeTuneControlGrid

Create control object for hyperparameter tuning with grid search.
iris.task

Iris classification task.
makeTuneControlIrace

Create control object for hyperparameter tuning with Irace.
lung.task

NCCTG Lung Cancer survival task.
makeMultilabelDBRWrapper

Use dependent binary relevance method (DBR) to create a multilabel learner.
makeRLearner.classif.fdausc.kernel

Learner for kernel classification for functional data.
makeAggregation

Specify your own aggregation of measures.
makeCostSensWeightedPairsWrapper

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

Get number of observations in task.
makeWeightedClassesWrapper

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

Fuse learner with dummy feature creator.
makePreprocWrapperCaret

Fuse learner with preprocessing.
makeRLearner.classif.fdausc.np

Learner for nonparametric classification for functional data.
makeRLearner.classif.fdausc.glm

Classification of functional data by Generalized Linear Models.
makeWrappedModel

Induced model of learner.
makeRemoveConstantFeaturesWrapper

Fuse learner with removal of constant features preprocessing.
makeResampleDesc

Create a description object for a resampling strategy.
plotBMRBoxplots

Create box or violin plots for a BenchmarkResult.
makeTaskDescInternal

Exported for internal use.
getTaskTargetNames

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

Construct your own resampled performance measure.
makeTuneControlDesign

Create control object for hyperparameter tuning with predefined design.
makeTuneControlCMAES

Create control object for hyperparameter tuning with CMAES.
plotBMRRanksAsBarChart

Create a bar chart for ranks in a BenchmarkResult.
helpLearnerParam

Get specific help for a learner's parameters.
measures

Performance measures.
setHyperPars

Set the hyperparameters of a learner object.
makeFeatSelWrapper

Fuse learner with feature selection.
makeFilter

Create a feature filter.
imputations

Built-in imputation methods.
listFilterMethods

List filter methods.
mergeBenchmarkResults

Merge different BenchmarkResult objects.
listLearnerProperties

List the supported learner properties
makeChainModel

Only exported for internal use.
parallelization

Supported parallelization methods
setHyperPars2

Only exported for internal use.
makeClassificationViaRegressionWrapper

Classification via regression wrapper.
makeMultilabelNestedStackingWrapper

Use nested stacking method to create a multilabel learner.
performance

Measure performance of prediction.
summarizeColumns

Summarize columns of data.frame or task.
summarizeLevels

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

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

Create a stacked learner object.
makeClassifTaskDesc

Exported for internal use.
plotCritDifferences

Plot critical differences for a selected measure.
makeMultilabelStackingWrapper

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

Plot filter values using ggplot2.
removeHyperPars

Remove hyperparameters settings of a learner.
mergeSmallFactorLevels

Merges small levels of factors into new level.
makeImputeMethod

Create a custom imputation method.
resample

Fit models according to a resampling strategy.
mlrFamilies

mlr documentation families
mlr-package

mlr: Machine Learning in R
plotBMRSummary

Plot a benchmark summary.
plotCalibration

Plot calibration data using ggplot2.
mtcars.task

Motor Trend Car Road Tests clustering task.
plotThreshVsPerf

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

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

Plot learning curve data using ggplot2.
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
simplifyMeasureNames

Simplify measure names.
regr.featureless

Featureless regression learner.
plotPartialDependence

Plot a partial dependence with ggplot2.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
makeResampleInstance

Instantiates a resampling strategy object.
regr.randomForest

RandomForest regression learner.
makeSMOTEWrapper

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

Create control object for hyperparameter tuning with MBO.
makeTuneControlGenSA

Create control object for hyperparameter tuning with GenSA.
makeTuneControlRandom

Create control object for hyperparameter tuning with random search.
smote

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

Set the type of predictions the learner should return.
predict.WrappedModel

Predict new data.
makeTuneWrapper

Fuse learner with tuning.
setThreshold

Set threshold of prediction object.
makeUndersampleWrapper

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

Predict new data with an R learner.
normalizeFeatures

Normalize features.
tuneParams

Hyperparameter tuning.
phoneme.task

Phoneme functional data multilabel classification task.
oversample

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

Plots a ROC curve using ggplot2.
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.
setLearnerId

Set the ID of a learner object.
setId

Set the id of a learner object.
pid.task

PimaIndiansDiabetes classification task.
spatial.task

J. Muenchow's Ecuador landslide data set
plotHyperParsEffect

Plot the hyperparameter effects data
plotResiduals

Create residual plots for prediction objects or benchmark results.
reimpute

Re-impute a data set
removeConstantFeatures

Remove constant features from a data set.
subsetTask

Subset data in task.
yeast.task

Yeast multilabel classification task.
selectFeatures

Feature selection by wrapper approach.
plotLearnerPrediction

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

Re-extract features from a data set
reduceBatchmarkResults

Reduce results of a batch-distributed benchmark.
setMeasurePars

Set parameters of performance measures
setPredictThreshold

Set the probability threshold the learner should use.
setAggregation

Set aggregation function of measure.
sonar.task

Sonar classification task.
train

Train a learning algorithm.
spam.task

Spam classification task.
trainLearner

Train an R learner.
tuneThreshold

Tune prediction threshold.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task.
makeClusterTask

Create a cluster task.
Task

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

Description object for task.