modelling-accessors: Modelling accessor methods

binaryComparisonsR Documentation

Modelling accessor methods

Description

Methods for accessing modelling results.

Usage

binaryComparisons(x, cls = "class")

## S4 method for signature 'AnalysisData'
binaryComparisons(x, cls = "class")

mtry(x, cls = "class")

## S4 method for signature 'AnalysisData'
mtry(x, cls = "class")

type(x)

## S4 method for signature 'RandomForest'
type(x)

## S4 method for signature 'Univariate'
type(x)

response(x)

## S4 method for signature 'RandomForest'
response(x)

## S4 method for signature 'Univariate'
response(x)

metrics(x)

## S4 method for signature 'RandomForest'
metrics(x)

## S4 method for signature 'list'
metrics(x)

## S4 method for signature 'Analysis'
metrics(x)

predictions(x)

## S4 method for signature 'RandomForest'
predictions(x)

## S4 method for signature 'list'
predictions(x)

## S4 method for signature 'Analysis'
predictions(x)

importanceMetrics(x)

## S4 method for signature 'RandomForest'
importanceMetrics(x)

importance(x)

## S4 method for signature 'RandomForest'
importance(x)

## S4 method for signature 'Univariate'
importance(x)

## S4 method for signature 'list'
importance(x)

## S4 method for signature 'Analysis'
importance(x)

proximity(x, idx = NULL)

## S4 method for signature 'RandomForest'
proximity(x, idx = NULL)

## S4 method for signature 'list'
proximity(x, idx = NULL)

## S4 method for signature 'Analysis'
proximity(x, idx = NULL)

explanatoryFeatures(x, ...)

## S4 method for signature 'Univariate'
explanatoryFeatures(
  x,
  threshold = 0.05,
  value = c("adjusted.p.value", "p.value")
)

## S4 method for signature 'RandomForest'
explanatoryFeatures(
  x,
  metric = "false_positive_rate",
  value = c("value", "p-value", "adjusted_p-value"),
  threshold = 0.05
)

## S4 method for signature 'list'
explanatoryFeatures(x, ...)

## S4 method for signature 'Analysis'
explanatoryFeatures(x, ...)

Arguments

x

S4 object of class AnalysisData,RandomForest, Univariate, Analysis or a list.

cls

sample information column to use

idx

sample information column to use for sample names. If NULL, the sample row number will be used. Sample names should be unique for each row of data.

...

arguments to parse to method for specific class

threshold

threshold below which explanatory features are extracted

value

the importance value to threshold. See the usage section for possible values for each class.

metric

importance metric for which to retrieve explanatory features

Methods

  • binaryComparisons: Return a vector of all possible binary comparisons for a given sample information column.

  • mtry: Return the default mtry random forest parameter value for a given sample information column.

  • type: Return the type of random forest analysis.

  • response: Return the response variable name used for a random forest analysis.

  • metrics: Retrieve the model performance metrics for a random forest analysis

  • predictions: Retrieve the out of bag model response predictions for a random forest analysis.

  • importanceMetrics: Retrieve the available feature importance metrics for a random forest analysis.

  • importance: Retrieve feature importance results.

  • proximity: Retrieve the random forest sample proximities.

  • explanatoryFeatures: Retrieve explanatory features.

Examples

library(metaboData)

d <- analysisData(abr1$neg[,200:300],abr1$fact)

## Return possible binary comparisons for the `day` response column
binaryComparisons(d,cls = 'day')

## Return the default random forest `mtry` parameter for the `day` response column
mtry(d,cls = 'day')

## Perform random forest analysis
rf_analysis <- randomForest(d,cls = 'day')

## Return the type of random forest
type(rf_analysis)

## Return the response variable name used
response(rf_analysis)

## Retrieve the model performance metrics
metrics(rf_analysis)

## Retrieve the out of bag model response predictions
predictions(rf_analysis)

## Show the available feature importance metrics
importanceMetrics(rf_analysis)

## Retrieve the feature importance results
importance(rf_analysis)

## Retrieve the sample proximities
proximity(rf_analysis)

## Retrieve the explanatory features
explanatoryFeatures(rf_analysis,metric = 'false_positive_rate',threshold = 0.05)

jasenfinch/metabolyseR documentation built on Sept. 18, 2023, 1:25 a.m.