In [17]:
library(yaml)
source('R_irf_benchmarks_utils.R')
In [18]:
# load output; its contained in a variable called irf_bm
load('./output/iRF_mod01_out.RData')
# recall specs
specs <- yaml.load_file('./specs/iRF_mod01.yaml')
In [19]:
# calling a helper function in the file R_irf_benchmarks_utils.R
# the third argument is the x-axis, fourth argument is the y-axis
plot_bm(irf_bm, specs, 'n_estimators', 'times')
plot_bm(irf_bm, specs, 'n_estimators', 'score')
In [41]:
feature_importances <- irf_bm[[3]][['feature_importance']][[1]]
feature_importances_rank_idx <- order(feature_importances, decreasing = TRUE)
options(repr.plot.width=10, repr.plot.height=6)
barplot(feature_importances[feature_importances_rank_idx], names.arg=feature_importances_rank_idx-1, cex.names=.8,
xlab = 'feature', ylab = 'mean decrease in Gini')
In [45]:
# lets look at feature importances across all the trials
for(i in 1:specs$n_trials){
feature_importances <- irf_bm[[3]][['feature_importance']][[i]]
feature_importances_rank_idx <- order(feature_importances, decreasing = TRUE) - 1
cat(paste('trial', i, ': ', sep = ''), feature_importances_rank_idx[1:5], '\n')
}
In [54]:
# plot stability scores from one trial
stability <- irf_bm[[3]][['stability_all']][[1]]
options(repr.plot.width=10, repr.plot.height=7)
barplot(stability, las=2)
In [59]:
# examing stability scores across all trials
for(i in 1:specs$n_trials){
stability <- irf_bm[[3]][['stability_all']][[i]]
interactions <-names(stability)
cat(paste('trial', i, ': ', sep = ''), interactions[1:5], '\n')
}
In [ ]: