Learn R Programming

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

mlr (version 2.5)

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,445

Version

2.5

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

November 20th, 2015

Functions in mlr (2.5)

LearnerProperties

Set, add, remove or query properties of learners
TuneMultiCritResult

Result of multi-criteria tuning.
LearningCurveData

Aggregation

Aggregation object.
FailureModel

Failure model.
createDummyFeatures

Generate dummy variables for factor features.
agri.task

European Union Agricultural Workforces clustering task
capLargeValues

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

crossover
RLearner

Internal construction / wrapping of learner object.
bh.task

Boston Housing regression task
BenchmarkResult

BenchmarkResult object.
aggregations

Aggregation methods.
getLearnerModel

Get underlying R model of learner integrated into mlr.
TuneResult

Result of tuning.
analyzeFeatSelResult

Show and visualize the steps of feature selection.
makeAggregation

Specifiy your own aggregation of measures
costiris.task

Iris cost-sensitive classification task
TaskDesc

Description object for task.
getFailureModelMsg

Return error message of FailureModel.
configureMlr

Configures the behavior of the package.
getPredictionProbabilities

Get probabilities for some classes.
makeMeasure

Construct performance measure.
getTaskData

Extract data in task.
makeLearner

Create learner object.
makeSMOTEWrapper

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

Get a summarizing task description.
isFailureModel

Is the model a FailureModel?
generateLearningCurveData

Generates a learning curve
getTaskTargetNames

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

Get predictions from resample results.
getTaskId

Get the id of the task.
getCaretParamSet

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

Create a description object for a resampling strategy.
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
makeClassifTask

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

Performance measures.
getTaskNFeats

Get number of features in task.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
getParamSet

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

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

Wisconsin Breast Cancer classification task
FilterValues

makeMultilabelBinaryRelevanceWrapper

Use binary relevance method to create a multilabel learner.
plotPartialPredictionGGVIS

Plot a partial prediction using ggvis
mergeBenchmarkResultLearner

Merge different learners of BenchmarkResult objects
makeFilterWrapper

Fuse learner with a feature filter method.
benchmark

Benchmark experiment for multiple learners and tasks.
makeMulticlassWrapper

Fuse learner with multiclass method.
listMeasures

Find matching measures.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
getHyperPars

Get current parameter settings for a learner.
ResampleResult

ResampleResult object.
generateROCRCurvesData

Generate binary classification predictions via ROCR ROC curves.
dropFeatures

Drop some features of task.
estimateRelativeOverfitting

Estimate relative overfitting.
getPredictionResponse

Get response / truth from prediction object.
makeOverBaggingWrapper

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

Return learners used in benchmark.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
estimateResidualVariance

Estimate the residual variance
learnerArgsToControl

Convert arguments to control structure.
getBMRTaskIds

Return task ids used in benchmark.
getBMRLearnerIds

Return learner ids used in benchmark.
plotLearningCurveGGVIS

Plot learning curve data using ggvis.
downsample

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

Get the tuned hyperparameter settings from a nested tuning.
getFilteredFeatures

Returns the filtered features.
TuneControl

Create control structures for tuning.
getBMRTuneResults

Extract the tuning results from a benchmark result.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
getTaskFormula

Get formula of a task.
getTaskSize

Get number of observations in task.
makeImputeWrapper

Fuse learner with an imputation method.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
filterFeatures

Filter features by thresholding filter values.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
Prediction

Prediction object.
predict.WrappedModel

Predict new data.
iris.task

Iris classification task
getTaskCosts

Extract costs in task.
mergeBenchmarkResultTask

Merge different tasks of BenchmarkResult objects
plotPartialPrediction

Plot a partial prediction with ggplot2
FeatSelResult

Result of feature selection.
generateCritDifferencesData

Generate data for critical-differences plot.
getConfMatrix

Confusion matrix.
reimpute

Re-impute a data set
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
plotFilterValues

Plot filter values using ggplot2.
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.
makePreprocWrapper

Fuse learner with preprocessing.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
makeTuneWrapper

Fuse learner with tuning.
plotBenchmarkResult

Create a Trellis-plot for a selected measure.
getBMRMeasures

Return measures used in benchmark.
listFilterMethods

List filter methods
getDefaultMeasure

Get default measure.
impute

Impute and re-impute data
getMultilabelBinaryPerformances

Retrieve binary classification measures for multilabel classification predictions.
generateBenchmarkSummaryData

Generate data for a benchmark-summary plot.
getMlrOptions

Returns a list of mlr's options
makeWrappedModel

Induced model of learner.
getClassWeightParam

Get the class weight parameter of a learner.
mtcars.task

Motor Trend Car Road Tests clustering task
FeatSelControl

Create control structures for feature selection.
pid.task

PimaIndiansDiabetes classification task
normalizeFeatures

Normalize features
plotCritDifferences

Plot critical differences for a selected measure.
lung.task

NCCTG Lung Cancer survival task
makeCostMeasure

Creates a measure for non-standard misclassification costs.
removeConstantFeatures

Remove constant features from a data set.
getTaskClassLevels

Get the class levels for classification and multilabel tasks.
makeCustomResampledMeasure

Construct your own resampled performance measure.
makeModelMultiplexer

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

Plot filter values using ggvis.
plotViperCharts

Visualize binary classification predictions via ViperCharts system.
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
getProbabilities

Deprecated, use getPredictionProbabilities instead.
tuneThreshold

Tune prediction threshold.
learners

List of supported learning algorithms.
plotThreshVsPerf

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

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

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

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

Extract the feature selection results from a benchmark result.
performance

Measure performance of prediction.
getFeatSelResult

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

Extract the predictions from a benchmark result.
makeCostSensRegrWrapper

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

Merges small levels of factors into new level.
getFilterValues

Calculates feature filter values.
getTaskType

Get the type of the task.
makePreprocWrapperCaret

Fuse learner with preprocessing
generateThreshVsPerfData

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

Plots results from generateROCRCurvesData using ggvis.
plotBenchmarkSummary

Plot a benchmark-summary.
PartialPredictionData

getNestedTuneResultsOptPathDf

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

Extract the feature selection results from a benchmark result.
generateFilterValuesData

Calculates feature filter values.
convertMLBenchObjToTask

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

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

Find matching learning algorithms.
generateCalibrationData

Generate classifier calibration data.
getTaskFeatureNames

Get feature names of task.
plotLearningCurve

Plot learning curve data using ggplot2.
ResamplePrediction

Prediction from resampling.
getTaskTargets

Get target column of task.
resample

Fit models according to a resampling strategy.
makeStackedLearner

Create a stacked learner object.
plotTuneMultiCritResultGGVIS

Plots multi-criteria results after tuning using ggvis.
plotThreshVsPerfGGVIS

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

Generate data to plot a rank-matrix as a barplot.
makeImputeMethod

Create a custom imputation method.
makeFeatSelWrapper

Fuse learner with feature selection.
plotROCRCurves

Plots results from generateROCRCurvesData using ggplot2.
generatePartialPredictionData

Generate partial predictions
makeCostSensWeightedPairsWrapper

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

Plot a rank-matrix as a barplot.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
getBMRMeasureIds

Return measures IDs used in benchmark.
makeWeightedClassesWrapper

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

Instantiates a resampling strategy object.
makeBaggingWrapper

Fuse learner with the bagging technique.
plotROCCurves

Plots a ROC curve using ggplot2
makeUndersampleWrapper

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

Plot calibration data using ggplot2.
makeFilter

Create a feature filter
plotLearnerPrediction

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

Yeast multilabel classification task
setId

Set the id of a learner object.
summarizeColumns

Summarize columns of data.frame or task.
train

Train a learning algorithm.
subsetTask

Subset data in task.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
setPredictThreshold

Set the probability threshold the learner should use.
setHyperPars

Set the hyperparameters of a learner object.
trainLearner

Train an R learner.
smote

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

Set the type of predictions the learner should return.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task
setHyperPars2

Only exported for internal use.
removeHyperPars

Remove hyperparameters settings of a learner.
predictLearner

Predict new data with an R learner.
hasProperties

Deprecated, use hasLearnerProperties instead.
getBMRPerformances

Extract the test performance values from a benchmark result.
setThreshold

Set threshold of prediction object.
selectFeatures

Feature selection by wrapper approach.
sonar.task

Sonar classification task
tuneParams

Hyperparameter tuning.
setAggregation

Set aggregation function of measure.
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.