Description Usage Arguments Value Examples
View source: R/grid_search_1d_class.R
A one dimensional grid search calculates a performance metric for a model at evenly spaced values for a model input parameter. The "optimum" value for the parameter is suggested as the one which maximises performance, or minimises error (whichever is appropriate for the chosen metric)
1 2 3 4 5 6 7 8 | grid_search_1d(
param_to_optimise,
search_values,
model_index,
factor_name,
max_min = "min",
...
)
|
param_to_optimise |
(character) The name of the model input parameter that is the focus of the search. |
search_values |
(ANY) The values of the input parameter being optimised. |
model_index |
(numeric, integer) The index of the model in the sequence that uses the parameter being optimised. |
factor_name |
(character) The name of a sample-meta column to use. |
max_min |
(character) Maximise or minimise. Allowed values are limited to the following:
The default is |
... |
Additional slots and values passed to |
A grid_search_1d
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | D = MTBLS79_DatasetExperiment()
# some preprocessing
M = pqn_norm(qc_label='QC',factor_name='class') +
knn_impute() +
glog_transform(qc_label='QC',factor_name='class') +
filter_smeta(factor_name='class',levels='QC',mode='exclude')
M=model_apply(M,D)
D=predicted(M)
# reduce number of features for this example
D=D[,1:10]
# optmise number of components for PLS model
I = grid_search_1d(param_to_optimise='number_components',search_values=1:5,
model_index=2,factor_name='class') *
(mean_centre()+PLSDA(factor_name='class'))
I = run(I,D,balanced_accuracy())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.