Learn R Programming

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

mlr (version 2.6)

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

7,379

Version

2.6

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

November 26th, 2015

Functions in mlr (2.6)

estimateRelativeOverfitting

Estimate relative overfitting.
TuneMultiCritResult

Result of multi-criteria tuning.
RLearner

Internal construction / wrapping of learner object.
PartialPredictionData

createDummyFeatures

Generate dummy variables for factor features.
LearningCurveData

filterFeatures

Filter features by thresholding filter values.
convertMLBenchObjToTask

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

Estimate the residual variance
costiris.task

Iris cost-sensitive classification task
FilterValues

getBMRMeasures

Return measures used in benchmark.
TuneResult

Result of tuning.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
BenchmarkResult

BenchmarkResult object.
getBMRTaskIds

Return task ids used in benchmark.
getFailureModelMsg

Return error message of FailureModel.
getTaskFeatureNames

Get feature names of task.
getCaretParamSet

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

European Union Agricultural Workforces clustering task
getTaskSize

Get number of observations in task.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
aggregations

Aggregation methods.
getProbabilities

Deprecated, use getPredictionProbabilities instead.
getNestedTuneResultsX

Get the tuned hyperparameter settings from a nested tuning.
getClassWeightParam

Get the class weight parameter of a learner.
getTaskClassLevels

Get the class levels for classification and multilabel tasks.
getFilteredFeatures

Returns the filtered features.
getHomogeneousEnsembleModels

Deprecated, use getLearnerModel instead.
crossover

crossover
makeImputeMethod

Create a custom imputation method.
getMlrOptions

Returns a list of mlr's options
getFeatSelResult

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

Specifiy your own aggregation of measures
TuneControl

Create control structures for tuning.
generatePartialPredictionData

Generate partial predictions
generateCalibrationData

Generate classifier calibration data.
getTaskId

Get the id of the task.
getHyperPars

Get current parameter settings for a learner.
predict.WrappedModel

Predict new data.
makeBaggingWrapper

Fuse learner with the bagging technique.
getBMRTuneResults

Extract the tuning results from a benchmark result.
getTaskCosts

Extract costs in task.
getConfMatrix

Confusion matrix.
iris.task

Iris classification task
TuneMultiCritControl

Create control structures for multi-criteria tuning.
impute

Impute and re-impute data
isFailureModel

Is the model a FailureModel?
plotFilterValuesGGVIS

Plot filter values using ggvis.
listMeasures

Find matching measures.
summarizeLevels

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

Induced model of learner.
lung.task

NCCTG Lung Cancer survival task
makeCostSensRegrWrapper

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

Fuse learner with simple downsampling (subsampling).
friedmanTestBMR

Perform overall Friedman test for a BenchmarkResult.
getLearnerModel

Get underlying R model of learner integrated into mlr.
TaskDesc

Description object for task.
ResampleResult

ResampleResult object.
getRRPredictions

Get predictions from resample results.
bh.task

Boston Housing regression task
FailureModel

Failure model.
getDefaultMeasure

Get default measure.
generateROCRCurvesData

Generate binary classification predictions via ROCR ROC curves.
Aggregation

Aggregation object.
makeFilterWrapper

Fuse learner with a feature filter method.
dropFeatures

Drop some features of task.
getBMRLearners

Return learners used in benchmark.
getTaskTargetNames

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

Show and visualize the steps of feature selection.
getNestedTuneResultsOptPathDf

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

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

Performance measures.
listLearners

Find matching learning algorithms.
getBMRMeasureIds

Return measures IDs used in benchmark.
FeatSelResult

Result of feature selection.
makeResampleDesc

Create a description object for a resampling strategy.
generateFilterValuesData

Calculates feature filter values.
getBMRLearnerIds

Return learner ids used in benchmark.
getPredictionResponse

Get response / truth from prediction object.
getPredictionProbabilities

Get probabilities for some classes.
makeMulticlassWrapper

Fuse learner with multiclass method.
setPredictThreshold

Set the probability threshold the learner should use.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
sonar.task

Sonar classification task
downsample

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

Subset data in task.
yeast.task

Yeast multilabel classification task
makeFilter

Create a feature filter
getParamSet

Get a description of all possible parameter settings for a learner.
bc.task

Wisconsin Breast Cancer classification task
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.
convertBMRToRankMatrix

Convert BenchmarkResult to a rank-matrix.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
configureMlr

Configures the behavior of the package.
plotLearnerPrediction

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

List of supported learning algorithms.
removeConstantFeatures

Remove constant features from a data set.
pid.task

PimaIndiansDiabetes classification task
mtcars.task

Motor Trend Car Road Tests clustering task
mergeSmallFactorLevels

Merges small levels of factors into new level.
plotROCRCurvesGGVIS

Plots results from generateROCRCurvesData using ggvis.
generateRankMatrixAsBarData

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

Use binary relevance method to create a multilabel learner.
makeStackedLearner

Create a stacked learner object.
makeOverBaggingWrapper

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

Plots results from generateROCRCurvesData using ggplot2.
removeHyperPars

Remove hyperparameters settings of a learner.
friedmanPostHocTestBMR

Perform a posthoc Friedman-Nemenyi test.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
makeResampleInstance

Instantiates a resampling strategy object.
plotFilterValues

Plot filter values using ggplot2.
train

Train a learning algorithm.
plotPartialPrediction

Plot a partial prediction with ggplot2
ResamplePrediction

Prediction from resampling.
plotBenchmarkResult

Create a Trellis-plot for a selected measure.
makeImputeWrapper

Fuse learner with an imputation method.
generateThreshVsPerfData

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

Set threshold of prediction object.
plotCalibration

Plot calibration data using ggplot2.
learnerArgsToControl

Convert arguments to control structure.
smote

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

Generate data for a benchmark-summary plot.
generateCritDifferencesData

Generate data for critical-differences plot.
makeLearner

Create learner object.
getTaskFormula

Get formula of a task.
mergeBenchmarkResultTask

Merge different tasks of BenchmarkResult objects
makeFeatSelWrapper

Fuse learner with feature selection.
plotROCCurves

Plots a ROC curve using ggplot2
mergeBenchmarkResultLearner

Merge different learners of BenchmarkResult objects
getMultilabelBinaryPerformances

Retrieve binary classification measures for multilabel classification predictions.
generateLearningCurveData

Generates a learning curve
Prediction

Prediction object.
plotPartialPredictionGGVIS

Plot a partial prediction using ggvis
getTaskDescription

Get a summarizing task description.
plotLearningCurveGGVIS

Plot learning curve data using ggvis.
makeSMOTEWrapper

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

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

Calculates feature filter values.
getTaskNFeats

Get number of features in task.
summarizeColumns

Summarize columns of data.frame or task.
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.
makeWeightedClassesWrapper

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

Construct your own resampled performance measure.
FeatSelControl

Create control structures for feature selection.
getBMRPerformances

Extract the test performance values from a benchmark result.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
plotThreshVsPerf

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

Get the type of the task.
tuneThreshold

Tune prediction threshold.
selectFeatures

Feature selection by wrapper approach.
makePreprocWrapper

Fuse learner with preprocessing.
makePreprocWrapperCaret

Fuse learner with preprocessing
plotThreshVsPerfGGVIS

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

Get target data of task.
reimpute

Re-impute a data set
predictLearner

Predict new data with an R learner.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task
oversample

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

Set the hyperparameters of a learner object.
normalizeFeatures

Normalize features
benchmark

Benchmark experiment for multiple learners and tasks.
LearnerProperties

Set, add, remove or query properties of learners
joinClassLevels

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

Plot critical differences for a selected measure.
makeCostSensClassifWrapper

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

Deprecated, use hasLearnerProperties instead.
setId

Set the id of a learner object.
trainLearner

Train an R learner.
plotTuneMultiCritResultGGVIS

Plots multi-criteria results after tuning using ggvis.
plotRankMatrixAsBar

Plot a rank-matrix as a barplot.
makeUndersampleWrapper

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

Plot a benchmark-summary.
makeTuneWrapper

Fuse learner with tuning.
resample

Fit models according to a resampling strategy.
listFilterMethods

List filter methods
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
tuneParams

Hyperparameter tuning.
setPredictType

Set the type of predictions the learner should return.
getBMRPredictions

Extract the predictions from a benchmark result.
plotLearningCurve

Plot learning curve data using ggplot2.
performance

Measure performance of prediction.
setAggregation

Set aggregation function of measure.
plotViperCharts

Visualize binary classification predictions via ViperCharts system.
makeModelMultiplexer

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

Extract data in task.
makeMeasure

Construct performance measure.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
setHyperPars2

Only exported for internal use.
makeCostSensWeightedPairsWrapper

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