corr_datasets_by_imps: corr_datasets_by_imps

Description Usage Arguments Author(s) See Also Examples

View source: R/ranger_crossRF_plot_util.R

Description

The correlation of importance scores between datasets

Usage

1
corr_datasets_by_imps(feature_imps_list, ranked = TRUE, plot = FALSE)

Arguments

feature_imps_list

a list of feature importance scores from the output of rf_reg.by_datasets or rf_clf.by_datasets

ranked

if transform importance scores into rank for correlation analysis

plot

if plot the correlation matrix

Author(s)

Shi Huang

See Also

ranger rf_clf.by_datasets rf_reg.by_datasets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
df <- data.frame(rbind(t(rmultinom(7, 75, c(.21,.6,.12,.38,.099))),
            t(rmultinom(8, 75, c(.001,.6,.42,.58,.299))),
            t(rmultinom(15, 75, c(.011,.6,.22,.28,.289))),
            t(rmultinom(15, 75, c(.091,.6,.32,.18,.209))),
            t(rmultinom(15, 75, c(.001,.6,.42,.58,.299)))))
df0 <- data.frame(t(rmultinom(60, 300,c(.001,.6,.2,.3,.299))))
metadata<-data.frame(f_s=factor(c(rep("A", 15), rep("B", 15), rep("A", 15), rep("B", 15))),
                     f_c=factor(c(rep("C", 30), rep("D", 30))),
                     f_d=factor(c(rep("A", 15), rep("B", 15), rep("C", 15), rep("D", 15))),
                     age=c(1:30, 2:31)
                     )
reg_res<-rf_reg.by_datasets(df, metadata, s_category='f_d', c_category='age')
corr_datasets_by_imps(reg_res$feature_imps_list, plot=TRUE)
clf_res<-rf_clf.by_datasets(df, metadata, s_category='f_s', c_category='f_c')
corr_datasets_by_imps(clf_res$feature_imps_list, plot=TRUE)

shihuang047/crossRanger documentation built on Feb. 19, 2021, 10:13 p.m.