detected: detected

View source: R/detection.R

detectedR Documentation

detected

Description

Given a vector functional (true) attribute names, a vector of sorted attribute names, and percentile threshold, returns true positive rate.

Usage

detected(top.pct, results.df, functional, sort_col, get_min = FALSE)

Arguments

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).

Value

True positive rate: number of true postives divided by the number of functional

Examples

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)


insilico/glmSTIR documentation built on July 7, 2023, 12:29 a.m.