Learn R Programming

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

mlr (version 2.4)

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

Version

2.4

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

June 12th, 2015

Functions in mlr (2.4)

getBMRTuneResults

Extract the tuning results from a benchmark result.
FailureModel

Failure model.
ResampleResult

ResampleResult object.
makeMulticlassWrapper

Fuse learner with multiclass method.
RLearner

Internal construction / wrapping of learner object.
aggregations

Aggregation methods.
ResamplePrediction

Prediction from resampling.
makeSMOTEWrapper

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

Generates a learning curve
subsetTask

Subset data in task.
capLargeValues

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

Create control structures for multi-criteria tuning.
estimateResidualVariance

Estimate the residual variance
benchmark

Benchmark experiment for multiple learners and tasks.
createDummyFeatures

Generate dummy variables for factor features.
filterFeatures

Filter features by thresholding filter values.
getFilteredFeatures

Returns the filtered features.
TuneMultiCritResult

Result of multi-criteria tuning.
bc.task

Wisconsin Breast Cancer classification task
costiris.task

Iris cost-sensitive classification task
getTaskFeatureNames

Get feature names of task.
getNestedTuneResultsOptPathDf

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

Show and visualize the steps of feature selection.
getBMRPerformances

Extract the test performance values from a benchmark result.
getProbabilities

Get probabilities for some classes.
generateThreshVsPerfData

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

Find matching learning algorithms.
getBMRFilteredFeatures

Extract the feature selection results from a benchmark result.
getConfMatrix

Confusion matrix.
downsample

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

Get target column of task.
joinClassLevels

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

Iris classification task
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
makeFilter

Create a feature filter
getTaskData

Extract data in task.
getTaskId

Get the id of the task.
makeCostSensRegrWrapper

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

List of supported learning algorithms.
crossover

crossover
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
plotTuneMultiCritResultGGVIS

Plots multi-criteria results after tuning using ggvis.
predictLearner

Predict new data with an R learner.
plotThreshVsPerfGGVIS

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

Is the model a FailureModel?
plotTuneMultiCritResult

Plots multi-criteria results after tuning using ggplot2.
makeWrappedModel

Induced model of learner.
removeHyperPars

Remove hyperparameters settings of a learner.
selectFeatures

Feature selection by wrapper approach.
plotLearningCurveGGVIS

Plot learning curve data using ggvis.
plotViperCharts

Visualize binary classification predictions via ViperCharts system.
getMlrOptions

Returns a list of mlr's options
getLearnerModel

Get underlying R model of learner integrated into mlr.
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)),
  • imputeMin(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.
TuneResult

Result of tuning.
generateFilterValuesData

Calculates feature filter values.
tuneParams

Hyperparameter tuning.
makeLearner

Create learner object.
makeMeasure

Construct performance measure.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
getTaskCosts

Extract costs in task.
FilterValues

makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
getRRPredictions

Get predictions from resample results.
learnerArgsToControl

Convert arguments to control structure.
getBMRTaskIds

Return task ids used in benchmark.
BenchmarkResult

Result of a benchmark run.
makeBaggingWrapper

Fuse learner with the bagging technique.
getTaskFormulaAsString

Get formula of a task.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
FeatSelControl

Create control structures for feature selection.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
makeOverBaggingWrapper

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

Calculates feature filter values.
mergeSmallFactorLevels

Merges small levels of factors into new level.
makeImputeMethod

Create a custom imputation method.
plotThreshVsPerf

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

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

Return error message of FailureModel.
getTaskSize

Get number of observations in task.
measures

Performance measures.
oversample

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

Set threshold of prediction object.
listMeasures

Find matching measures.
pid.task

PimaIndiansDiabetes classification task
tuneThreshold

Tune prediction threshold.
setAggregation

Set aggregation function of measure.
LearningCurveData

agri.task

European Union Agricultural Workforces clustering task
TaskDesc

Description object for task.
Aggregation

Aggregation object.
Prediction

Prediction object.
predict.WrappedModel

Predict new data.
bh.task

Boston Housing regression task
summarizeLevels

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

Result of feature selection.
getFeatSelResult

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

Only exported for internal use.
TuneControl

Create control structures for tuning.
getTaskNFeats

Get number of features in task.
lung.task

NCCTG Lung Cancer survival task
smote

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

Train an R learner.
getTaskDescription

Get a summarizing task description.
configureMlr

Configures the behavior of the package.
getNestedTuneResultsX

Get the tuned hyperparameter settings from a nested tuning.
LearnerProperties

Set, add, remove or query properties of learners
performance

Measure performance of prediction.
makeUndersampleWrapper

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

Extract the predictions from a benchmark result.
makePreprocWrapper

Fuse learner with preprocessing.
makeCustomResampledMeasure

Construct your own resampled performance measure.
reimpute

Re-impute a data set
getBMRLearnerIds

Return learner ids used in benchmark.
mtcars.task

Motor Trend Car Road Tests clustering task
makeStackedLearner

Create a stacked learner object.
makeClassifTask

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

Extract the feature selection results from a benchmark result.
plotFilterValuesGGVIS

Plot filter values using ggvis.
getTaskTargetNames

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

Get current parameter settings for a learner.
getParamSet

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

Plot learning curve data using ggplot2.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task
summarizeColumns

Summarize columns of data.frame or task.
impute

Impute and re-impute data
listFilterMethods

List filter methods
getHomogeneousEnsembleModels

Returns the list of fitted models.
setId

Set the id of a learner object.
makePreprocWrapperCaret

Fuse learner with preprocessing
makeAggregation

Specifiy your own aggregation of measures
plotLearnerPrediction

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

Plot filter values using ggplot2.
makeResampleDesc

Create a description object for a resampling strategy.
setHyperPars

Set the hyperparameters of a learner object.
makeCostMeasure

Creates a measure for non-standard misclassification costs.
generateROCRCurvesData

Generate binary classification predictions via ROCR ROC curves.
setPredictThreshold

Set the probability threshold the learner should use.
normalizeFeatures

Normalize features
makeModelMultiplexer

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

Hyperparameter tuning for multiple measures at once.
plotROCRCurves

Plots results from generateROCRCurvesData using ggplot2.
makeWeightedClassesWrapper

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

Fuse learner with an imputation method.
makeFilterWrapper

Fuse learner with a feature filter method.
makeResampleInstance

Instantiates a resampling strategy object.
dropFeatures

Drop some features of task.
resample

Fit models according to a resampling strategy.
setPredictType

Set the type of predictions the learner should return.
plotROCRCurvesGGVIS

Plots results from generateROCRCurvesData using ggvis.
removeConstantFeatures

Remove constant features from a data set.
makeFeatSelWrapper

Fuse learner with feature selection.
getTaskType

Get the type of the task.
train

Train a learning algorithm.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
sonar.task

Sonar classification task
makeCostSensWeightedPairsWrapper

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

Fuse learner with tuning.