-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
256 lines (256 loc) · 15.9 KB
/
.Rhistory
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
getwd()
load("C:/Users/i0386388/Desktop/tesis/datasplit_testmodels.RData")
CM_KO_30_1m<-confusionMatrix(predict(model_KO_30_1m_target_feature,test_KO_30_1m_target_feature),test_KO_30_1m_target_feature$target)
library(caret)
CM_KO_30_1m<-confusionMatrix(predict(model_KO_30_1m_target_feature,test_KO_30_1m_target_feature),test_KO_30_1m_target_feature$target)
library(randomForest)
CM_KO_30_1m<-confusionMatrix(predict(model_KO_30_1m_target_feature,test_KO_30_1m_target_feature),test_KO_30_1m_target_feature$target)
CM_KO_60_1m<-confusionMatrix(predict(model_KO_60_1m_target_feature,test_KO_60_1m_target_feature),test_KO_60_1m_target_feature$target)
CM_KO_90_1m<-confusionMatrix(predict(model_KO_90_1m_target_feature,test_KO_90_1m_target_feature),test_KO_90_1m_target_feature$target)
CM_KO_fun_1m<-confusionMatrix(predict(model_KO_fun_1m_target_feature,test_KO_fun_1m_target_feature),test_KO_fun_1m_target_feature$target)
CM_KO_30_2m<-confusionMatrix(predict(model_KO_30_2m_target_feature,test_KO_30_2m_target_feature),test_KO_30_2m_target_feature$target)
CM_KO_60_2m<-confusionMatrix(predict(model_KO_60_2m_target_feature,test_KO_60_2m_target_feature),test_KO_60_2m_target_feature$target)
CM_KO_90_2m<-confusionMatrix(predict(model_KO_90_2m_target_feature,test_KO_90_2m_target_feature),test_KO_90_2m_target_feature$target)
CM_KO_fun_2m<-confusionMatrix(predict(model_KO_fun_2m_target_feature,test_KO_fun_2m_target_feature),test_KO_fun_2m_target_feature$target)
CM_KO_30_3m<-confusionMatrix(predict(model_KO_30_3m_target_feature,test_KO_30_3m_target_feature),test_KO_30_3m_target_feature$target)
CM_KO_60_3m<-confusionMatrix(predict(model_KO_60_3m_target_feature,test_KO_60_3m_target_feature),test_KO_60_3m_target_feature$target)
CM_KO_90_3m<-confusionMatrix(predict(model_KO_90_3m_target_feature,test_KO_90_3m_target_feature),test_KO_90_3m_target_feature$target)
CM_KO_fun_3m<-confusionMatrix(predict(model_KO_fun_3m_target_feature,test_KO_fun_3m_target_feature),test_KO_fun_3m_target_feature$target)
a<-data.frame(acc1m=as.numeric(c(round(CM_KO_30_1m$overall[1]*100,2),
round(CM_KO_60_1m$overall[1]*100,2),
round(CM_KO_90_1m$overall[1]*100,2),
round(CM_KO_fun_1m$overall[1]*100,2))),
sensi1m=as.numeric(c(round(CM_KO_30_1m$byClass[1]*100,2),
round(CM_KO_60_1m$byClass[1]*100,2),
round(CM_KO_90_1m$byClass[1]*100,2),
round(CM_KO_fun_1m$byClass[1]*100,2))),
speci1m=as.numeric(c(round(CM_KO_30_1m$byClass[2]*100,2),
round(CM_KO_60_1m$byClass[2]*100,2),
round(CM_KO_90_1m$byClass[2]*100,2),
round(CM_KO_fun_1m$byClass[2]*100,2))),
acc2m=as.numeric(c(round(CM_KO_30_2m$overall[1]*100,2),
round(CM_KO_60_2m$overall[1]*100,2),
round(CM_KO_90_2m$overall[1]*100,2),
round(CM_KO_fun_2m$overall[1]*100,2))),
sensi2m=as.numeric(c(round(CM_KO_30_2m$byClass[1]*100,2),
round(CM_KO_60_2m$byClass[1]*100,2),
round(CM_KO_90_2m$byClass[1]*100,2),
round(CM_KO_fun_2m$byClass[1]*100,2))),
speci2m=as.numeric(c(round(CM_KO_30_2m$byClass[2]*100,2),
round(CM_KO_60_2m$byClass[2]*100,2),
round(CM_KO_90_2m$byClass[2]*100,2),
round(CM_KO_fun_2m$byClass[2]*100,2))),
acc3m=as.numeric(c(round(CM_KO_30_3m$overall[1]*100,2),
round(CM_KO_60_3m$overall[1]*100,2),
round(CM_KO_90_3m$overall[1]*100,2),
round(CM_KO_fun_3m$overall[1]*100,2))),
sensi3m=as.numeric(c(round(CM_KO_30_3m$byClass[1]*100,2),
round(CM_KO_60_3m$byClass[1]*100,2),
round(CM_KO_90_3m$byClass[1]*100,2),
round(CM_KO_fun_3m$byClass[1]*100,2))),
speci3m=as.numeric(c(round(CM_KO_30_3m$byClass[2]*100,2),
round(CM_KO_60_3m$byClass[2]*100,2),
round(CM_KO_90_3m$byClass[2]*100,2),
round(CM_KO_fun_3m$byClass[2]*100,2)))
)
rownames(a)<-c("EMA30","EMA60","EMA90","Alisado exponencial")
ConfusionKO<-a
ConfusionKO<-ConfusionKO[,grep(x=names(ConfusionKO), pattern="acc")]
#poner el heatmap en el markdown a modo de report useful para hacer investment
acc.heatmap<-ConfusionKO %>% rbind(ConfusionAAPL)%>% rbind(ConfusionAXP)%>% rbind(ConfusionWFC)
library(tidyverse)
#poner el heatmap en el markdown a modo de report useful para hacer investment
acc.heatmap<-ConfusionKO %>% rbind(ConfusionAAPL)%>% rbind(ConfusionAXP)%>% rbind(ConfusionWFC)
CM_AAPL_30_1m<-confusionMatrix(predict(model_AAPL_30_1m_target_feature,test_AAPL_30_1m_target_feature),test_AAPL_30_1m_target_feature$target)
CM_AAPL_30_1m<-confusionMatrix(predict(model_AAPL_30_1m_target_feature,test_AAPL_30_1m_target_feature),test_AAPL_30_1m_target_feature$target)
CM_AAPL_60_1m<-confusionMatrix(predict(model_AAPL_60_1m_target_feature,test_AAPL_60_1m_target_feature),test_AAPL_60_1m_target_feature$target)
CM_AAPL_90_1m<-confusionMatrix(predict(model_AAPL_90_1m_target_feature,test_AAPL_90_1m_target_feature),test_AAPL_90_1m_target_feature$target)
CM_AAPL_fun_1m<-confusionMatrix(predict(model_AAPL_fun_1m_target_feature,test_AAPL_fun_1m_target_feature),test_AAPL_fun_1m_target_feature$target)
CM_AAPL_30_2m<-confusionMatrix(predict(model_AAPL_30_2m_target_feature,test_AAPL_30_2m_target_feature),test_AAPL_30_2m_target_feature$target)
CM_AAPL_60_2m<-confusionMatrix(predict(model_AAPL_60_2m_target_feature,test_AAPL_60_2m_target_feature),test_AAPL_60_2m_target_feature$target)
CM_AAPL_90_2m<-confusionMatrix(predict(model_AAPL_90_2m_target_feature,test_AAPL_90_2m_target_feature),test_AAPL_90_2m_target_feature$target)
CM_AAPL_fun_2m<-confusionMatrix(predict(model_AAPL_fun_2m_target_feature,test_AAPL_fun_2m_target_feature),test_AAPL_fun_2m_target_feature$target)
CM_AAPL_30_3m<-confusionMatrix(predict(model_AAPL_30_3m_target_feature,test_AAPL_30_3m_target_feature),test_AAPL_30_3m_target_feature$target)
CM_AAPL_60_3m<-confusionMatrix(predict(model_AAPL_60_3m_target_feature,test_AAPL_60_3m_target_feature),test_AAPL_60_3m_target_feature$target)
CM_AAPL_90_3m<-confusionMatrix(predict(model_AAPL_90_3m_target_feature,test_AAPL_90_3m_target_feature),test_AAPL_90_3m_target_feature$target)
CM_AAPL_fun_3m<-confusionMatrix(predict(model_AAPL_fun_3m_target_feature,test_AAPL_fun_3m_target_feature),test_AAPL_fun_3m_target_feature$target)
a<-data.frame(acc1m=as.numeric(c(round(CM_AAPL_30_1m$overall[1]*100,2),
round(CM_AAPL_60_1m$overall[1]*100,2),
round(CM_AAPL_90_1m$overall[1]*100,2),
round(CM_AAPL_fun_1m$overall[1]*100,2))),
sensi1m=as.numeric(c(round(CM_AAPL_30_1m$byClass[1]*100,2),
round(CM_AAPL_60_1m$byClass[1]*100,2),
round(CM_AAPL_90_1m$byClass[1]*100,2),
round(CM_AAPL_fun_1m$byClass[1]*100,2))),
speci1m=as.numeric(c(round(CM_AAPL_30_1m$byClass[2]*100,2),
round(CM_AAPL_60_1m$byClass[2]*100,2),
round(CM_AAPL_90_1m$byClass[2]*100,2),
round(CM_AAPL_fun_1m$byClass[2]*100,2))),
acc2m=as.numeric(c(round(CM_AAPL_30_2m$overall[1]*100,2),
round(CM_AAPL_60_2m$overall[1]*100,2),
round(CM_AAPL_90_2m$overall[1]*100,2),
round(CM_AAPL_fun_2m$overall[1]*100,2))),
sensi2m=as.numeric(c(round(CM_AAPL_30_2m$byClass[1]*100,2),
round(CM_AAPL_60_2m$byClass[1]*100,2),
round(CM_AAPL_90_2m$byClass[1]*100,2),
round(CM_AAPL_fun_2m$byClass[1]*100,2))),
speci2m=as.numeric(c(round(CM_AAPL_30_2m$byClass[2]*100,2),
round(CM_AAPL_60_2m$byClass[2]*100,2),
round(CM_AAPL_90_2m$byClass[2]*100,2),
round(CM_AAPL_fun_2m$byClass[2]*100,2))),
acc3m=as.numeric(c(round(CM_AAPL_30_3m$overall[1]*100,2),
round(CM_AAPL_60_3m$overall[1]*100,2),
round(CM_AAPL_90_3m$overall[1]*100,2),
round(CM_AAPL_fun_3m$overall[1]*100,2))),
sensi3m=as.numeric(c(round(CM_AAPL_30_3m$byClass[1]*100,2),
round(CM_AAPL_60_3m$byClass[1]*100,2),
round(CM_AAPL_90_3m$byClass[1]*100,2),
round(CM_AAPL_fun_3m$byClass[1]*100,2))),
speci3m=as.numeric(c(round(CM_AAPL_30_3m$byClass[2]*100,2),
round(CM_AAPL_60_3m$byClass[2]*100,2),
round(CM_AAPL_90_3m$byClass[2]*100,2),
round(CM_AAPL_fun_3m$byClass[2]*100,2)))
)
rownames(a)<-c("EMA30","EMA60","EMA90","Alisado exponencial")
ConfusionAAPL<-a
ConfusionAAPL<-ConfusionAAPL[,grep(x=names(ConfusionAAPL), pattern="acc")]
kable(a, "latex") %>%
add_header_above(c(" ", "Predicción 1 mes" = 3, "Predicción 2 meses" = 3,"Predicción 3 meses"=3)) %>%
kable_styling(font_size = 10,latex_options = c("basic"))
CM_AXP_30_1m<-confusionMatrix(predict(model_AXP_30_1m_target_feature,test_AXP_30_1m_target_feature),test_AXP_30_1m_target_feature$target)
CM_AXP_60_1m<-confusionMatrix(predict(model_AXP_60_1m_target_feature,test_AXP_60_1m_target_feature),test_AXP_60_1m_target_feature$target)
CM_AXP_90_1m<-confusionMatrix(predict(model_AXP_90_1m_target_feature,test_AXP_90_1m_target_feature),test_AXP_90_1m_target_feature$target)
CM_AXP_fun_1m<-confusionMatrix(predict(model_AXP_fun_1m_target_feature,test_AXP_fun_1m_target_feature),test_AXP_fun_1m_target_feature$target)
CM_AXP_30_2m<-confusionMatrix(predict(model_AXP_30_2m_target_feature,test_AXP_30_2m_target_feature),test_AXP_30_2m_target_feature$target)
CM_AXP_60_2m<-confusionMatrix(predict(model_AXP_60_2m_target_feature,test_AXP_60_2m_target_feature),test_AXP_60_2m_target_feature$target)
CM_AXP_90_2m<-confusionMatrix(predict(model_AXP_90_2m_target_feature,test_AXP_90_2m_target_feature),test_AXP_90_2m_target_feature$target)
CM_AXP_fun_2m<-confusionMatrix(predict(model_AXP_fun_2m_target_feature,test_AXP_fun_2m_target_feature),test_AXP_fun_2m_target_feature$target)
CM_AXP_30_3m<-confusionMatrix(predict(model_AXP_30_3m_target_feature,test_AXP_30_3m_target_feature),test_AXP_30_3m_target_feature$target)
CM_AXP_60_3m<-confusionMatrix(predict(model_AXP_60_3m_target_feature,test_AXP_60_3m_target_feature),test_AXP_60_3m_target_feature$target)
CM_AXP_90_3m<-confusionMatrix(predict(model_AXP_90_3m_target_feature,test_AXP_90_3m_target_feature),test_AXP_90_3m_target_feature$target)
CM_AXP_fun_3m<-confusionMatrix(predict(model_AXP_fun_3m_target_feature,test_AXP_fun_3m_target_feature),test_AXP_fun_3m_target_feature$target)
a<-data.frame(acc1m=as.numeric(c(round(CM_AXP_30_1m$overall[1]*100,2),
round(CM_AXP_60_1m$overall[1]*100,2),
round(CM_AXP_90_1m$overall[1]*100,2),
round(CM_AXP_fun_1m$overall[1]*100,2))),
sensi1m=as.numeric(c(round(CM_AXP_30_1m$byClass[1]*100,2),
round(CM_AXP_60_1m$byClass[1]*100,2),
round(CM_AXP_90_1m$byClass[1]*100,2),
round(CM_AXP_fun_1m$byClass[1]*100,2))),
speci1m=as.numeric(c(round(CM_AXP_30_1m$byClass[2]*100,2),
round(CM_AXP_60_1m$byClass[2]*100,2),
round(CM_AXP_90_1m$byClass[2]*100,2),
round(CM_AXP_fun_1m$byClass[2]*100,2))),
acc2m=as.numeric(c(round(CM_AXP_30_2m$overall[1]*100,2),
round(CM_AXP_60_2m$overall[1]*100,2),
round(CM_AXP_90_2m$overall[1]*100,2),
round(CM_AXP_fun_2m$overall[1]*100,2))),
sensi2m=as.numeric(c(round(CM_AXP_30_2m$byClass[1]*100,2),
round(CM_AXP_60_2m$byClass[1]*100,2),
round(CM_AXP_90_2m$byClass[1]*100,2),
round(CM_AXP_fun_2m$byClass[1]*100,2))),
speci2m=as.numeric(c(round(CM_AXP_30_2m$byClass[2]*100,2),
round(CM_AXP_60_2m$byClass[2]*100,2),
round(CM_AXP_90_2m$byClass[2]*100,2),
round(CM_AXP_fun_2m$byClass[2]*100,2))),
acc3m=as.numeric(c(round(CM_AXP_30_3m$overall[1]*100,2),
round(CM_AXP_60_3m$overall[1]*100,2),
round(CM_AXP_90_3m$overall[1]*100,2),
round(CM_AXP_fun_3m$overall[1]*100,2))),
sensi3m=as.numeric(c(round(CM_AXP_30_3m$byClass[1]*100,2),
round(CM_AXP_60_3m$byClass[1]*100,2),
round(CM_AXP_90_3m$byClass[1]*100,2),
round(CM_AXP_fun_3m$byClass[1]*100,2))),
speci3m=as.numeric(c(round(CM_AXP_30_3m$byClass[2]*100,2),
round(CM_AXP_60_3m$byClass[2]*100,2),
round(CM_AXP_90_3m$byClass[2]*100,2),
round(CM_AXP_fun_3m$byClass[2]*100,2)))
)
rownames(a)<-c("EMA30","EMA60","EMA90","Alisado exponencial")
ConfusionAXP<-a
ConfusionAXP<-ConfusionAXP[,grep(x=names(ConfusionAXP), pattern="acc")]
kable(a, "latex") %>%
add_header_above(c(" ", "Predicción 1 mes" = 3, "Predicción 2 meses" = 3,"Predicción 3 meses"=3)) %>%
kable_styling(font_size = 10,latex_options = c("basic"))
CM_WFC_30_1m<-confusionMatrix(predict(model_WFC_30_1m_target_feature,test_WFC_30_1m_target_feature),test_WFC_30_1m_target_feature$target)
CM_WFC_60_1m<-confusionMatrix(predict(model_WFC_60_1m_target_feature,test_WFC_60_1m_target_feature),test_WFC_60_1m_target_feature$target)
CM_WFC_90_1m<-confusionMatrix(predict(model_WFC_90_1m_target_feature,test_WFC_90_1m_target_feature),test_WFC_90_1m_target_feature$target)
CM_WFC_fun_1m<-confusionMatrix(predict(model_WFC_fun_1m_target_feature,test_WFC_fun_1m_target_feature),test_WFC_fun_1m_target_feature$target)
CM_WFC_30_2m<-confusionMatrix(predict(model_WFC_30_2m_target_feature,test_WFC_30_2m_target_feature),test_WFC_30_2m_target_feature$target)
CM_WFC_60_2m<-confusionMatrix(predict(model_WFC_60_2m_target_feature,test_WFC_60_2m_target_feature),test_WFC_60_2m_target_feature$target)
CM_WFC_90_2m<-confusionMatrix(predict(model_WFC_90_2m_target_feature,test_WFC_90_2m_target_feature),test_WFC_90_2m_target_feature$target)
CM_WFC_fun_2m<-confusionMatrix(predict(model_WFC_fun_2m_target_feature,test_WFC_fun_2m_target_feature),test_WFC_fun_2m_target_feature$target)
CM_WFC_30_3m<-confusionMatrix(predict(model_WFC_30_3m_target_feature,test_WFC_30_3m_target_feature),test_WFC_30_3m_target_feature$target)
CM_WFC_60_3m<-confusionMatrix(predict(model_WFC_60_3m_target_feature,test_WFC_60_3m_target_feature),test_WFC_60_3m_target_feature$target)
CM_WFC_90_3m<-confusionMatrix(predict(model_WFC_90_3m_target_feature,test_WFC_90_3m_target_feature),test_WFC_90_3m_target_feature$target)
CM_WFC_fun_3m<-confusionMatrix(predict(model_WFC_fun_3m_target_feature,test_WFC_fun_3m_target_feature),test_WFC_fun_3m_target_feature$target)
a<-data.frame(acc1m=as.numeric(c(round(CM_WFC_30_1m$overall[1]*100,2),
round(CM_WFC_60_1m$overall[1]*100,2),
round(CM_WFC_90_1m$overall[1]*100,2),
round(CM_WFC_fun_1m$overall[1]*100,2))),
sensi1m=as.numeric(c(round(CM_WFC_30_1m$byClass[1]*100,2),
round(CM_WFC_60_1m$byClass[1]*100,2),
round(CM_WFC_90_1m$byClass[1]*100,2),
round(CM_WFC_fun_1m$byClass[1]*100,2))),
speci1m=as.numeric(c(round(CM_WFC_30_1m$byClass[2]*100,2),
round(CM_WFC_60_1m$byClass[2]*100,2),
round(CM_WFC_90_1m$byClass[2]*100,2),
round(CM_WFC_fun_1m$byClass[2]*100,2))),
acc2m=as.numeric(c(round(CM_WFC_30_2m$overall[1]*100,2),
round(CM_WFC_60_2m$overall[1]*100,2),
round(CM_WFC_90_2m$overall[1]*100,2),
round(CM_WFC_fun_2m$overall[1]*100,2))),
sensi2m=as.numeric(c(round(CM_WFC_30_2m$byClass[1]*100,2),
round(CM_WFC_60_2m$byClass[1]*100,2),
round(CM_WFC_90_2m$byClass[1]*100,2),
round(CM_WFC_fun_2m$byClass[1]*100,2))),
speci2m=as.numeric(c(round(CM_WFC_30_2m$byClass[2]*100,2),
round(CM_WFC_60_2m$byClass[2]*100,2),
round(CM_WFC_90_2m$byClass[2]*100,2),
round(CM_WFC_fun_2m$byClass[2]*100,2))),
acc3m=as.numeric(c(round(CM_WFC_30_3m$overall[1]*100,2),
round(CM_WFC_60_3m$overall[1]*100,2),
round(CM_WFC_90_3m$overall[1]*100,2),
round(CM_WFC_fun_3m$overall[1]*100,2))),
sensi3m=as.numeric(c(round(CM_WFC_30_3m$byClass[1]*100,2),
round(CM_WFC_60_3m$byClass[1]*100,2),
round(CM_WFC_90_3m$byClass[1]*100,2),
round(CM_WFC_fun_3m$byClass[1]*100,2))),
speci3m=as.numeric(c(round(CM_WFC_30_3m$byClass[2]*100,2),
round(CM_WFC_60_3m$byClass[2]*100,2),
round(CM_WFC_90_3m$byClass[2]*100,2),
round(CM_WFC_fun_3m$byClass[2]*100,2)))
)
rownames(a)<-c("EMA30","EMA60","EMA90","Alisado exponencial")
ConfusionWFC<-a
ConfusionWFC<-ConfusionWFC[,grep(x=names(ConfusionWFC), pattern="acc")]
kable(a, "latex") %>%
add_header_above(c(" ", "Predicción 1 mes" = 3, "Predicción 2 meses" = 3,"Predicción 3 meses"=3)) %>%
kable_styling(font_size = 10,latex_options = c("basic"))
#poner el heatmap en el markdown a modo de report useful para hacer investment
acc.heatmap<-ConfusionKO %>% rbind(ConfusionAAPL)%>% rbind(ConfusionAXP)%>% rbind(ConfusionWFC)
acc.heatmap
acc.heatmap
rownames(acc.heatmap)<-apply(expand.grid(c("EMA30","EMA60","EMA90","smooth f"), c("KO", "AAPL", "AXP", "WFC")), 1, paste, collapse=".")
acc.heatmap$comb<-rownames(acc.heatmap);rownames(acc.heatmap)<-NULL;acc.heatmap$comb<-rep(c("EMA30","EMA60","EMA90","smooth f"),4)
acc.heatmap
acc.heatmap
acc.heatmap %>%
select(comb,acc1m,acc2m,acc3m)%>%
gather("forecast.window","test.acc", 2:4) %>%
cbind(company=rep(c("KO","AAPL","AXP","WFC"),each=4),
test.acc.label=as.character(.$test.acc))
test.acc.label=as.character(.$test.acc))
acc.heatmap %>%
select(comb,acc1m,acc2m,acc3m)%>%
gather("forecast.window","test.acc", 2:4) %>%
cbind(company=rep(c("KO","AAPL","AXP","WFC"),each=4),
test.acc.label=as.character(.$test.acc))
library(ggplot2)
acc.heatmap %>%
select(comb,acc1m,acc2m,acc3m)%>%
gather("forecast.window","test.acc", 2:4) %>%
cbind(company=rep(c("KO","AAPL","AXP","WFC"),each=4),
test.acc.label=as.character(.$test.acc)) %>%
ggplot(mapping = aes(x = comb, y = forecast.window,fill = test.acc)) +
geom_tile()