Learn R Programming

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

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

9,216

Version

2.12.1

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

March 29th, 2018

Functions in mlr (2.12.1)

ConfusionMatrix

Confusion matrix
FeatSelControl

Create control structures for feature selection.
RLearner

Internal construction / wrapping of learner object.
Prediction

Prediction object.
LearnerProperties

Query properties of learners.
FailureModel

Failure model.
MeasureProperties

Query properties of measures.
Aggregation

Aggregation object.
BenchmarkResult

BenchmarkResult object.
FeatSelResult

Result of feature selection.
ResampleResult

ResampleResult object.
TaskDesc

Description object for task.
ResamplePrediction

Prediction from resampling.
TuneControl

Control object for tuning
addRRMeasure

Compute new measures for existing ResampleResult
aggregations

Aggregation methods.
TuneMultiCritResult

Result of multi-criteria tuning.
makeClassifTask

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

Result of tuning.
calculateROCMeasures

Calculate receiver operator measures.
calculateConfusionMatrix

Confusion matrix.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
TuneMultiCritControl

Create control structures for multi-criteria tuning.
bh.task

Boston Housing regression task.
capLargeValues

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

Run machine learning benchmarks as distributed experiments.
agri.task

European Union Agricultural Workforces clustering task.
analyzeFeatSelResult

Show and visualize the steps of feature selection.
changeData

Change Task Data
crossover

Crossover.
checkLearner

Exported for internal use only.
bc.task

Wisconsin Breast Cancer classification task.
configureMlr

Configures the behavior of the package.
extractFDAFPCA

Extract functional principal component analysis features.
costiris.task

Iris cost-sensitive classification task.
benchmark

Benchmark experiment for multiple learners and tasks.
extractFDAFeatures

Extract features from functional data.
createDummyFeatures

Generate dummy variables for factor features.
extractFDAWavelets

Discrete Wavelet transform features.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
convertMLBenchObjToTask

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

Filter features by thresholding filter values.
checkPredictLearnerOutput

Check output returned by predictLearner.
downsample

Downsample (subsample) a task or a data.frame.
classif.featureless

Featureless classification learner.
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
dropFeatures

Drop some features of task.
generateCritDifferencesData

Generate data for critical-differences plot.
generateCalibrationData

Generate classifier calibration data.
generateLearningCurveData

Generates a learning curve.
estimateRelativeOverfitting

Estimate relative overfitting.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
generatePartialDependenceData

Generate partial dependence.
estimateResidualVariance

Estimate the residual variance.
generateFilterValuesData

Calculates feature filter values.
fuelsubset.task

FuelSubset functional data regression task.
generateThreshVsPerfData

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

Fast Fourier transform features.
extractFDAMultiResFeatures

Multiresolution feature extraction.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
getBMRLearners

Return learners used in benchmark.
generateHyperParsEffectData

Generate hyperparameter effect data.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
generateFeatureImportanceData

Generate feature importance.
getBMRMeasureIds

Return measures IDs used in benchmark.
getBMRLearnerIds

Return learner ids used in benchmark.
getCaretParamSet

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

Return learner short.names used in benchmark.
getClassWeightParam

Get the class weight parameter of a learner.
getBMRTaskDescriptions

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

Return measures used in benchmark.
getBMRModels

Extract all models from benchmark result.
getBMRTaskDescs

Extract all task descriptions from benchmark result.
getLearnerParVals

Get the parameter values of the learner.
getLearnerParamSet

Get the parameter set of the learner.
getBMRTaskIds

Return task ids used in benchmark.
getFeatSelResult

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

Get the tuned hyperparameter settings from a nested tuning.
getBMRTuneResults

Extract the tuning results from a benchmark result.
getOOBPreds

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

Calculates feature importance values for trained models.
getFeatureImportanceLearner.regr.randomForestSRC

Calculates feature importance values for a given learner.
getRRTaskDesc

Get task description from resample results (DEPRECATED).
getFilterValues

Calculates feature filter values.
getRRTaskDescription

Get task description from resample results (DEPRECATED).
getPredictionResponse

Get response / truth from prediction object.
getConfMatrix

Confusion matrix.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
getPredictionTaskDesc

Get summarizing task description from prediction.
getNestedTuneResultsOptPathDf

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

Get default measure.
getLearnerModel

Get underlying R model of learner integrated into mlr.
getTaskCosts

Extract costs in task.
getLearnerPackages

Get the required R packages of the learner.
getTaskSize

Get number of observations in task.
getTaskData

Extract data in task.
getTaskTargetNames

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

Is the model a FailureModel?
getMultilabelBinaryPerformances

Retrieve binary classification measures for multilabel classification predictions.
joinClassLevels

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

Get the predict type of the learner.
learnerArgsToControl

Convert arguments to control structure.
getBMRPerformances

Extract the test performance values from a benchmark result.
learners

List of supported learning algorithms.
getTaskTargets

Get target data of task.
getLearnerShortName

Get the short name of the learner.
getFilteredFeatures

Returns the filtered features.
getTaskType

Get the type of the task.
helpLearnerParam

Get specific help for a learner's parameters.
getTaskId

Get the id of the task.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
imputations

Built-in imputation methods.
getTaskClassLevels

Get the class levels for classification and multilabel tasks.
getTaskNFeats

Get number of features in task.
getTaskFeatureNames

Get feature names of task.
listLearners

Find matching learning algorithms.
getPredictionDump

Return the error dump of a failed Prediction.
hasProperties

Deprecated, use hasLearnerProperties instead.
getBMRPredictions

Extract the predictions from a benchmark result.
listMeasureProperties

List the supported measure properties.
getPredictionProbabilities

Get probabilities for some classes.
getFailureModelDump

Return the error dump of FailureModel.
makeConstantClassWrapper

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

Access help page of learner functions.
getFailureModelMsg

Return error message of FailureModel.
lung.task

NCCTG Lung Cancer survival task.
makeBaseWrapper

Exported for internal use only.
getTaskFormula

Get formula of a task.
makeAggregation

Specify your own aggregation of measures.
makeFilterWrapper

Fuse learner with a feature filter method.
listFilterMethods

List filter methods.
getLearnerType

Get the type of the learner.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
makeBaggingWrapper

Fuse learner with the bagging technique.
getMlrOptions

Returns a list of mlr's options.
listLearnerProperties

List the supported learner properties
makeCostMeasure

Creates a measure for non-standard misclassification costs.
makeCostSensRegrWrapper

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

Fuse learner with simple downsampling (subsampling).
makeCostSensClassifWrapper

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

Fuse learner with dummy feature creator.
getOOBPredsLearner

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

Fuse learner with feature selection.
getHyperPars

Get current parameter settings for a learner.
makeFilter

Create a feature filter.
getProbabilities

Deprecated, use getPredictionProbabilities instead.
getLearnerId

Get the ID of the learner.
getRRPredictionList

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

Return the error dump of ResampleResult.
makeLearners

Create multiple learners at once.
getRRPredictions

Get predictions from resample results.
getTaskDesc

Get a summarizing task description.
impute

Impute and re-impute data
makeMeasure

Construct performance measure.
getParamSet

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

iris.task

Iris classification task.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
makeModelMultiplexer

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

Find matching measures.
getTuneResultOptPath

Get the optimization path of a tuning result.
listTaskTypes

List the supported task types in mlr
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
makeChainModel

Only exported for internal use.
makeOverBaggingWrapper

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

Use nested stacking method to create a multilabel learner.
makeFunctionalData

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

Classification via regression wrapper.
makeImputeMethod

Create a custom imputation method.
makeMultilabelStackingWrapper

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

Fuse learner with preprocessing.
makeMulticlassWrapper

Fuse learner with multiclass method.
makeMultilabelClassifierChainsWrapper

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

Gunpoint functional data classification task.
makeRemoveConstantFeaturesWrapper

Fuse learner with removal of constant features preprocessing.
makeTuneControlGrid

Create control object for hyperparameter tuning with grid search.
makeMultilabelDBRWrapper

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

Create control object for hyperparameter tuning with Irace.
makeResampleDesc

Create a description object for a resampling strategy.
hasFunctionalFeatures

Check whether the object conatins functional features.
makeMultilabelBinaryRelevanceWrapper

Use binary relevance method to create a multilabel learner.
makeExtractFDAFeatsWrapper

Fuse learner with an extractFDAFeatures method.
makeRLearner.classif.fdausc.kernel

Learner for kernel classification for functional data.
makeCostSensWeightedPairsWrapper

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

Exported for internal use.
makeImputeWrapper

Fuse learner with an imputation method.
makeRLearner.classif.fdausc.np

Learner for nonparametric classification for functional data.
makeTuneControlCMAES

Create control object for hyperparameter tuning with CMAES.
makeCustomResampledMeasure

Construct your own resampled performance measure.
makeLearner

Create learner object.
makeTuneControlDesign

Create control object for hyperparameter tuning with predefined design.
makeTuneControlGenSA

Create control object for hyperparameter tuning with GenSA.
makePreprocWrapperCaret

Fuse learner with preprocessing.
makeExtractFDAFeatMethod

Constructor for FDA feature extraction methods.
makeTuneWrapper

Fuse learner with tuning.
makeRLearner.classif.fdausc.glm

Classification of functional data by Generalized Linear Models.
mergeSmallFactorLevels

Merges small levels of factors into new level.
makeResampleInstance

Instantiates a resampling strategy object.
mlrFamilies

mlr documentation families
makeUndersampleWrapper

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

Create control object for hyperparameter tuning with MBO.
measures

Performance measures.
makeTuneControlRandom

Create control object for hyperparameter tuning with random search.
makeSMOTEWrapper

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

Induced model of learner.
mtcars.task

Motor Trend Car Road Tests clustering task.
mergeBenchmarkResults

Merge different BenchmarkResult objects.
makeStackedLearner

Create a stacked learner object.
performance

Measure performance of prediction.
plotBMRRanksAsBarChart

Create a bar chart for ranks in a BenchmarkResult.
normalizeFeatures

Normalize features.
phoneme.task

Phoneme functional data multilabel classification task.
makeClassifTaskDesc

Exported for internal use.
plotResiduals

Create residual plots for prediction objects or benchmark results.
plotBMRSummary

Plot a benchmark summary.
plotHyperParsEffect

Plot the hyperparameter effects data
makeWeightedClassesWrapper

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

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

Plot a partial dependence with ggplot2.
plotLearnerPrediction

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

PimaIndiansDiabetes classification task.
removeHyperPars

Remove hyperparameters settings of a learner.
plotROCCurves

Plots a ROC curve using ggplot2.
plotLearningCurve

Plot learning curve data using ggplot2.
plotBMRBoxplots

Create box or violin plots for a BenchmarkResult.
setPredictType

Set the type of predictions the learner should return.
resample

Fit models according to a resampling strategy.
setLearnerId

Set the ID of a learner object.
selectFeatures

Feature selection by wrapper approach.
predict.WrappedModel

Predict new data.
oversample

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

Only exported for internal use.
setMeasurePars

Set parameters of performance measures
regr.randomForest

RandomForest regression learner.
parallelization

Supported parallelization methods
setId

Set the id of a learner object.
simplifyMeasureNames

Simplify measure names.
reduceBatchmarkResults

Reduce results of a batch-distributed benchmark.
reextractFDAFeatures

Re-extract features from a data set
plotFilterValues

Plot filter values using ggplot2.
setPredictThreshold

Set the probability threshold the learner should use.
spatial.task

J. Muenchow's Ecuador landslide data set
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
regr.featureless

Featureless regression learner.
summarizeLevels

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

Train an R learner.
removeConstantFeatures

Remove constant features from a data set.
plotCalibration

Plot calibration data using ggplot2.
train

Train a learning algorithm.
tuneParams

Hyperparameter tuning.
spam.task

Spam classification task.
subsetTask

Subset data in task.
plotCritDifferences

Plot critical differences for a selected measure.
summarizeColumns

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

Yeast multilabel classification task.
setAggregation

Set aggregation function of measure.
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.
predictLearner

Predict new data with an R learner.
setHyperPars

Set the hyperparameters of a learner object.
tuneThreshold

Tune prediction threshold.
setThreshold

Set threshold of prediction object.
smote

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

Sonar classification task.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task.
reimpute

Re-impute a data set