summaryrefslogtreecommitdiff
path: root/analysis/days.R
diff options
context:
space:
mode:
Diffstat (limited to 'analysis/days.R')
-rw-r--r--analysis/days.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/analysis/days.R b/analysis/days.R
index 52fb878..8df39dd 100644
--- a/analysis/days.R
+++ b/analysis/days.R
@@ -1,6 +1,8 @@
########## INFORMATIONS ##########
# This file is made to study online classification
# So, each pair (wireless,wakeupfor) has its classification models (knn and decision tree)
+# Note that is the following error appears: object 'accuracy' not found
+# it means you should toggle the boolean in the if condition in the code to generate the accuracy onbject
##################################
library("tidyverse")
@@ -211,7 +213,7 @@ energy_coverage_delta=energy_coverage_delta%>%group_by(wireless,wakeupfor)%>%sum
write("wireless,wakeupfor,policy,slope,intercept,delta_coverage","figures/delta_energy_coverage.csv")
energy_coverage_delta%>%group_by(wireless,wakeupfor,simkey)%>%group_walk(function(data,grp){
grp=as.list(grp)
- reg=lm(delta_energy/1e3 ~ days,data)
+ reg=lm(delta_energy ~ days,data)
slope=round(as.numeric(reg$coefficients["days"]),digits=1)
intercept=round(as.numeric(reg$coefficients[1]),digits=1)
mean_delta_coverage=round(mean(data$delta_coverage),digits=1)
@@ -222,8 +224,8 @@ energy_coverage_delta%>%group_by(wireless,wakeupfor,simkey)%>%group_walk(functio
ggplot(energy_coverage_delta,aes(days/30,delta_energy/1e3,color=simkey,shape=simkey))+
geom_line(size=1.2)+ylab("Delta in energy (kJ)")+xlab("Training duration (months)")+
facet_wrap(~wireless+wakeupfor,scale="free")+
- th()+theme(legend.position="top")+labs(color="Classes")
-ggsave("figures/delta_energy_training.pdf")
+ th()+theme(legend.position=c(0.61,0.93))+labs(color="Classes")
+ggsave("figures/delta_energy_training.pdf",height=6,width=10)
ggplot(energy_coverage_delta,aes(days/30,delta_coverage,color=simkey))+
geom_line(size=1.2)+ylab("Delta in coverage")+xlab("Training duration (months)")+