View source: R/rf.opti.mtry.taxo.R
rf.opti.mtry.taxo | R Documentation |
Runs random forest classification with several taxonomic level and mtry parameters and performs k-fold or blind cross-validation.
rf.opti.mtry.taxo(
tab,
tax.table,
treat,
n.mtry = 5,
mtry = function(x) i.mtry * x/n.mtry * 0.5,
tax.lvl = c("ASV", "genus", "family", "order", "class"),
cross.val = "kfold",
train.id = NA,
n.tree = 100,
cross.param = 5,
seed = 1409,
RDSfile = NULL
)
tab |
An abundance table containing samples in columns and OTUs/ASV in rows. |
tax.table |
A table containing the taxonomy of each ASV/OTU. |
treat |
A boolean vector containing the class identity of each sample, i.e. the treatment to predict. This means that you should pick a class as a reference for the calculation of precision and sensitivity. |
n.mtry |
The number of mtry parameters to be tested. Default is 5. |
mtry |
A function of |
tax.lvl |
A character vector containing the names of the taxonomic levels to be used for asv table
aggregation. Default is |
cross.val |
The type of cross validation to perform. Possible values are "blind" or "kfold" (Default). |
train.id |
A string that matches the name of samples tu be used for training. Only
meaningful for |
n.tree |
The number of tree to grow for each forest. Default is 100. |
cross.param |
The parameter needed for cross validation: the number of folds for
|
seed |
The seed to set before growing each forest, and before sampling of training dataset in
|
RDSfile |
A string contaning the name of the RDS file to save the results. Default is NULL and results are not saved. |
Returns a list of dataframes corresponding to the different taxonomic levels. Each dataframe contains
the confusion matrix, sensitivity, precision and error rate obtained for each value of the mtry parameter.
Mean value and standard deviation are computed over the results of the cross.param
forests grown.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.