Learn R Programming

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

mlr (version 2.3)

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

Version

2.3

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

February 4th, 2015

Functions in mlr (2.3)

TuneMultiCritResult

Result of multi-criteria tuning.
getTaskTargets

Get target column of task.
listLearners

Find matching learning algorithms.
getHyperPars

Get current parameter settings for a learner.
getBMRPredictions

Extract the predictions from a benchmark result.
getTaskFeatureNames

Get feature names of task.
getBMRAggrPerformances

Extract the aggregated performance values from a benchmark result.
makeFixedHoldoutInstance

Generate a fixed holdout instance for resampling.
bh.task

Boston Housing regression task
getTaskTargetNames

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

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

Extract the feature selection results from a benchmark result.
TuneMultiCritControl

Create control structures for multi-criteria tuning.
getHomogeneousEnsembleModels

Returns the list of fitted models.
ResampleResult

ResampleResult object.
FeatSelResult

Result of feature selection.
agri.task

European Union Agricultural Workforces clustering task
TaskDesc

Description object for task.
FilterValues

getFilteredFeatures

Returns the filtered features.
BenchmarkResult

Result of a benchmark run.
getBMRTaskIds

Return task ids used in benchmark.
createDummyFeatures

Generate dummy variables for factor features.
costiris.task

Iris cost-sensitive classification task
getProbabilities

Get probabilities for some classes.
getTaskNFeats

Get number of features in task.
makeCostSensRegrWrapper

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

Returns a list of mlr's options
makeUndersampleWrapper

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

Prediction from resampling.
getBMRTuneResults

Extract the tuning results from a benchmark result.
setAggregation

Set aggregation function of measure.
makeAggregation

Specifiy your own aggregation of measures
getTaskDescription

Get a summarizing task description.
makeClassifTask

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

Is the model a FailureModel?
impute

Impute and re-impute data
LearnerProperties

Set, add, remove or query properties of learners
FailureModel

Failure model.
getFilterValues

Calculates feature filter values.
getLearnerModel

Get underlying R model of learner integrated into mlr.
getBMRLearnerIds

Return learner ids used in benchmark.
asROCRPrediction

Converts predictions to a format package ROCR can handle.
getFailureModelMsg

Return error message of FailureModel.
learnerArgsToControl

Convert arguments to control structure.
estimateResidualVariance

Estimate the residual variance
makeMeasure

Construct performance measure.
listFilterMethods

List filter methods
benchmark

Benchmark experiment for multiple learners and tasks.
Prediction

Prediction object.
getParamSet

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

Get the id of the task.
normalizeFeatures

Normalize features
TuneResult

Result of tuning.
makeWrappedModel

Induced model of learner.
getTaskFormulaAsString

Get formula of a task.
makeDownsampleWrapper

Fuse learner with simple downsampling (subsampling).
summarizeLevels

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

Create a description object for a resampling strategy.
wpbc.task

Wisonsin Prognostic Breast Cancer (WPBC) survival task
getTaskData

Extract data in task.
removeHyperPars

Remove hyperparameters settings of a learner.
plotLearnerPrediction

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

Motor Trend Car Road Tests clustering task
crossover

crossover
plotTuneMultiCritResult

Plots multi-criteria results after tuning.
listMeasures

Find matching measures.
getConfMatrix

Confusion matrix.
bc.task

Wisconsin Breast Cancer classification task
setHyperPars2

Only exported for internal use.
makeImputeMethod

Create a custom imputation method.
makeLearner

Create learner object.
makeStackedLearner

Create a stacked learner object.
makeResampleInstance

Instantiates a resampling strategy object.
lung.task

NCCTG Lung Cancer survival task
predict.WrappedModel

Predict new data.
makeCostSensWeightedPairsWrapper

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

Creates a measure for non-standard misclassification costs.
configureMlr

Configures the behavior of the package.
downsample

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

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

Get the type of the task.
iris.task

Iris classification task
sonar.task

Sonar classification task
setPredictType

Set the type of predictions the learner should return.
getBMRFeatSelResults

Extract the feature selection results from a benchmark result.
analyzeFeatSelResult

Show and visualize the steps of feature selection.
learners

List of supported learning algorithms.
makeMulticlassWrapper

Fuse learner with multiclass method.
plotFilterValues

Plot filter values.
reimpute

Re-impute a data set
plotThreshVsPerf

Plot threshold vs. performance(s) for 2-class classification.
subsetTask

Subset data in task.
makeModelMultiplexerParamSet

Creates a parameter set for model multiplexer tuning.
getBMRPerformances

Extract the test performance values from a benchmark result.
selectFeatures

Feature selection by wrapper approach.
oversample

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

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

Set the hyperparameters of a learner object.
makeFilterWrapper

Fuse learner with a feature filter method.
aggregations

Aggregation methods.
showHyperPars

Display all possible hyperparameter settings for a learner that mlr knows.
getStackedBaseLearnerPredictions

Returns the predictions for each base learner.
getTaskCosts

Extract costs in task.
train

Train a learning algorithm.
TuneControl

Create control structures for tuning.
getTuneResult

Returns the optimal hyperparameters and optimization path after training.
mergeSmallFactorLevels

Merges small levels of factors into new level.
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.
Aggregation

Aggregation object.
setThreshold

Set threshold of prediction object.
makeBaggingWrapper

Fuse learner with the bagging technique.
makeFilter

Create a feature filter
resample

Fit models according to a resampling strategy.
makeOverBaggingWrapper

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

Visualize binary classification predictions via ViperCharts system.
makeWeightedClassesWrapper

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

Fuse learner with an imputation method.
pid.task

PimaIndiansDiabetes classification task
trainLearner

Train an R learner.
RLearner

Internal construction / wrapping of learner object.
makeCustomResampledMeasure

Construct your own resampled performance measure.
measures

Performance measures.
makePreprocWrapper

Fuse learner with preprocessing.
tuneThreshold

Tune prediction threshold.
makeSMOTEWrapper

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

Set the probability threshold the learner should use.
predictLearner

Predict new data with an R learner.
capLargeValues

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

Measure performance of prediction.
smote

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

Create control structures for feature selection.
makeCostSensClassifWrapper

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

Fuse learner with preprocessing
makeTuneWrapper

Fuse learner with tuning.
dropFeatures

Drop some features of task.
plotROCRCurves

Visualize binary classification predictions via ROCR ROC curves.
makeFeatSelWrapper

Fuse learner with feature selection.
tuneParams

Hyperparameter tuning.
filterFeatures

Filter features by thresholding filter values.
removeConstantFeatures

Remove constant features from a data set.
setId

Set the id of a learner object.
summarizeColumns

Summarize columns of data.frame or task.
tuneParamsMultiCrit

Hyperparameter tuning for multiple measures at once.