Learn R Programming

iimi (version 1.2.2)

predict_iimi: predict_iimi()

Description

Uses a machine learning model to predict the infection status for the plant sample(s). User can use their own model if needed.

Usage

predict_iimi(newdata, method = "xgb", trained_model, report_virus_level = TRUE)

Value

A data frame of diagnostics result for each sample

Arguments

newdata

A matrix or data frame that contains the features extracted from the coverage profile using convert_bam_to_cov().

method

The machine learning method of choice, rf, xgb, or en. rf stands for random forest model; xgb stands for XGBoost model; and en stands for elastic net model.

trained_model

The trained model. If not provided, default model is used.

report_virus_level

If TRUE, the function returns the aggregated results based on the virus. If FALSE, the function returns the unaggregated results based on segment level with each decision's probability decided by the model. We do not recommended to set this to FALSE.

Examples

Run this code

if (FALSE) df <- convert_rle_to_df(example_cov)
predictions <- predict_iimi(df)




Run the code above in your browser using DataLab