Skip to contents

Binary classification with orthogonal partial least squares discriminant analysis (OPLS-DA). Calls ropls::opls() from Bioconductor package ropls.

ropls is distributed via Bioconductor and not via CRAN, so it has to be installed with BiocManager::install("ropls").

Initial parameter values

  • predI

    • Actual default: NA, which lets ropls::opls() determine the number of predictive components by cross-validation.

    • Adjusted default: 1

    • Reason for change: OPLS-DA is defined with a single predictive component, and a fixed number of components keeps the model comparable across resampling iterations.

  • orthoI

    • Actual default: 0

    • Adjusted default: 1

    • Reason for change: With orthoI = 0 no orthogonal component is extracted and ropls::opls() fits plain PLS-DA instead of OPLS-DA.

  • permI

    • Actual default: 20

    • Adjusted default: 0

    • Reason for change: The permutation test is a model diagnostic that is not used for prediction and costs permI extra model fits.

Suppressed output

ropls::opls() writes a diagnostic figure and a model summary by default. Both are suppressed by fixing fig.pdfC and info.txtC to "none", so neither is exposed as a hyperparameter.

Number of components

ropls::opls() requires predI + orthoI to not exceed the smaller of the number of observations and the number of features, and errors otherwise. With the initial parameter values this means that the learner needs at least two features.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.opls")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, mlr3extralearners, ropls

Parameters

IdTypeDefaultLevelsRange
predIinteger-\([1, \infty)\)
orthoIinteger0\([0, \infty)\)
algoCcharacterdefaultdefault, nipals, svd-
crossvalIinteger7\([1, \infty)\)
log10LlogicalFALSETRUE, FALSE-
scaleCcharacterstandardnone, center, pareto, standard-
permIinteger20\([0, \infty)\)

References

Thévenot, A. E, Roux, Aurélie, Xu, Ying, Ezan, Eric, Junot, Christophe (2015). “Analysis of the Human Adult Urinary Metabolome Variations with Age, Body Mass Index, and Gender by Implementing a Comprehensive Workflow for Univariate and OPLS Statistical Analyses.” Journal of Proteome Research, 14(8), 3322–3335. doi:10.1021/acs.jproteome.5b00354 .

See also

Author

Takha65

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifOPLS

Methods

Inherited methods


LearnerClassifOPLS$new()

Creates a new instance of this R6 class.

Usage


LearnerClassifOPLS$clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifOPLS$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.opls")
print(learner)
#> 
#> ── <LearnerClassifOPLS> (classif.opls): OPLS-DA ────────────────────────────────
#> • Model: -
#> • Parameters: predI=1, orthoI=1, permI=0
#> • Packages: mlr3, mlr3extralearners, and ropls
#> • Predict Types: [response]
#> • Feature Types: integer and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties: twoclass
#> • Other settings: use_weights = 'error', predict_raw = 'FALSE'

# Define a Task
task = tsk("sonar")

# Create train and test set
ids = partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)
#> OPLS-DA
#> 139 samples x 60 variables and 1 response
#> standard scaling of predictors and response(s)
#>       R2X(cum) R2Y(cum) Q2(cum) RMSEE pre ort
#> Total    0.283    0.455   0.369 0.371   1   1


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> classif.ce 
#>  0.2318841