detected | R Documentation |
Given a vector functional (true) attribute names, a vector of sorted attribute names, and percentile threshold, returns true positive rate.
detected(top.pct, results.df, functional, sort_col, get_min = FALSE)
top.pct |
percentile of top relief scores compared with the functional list |
results.df |
dataframe of sorted attribute names (column 'att') (e.g., feature important scores or low to high P value) from either CORElearn, NPDR, or random forest. |
functional |
character vector of functional/true attribute names |
sort_col |
column to sort importance score on. e.g., 'rrelief', 'rf.scores', or 'pval.att'. |
get_min |
Boolean. Whether to reverse the sort, e.g., for p value. Default to FALSE (i.e., sort by importance scores). |
True positive rate: number of true postives divided by the number of functional
out_npdr <- npdr("class", case.control.3sets$train)
functional_feats <- case.control.3sets$signal.names
detected(0.2, out_npdr, functional_feats, "pval.att", TRUE)
## Not run:
ranfor_fit <- randomForest(as.factor(class) ~ ., case.control.3sets$train)
rf_imp <- data.frame(importance(ranfor_fit)) %>%
rownames2columns("att")
detected(0.1, rf_imp, functional_feats, "MeanDecreaseGini")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.