Description Usage Arguments Examples
View source: R/applyFeatureSelection.R
This function removes features that are above pvalue threshold for a single data frame or a list of data frames
1 | applyFeatureSelection(data_object, ufs_result, pval_threshold)
|
data_object |
argument is the output produced by as.ML function, which contains a single x data frame or a list of x data frames, a y data frames and attributes |
ufs_result |
is a single data frame or a list of data frames of feature names and corresponding p values |
pval_threshold |
is the cutoff value for pvalues, can be a single value or a vector of distinct pvalues |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | dontrun{
library(peppuR)
library(missForest)
library(mice)
data('single_source')
data('multi_source')
x_multi = multi_source$X
y_multi = multi_source$Y
x_single = single_source$X
y_single = single_source$Y
sample_cname = 'ID'
outcome_cname = 'Group'
pair_cname = 'paircol'
result = as.MLinput(X = x_single, Y = y_single, categorical_features = T , sample_cname = sample_cname, outcome_cname = outcome_cname, pair_cname = pair_cname)
result2 = as.MLinput(X = x_multi, Y = y_multi, categorical_features = T, sample_cname = sample_cname, outcome_cname = outcome_cname, pair_cname = pair_cname)
imputed_res = impute_missing(result, method = 'randomforest')
imputed_res2 = impute_missing(result2, method = 'randomforest')
ufs_result = univariate_feature_selection(imputed_res)
ufs_result2 = univariate_feature_selection(imputed_res2)
apply_fs = applyFeatureSelection(imputed_res, ufs_result, pval_threshold = .05)
apply_fs2 = applyFeatureSelection(imputed_res2, ufs_result2, pval_threshold = c(.5,.1,.2,.3,.5))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.