fs_line: Forward selection line plot

View source: R/forward_selection_by_rank_class.R

fs_lineR Documentation

Forward selection line plot

Description

A line plot for forward selection. The computed model performance metric is plotted against the number of features included in the model.

Usage

fs_line(...)

Arguments

...

Additional slots and values passed to struct_class.

Value

A fs_line object. This object has no output slots. See chart_plot in the struct package to plot this chart object.

Inheritance

A fs_line object inherits the following struct classes:

⁠[fs_line]⁠ >> ⁠[chart]⁠ >> ⁠[struct_class]⁠

Examples

M = fs_line()

# some data
D = MTBLS79_DatasetExperiment(filtered=TRUE)

# normalise, impute and scale then remove QCs
P = pqn_norm(qc_label='QC',factor_name='Class') +
    knn_impute(neighbours=5) +
    glog_transform(qc_label='QC',factor_name='Class') +
    filter_smeta(mode='exclude',levels='QC',factor_name='Class')
P = model_apply(P,D)
D = predicted(P)

# forward selection using a PLSDA model
M = forward_selection_by_rank(factor_name='Class',
                             min_no_vars=2,
                             max_no_vars=11,
                             variable_rank=1:2063) *
    (mean_centre() + PLSDA(number_components=1,
                           factor_name='Class'))
M = run(M,D,balanced_accuracy())

# chart
C = fs_line()
chart_plot(C,M)


computational-metabolomics/structtoolbox documentation built on July 2, 2024, 10:46 p.m.