Learn R Programming

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

mlr (version 2.7)

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.7

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

December 4th, 2015

Functions in mlr (2.7)

TaskDesc

Description object for task.
FailureModel

Failure model.
crossover

crossover
convertMLBenchObjToTask

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

Aggregation object.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
estimateResidualVariance

Estimate the residual variance
bh.task

Boston Housing regression task
PartialPredictionData

BenchmarkResult

BenchmarkResult object.
generateLearningCurveData

Generates a learning curve
getConfMatrix

Confusion matrix.
bc.task

Wisconsin Breast Cancer classification task
analyzeFeatSelResult

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

European Union Agricultural Workforces clustering task
generateCalibrationData

Generate classifier calibration data.
FeatSelResult

Result of feature selection.
estimateRelativeOverfitting

Estimate relative overfitting.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
dropFeatures

Drop some features of task.
getPredictionResponse

Get response / truth from prediction object.
FeatSelControl

Create control structures for feature selection.
benchmark

Benchmark experiment for multiple learners and tasks.
getTaskId

Get the id of the task.
getTaskType

Get the type of the task.
getClassWeightParam

Get the class weight parameter of a learner.
makeImputeMethod

Create a custom imputation method.
getTaskNFeats

Get number of features in task.
getFilteredFeatures

Returns the filtered features.
downsample

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

Return learners used in benchmark.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
getTaskFeatureNames

Get feature names of task.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
mtcars.task

Motor Trend Car Road Tests clustering task
makeUndersampleWrapper

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

Plot a partial prediction using ggvis
listMeasures

Find matching measures.
getTaskData

Extract data in task.
listFilterMethods

List filter methods
oversample

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

Returns the optimal hyperparameters and optimization path after training.
tuneThreshold

Tune prediction threshold.
lung.task

NCCTG Lung Cancer survival task
predictLearner

Predict new data with an R learner.
makeResampleDesc

Create a description object for a resampling strategy.
makeWeightedClassesWrapper

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

Iris cost-sensitive classification task
ResampleResult

ResampleResult object.
createDummyFeatures

Generate dummy variables for factor features.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
learnerArgsToControl

Convert arguments to control structure.
selectFeatures

Feature selection by wrapper approach.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
isFailureModel

Is the model a FailureModel?
TuneResult

Result of tuning.
getBMRLearnerIds

Return learner ids used in benchmark.
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
Prediction

Prediction object.
getCaretParamSet

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

Converts predictions to a format package ROCR can handle.
TuneMultiCritResult

Result of multi-criteria tuning.
learners

List of supported learning algorithms.
iris.task

Iris classification task
ResamplePrediction

Prediction from resampling.
trainLearner

Train an R learner.
generateFilterValuesData

Calculates feature filter values.
setAggregation

Set aggregation function of measure.
getDefaultMeasure

Get default measure.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
performance

Measure performance of prediction.
getTaskSize

Get number of observations in task.
getRRPredictions

Get predictions from resample results.
plotROCRCurves

Plots results from generateROCRCurvesData using ggplot2.
setPredictType

Set the type of predictions the learner should return.
generateThreshVsPerfData

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

Train a learning algorithm.
getFailureModelMsg

Return error message of FailureModel.
getHyperPars

Get current parameter settings for a learner.
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
getLearnerModel

Get underlying R model of learner integrated into mlr.
smote

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

Get a summarizing task description.
getParamSet

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

Return measures used in benchmark.
sonar.task

Sonar classification task
makeWrappedModel

Induced model of learner.
TuneControl

Create control structures for tuning.
plotLearnerPrediction

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

Deprecated, use getPredictionProbabilities instead.
generateROCRCurvesData

Generate binary classification predictions via ROCR ROC curves.
yeast.task

Yeast multilabel classification task
makeMultilabelBinaryRelevanceWrapper

Use binary relevance method to create a multilabel learner.
setHyperPars2

Only exported for internal use.
makeBaggingWrapper

Fuse learner with the bagging technique.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task
mergeSmallFactorLevels

Merges small levels of factors into new level.
plotBMRSummary

Plot a benchmark summary.
RLearner

Internal construction / wrapping of learner object.
getBMRPredictions

Extract the predictions from a benchmark result.
makeCostSensWeightedPairsWrapper

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

Extract costs in task.
getFeatSelResult

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

Returns a list of mlr's options
makeSMOTEWrapper

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

Retrieve binary classification measures for multilabel classification predictions.
makeOverBaggingWrapper

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

Create control structures for multi-criteria tuning.
plotFilterValuesGGVIS

Plot filter values using ggvis.
plotTuneMultiCritResultGGVIS

Plots multi-criteria results after tuning using ggvis.
getTaskTargetNames

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

Merge different learners of BenchmarkResult objects
setId

Set the id of a learner object.
setPredictThreshold

Set the probability threshold the learner should use.
summarizeColumns

Summarize columns of data.frame or task.
makeFilter

Create a feature filter
impute

Impute and re-impute data
getFilterValues

Calculates feature filter values.
getBMRTuneResults

Extract the tuning results from a benchmark result.
plotFilterValues

Plot filter values using ggplot2.
getNestedTuneResultsOptPathDf

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

Set, add, remove or query properties of learners
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
filterFeatures

Filter features by thresholding filter values.
getBMRMeasureIds

Return measures IDs used in benchmark.
getBMRTaskIds

Return task ids used in benchmark.
getBMRPerformances

Extract the test performance values from a benchmark result.
plotPartialPrediction

Plot a partial prediction with ggplot2
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.
plotViperCharts

Visualize binary classification predictions via ViperCharts system.
getTaskTargets

Get target data of task.
plotCalibration

Plot calibration data using ggplot2.
summarizeLevels

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

Fuse learner with feature selection.
hasProperties

Deprecated, use hasLearnerProperties instead.
plotROCRCurvesGGVIS

Plots results from generateROCRCurvesData using ggvis.
getTaskClassLevels

Get the class levels for classification and multilabel tasks.
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)),
  • imputeMax(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.
configureMlr

Configures the behavior of the package.
LearningCurveData

plotBMRBoxplots

Create a box- or violin plots for a BenchmarkResult
makeMulticlassWrapper

Fuse learner with multiclass method.
makePreprocWrapper

Fuse learner with preprocessing.
setHyperPars

Set the hyperparameters of a learner object.
plotBMRRanksAsBarChart

Create a bar-chart for ranks in a BenchmarkResult.
plotThreshVsPerfGGVIS

Plot threshold vs. performance(s) for 2-class classification using ggvis.
generatePartialPredictionData

Generate partial predictions
plotCritDifferences

Plot critical differences for a selected measure.
makeResampleInstance

Instantiates a resampling strategy object.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
plotLearningCurve

Plot learning curve data using ggplot2.
FilterValues

makeMeasure

Construct performance measure.
joinClassLevels

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

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

Merge different tasks of BenchmarkResult objects
makeCostSensRegrWrapper

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

Fuse learner with tuning.
getNestedTuneResultsX

Get the tuned hyperparameter settings from a nested tuning.
makePreprocWrapperCaret

Fuse learner with preprocessing
aggregations

Aggregation methods.
capLargeValues

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

Remove hyperparameters settings of a learner.
makeClassifTask

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

Subset data in task.
removeConstantFeatures

Remove constant features from a data set.
generateCritDifferencesData

Generate data for critical-differences plot.
makeAggregation

Specifiy your own aggregation of measures
getTaskFormula

Get formula of a task.
makeCustomResampledMeasure

Construct your own resampled performance measure.
makeCostSensClassifWrapper

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

Create a stacked learner object.
plotLearningCurveGGVIS

Plot learning curve data using ggvis.
resample

Fit models according to a resampling strategy.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
getPredictionProbabilities

Get probabilities for some classes.
plotROCCurves

Plots a ROC curve using ggplot2
setThreshold

Set threshold of prediction object.
makeFilterWrapper

Fuse learner with a feature filter method.
pid.task

PimaIndiansDiabetes classification task
makeLearner

Create learner object.
tuneParams

Hyperparameter tuning.
makeImputeWrapper

Fuse learner with an imputation method.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
measures

Performance measures.
listLearners

Find matching learning algorithms.
plotThreshVsPerf

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

Normalize features
predict.WrappedModel

Predict new data.
reimpute

Re-impute a data set