-
Notifications
You must be signed in to change notification settings - Fork 14
/
output_balanced dataset.txt
371 lines (296 loc) · 10.4 KB
/
output_balanced dataset.txt
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
Reading data from CSV file...
Found (5560) malwares in csv file.
Reading dataset files...
Found (129013) files to classify.
Found (5560) malware files.
Found (123453) safe files.
Features & Labels arrays' shapes, respectively: (11118, 8) (11118,)
Features Selection based on KBest:
scores for each attribute and the 4 attributes chosen:
[ 855.957 19501.321 226.068 1721.599 2203.355 2370.475 2537.355
608.951]
[[11 7 6 11]
[11 6 5 6]
[ 4 2 2 2]
[ 1 1 1 2]
[21 1 1 1]]
Features Selection based on Recursive Features Elimination:
RFE chose the the top 4 features:
Numbers Features: 4
Selected Features: [ True True False False True True False False]
Feature Ranking: [1 1 3 4 1 1 2 5]
Features Selection based on Extra trees classifier:
Feature ranking (ordered DESC) using extra trees classifier:
1. feature 1 (0.269248)
2. feature 7 (0.131898)
3. feature 6 (0.117626)
4. feature 0 (0.114029)
5. feature 2 (0.106880)
6. feature 3 (0.105492)
7. feature 4 (0.078202)
8. feature 5 (0.076624)
Features Selection based on Random Forest classifier:
Feature ranking (ordered DESC) using random forest classifier:
1. feature 1 (0.272425)
2. feature 7 (0.148631)
3. feature 2 (0.125847)
4. feature 3 (0.114291)
5. feature 6 (0.106488)
6. feature 0 (0.103530)
7. feature 4 (0.067200)
8. feature 5 (0.061587)
Training data shape (x, y): (8894, 8) (8894,)
Testing data shape (x, y): (2224, 8) (2224,)
-------------SVM Model-------------
SVM Evaluation parameters:
Accuracy is 87.949640 (in percentage)
Confusion Matrix:
[[994 108]
[160 962]]
Recall score is 0.857398.
Precision score is 0.899065.
F1 score is 0.877737.
classification Report:
precision recall f1-score support
0 0.86 0.90 0.88 1102
1 0.90 0.86 0.88 1122
micro avg 0.88 0.88 0.88 2224
macro avg 0.88 0.88 0.88 2224
weighted avg 0.88 0.88 0.88 2224
-----------------------------------
-------------SVM, C value Model-------------
C value: 10
SVM, tuned C val Evaluation parameters:
Accuracy is 89.433453 (in percentage)
Confusion Matrix:
[[993 109]
[126 996]]
Recall score is 0.887701.
Precision score is 0.901357.
F1 score is 0.894477.
classification Report:
precision recall f1-score support
0 0.89 0.90 0.89 1102
1 0.90 0.89 0.89 1122
micro avg 0.89 0.89 0.89 2224
macro avg 0.89 0.89 0.89 2224
weighted avg 0.89 0.89 0.89 2224
-----------------------------------
-------------SVM, C value Model-------------
C value: 100
SVM, tuned C val Evaluation parameters:
Accuracy is 89.793165 (in percentage)
Confusion Matrix:
[[ 989 113]
[ 114 1008]]
Recall score is 0.898396.
Precision score is 0.899197.
F1 score is 0.898796.
classification Report:
precision recall f1-score support
0 0.90 0.90 0.90 1102
1 0.90 0.90 0.90 1122
micro avg 0.90 0.90 0.90 2224
macro avg 0.90 0.90 0.90 2224
weighted avg 0.90 0.90 0.90 2224
-----------------------------------
-------------SVM, C value Model-------------
C value: 1000
SVM, tuned C val Evaluation parameters:
Accuracy is 89.928058 (in percentage)
Confusion Matrix:
[[ 979 123]
[ 101 1021]]
Recall score is 0.909982.
Precision score is 0.892483.
F1 score is 0.901147.
classification Report:
precision recall f1-score support
0 0.91 0.89 0.90 1102
1 0.89 0.91 0.90 1122
micro avg 0.90 0.90 0.90 2224
macro avg 0.90 0.90 0.90 2224
weighted avg 0.90 0.90 0.90 2224
-----------------------------------
-------------GS, SVC Model-------------
GS based on SVC model Evaluation parameters:
Accuracy is 89.433453 (in percentage)
Confusion Matrix:
[[993 109]
[126 996]]
Recall score is 0.887701.
Precision score is 0.901357.
F1 score is 0.894477.
classification Report:
precision recall f1-score support
0 0.89 0.90 0.89 1102
1 0.90 0.89 0.89 1122
micro avg 0.89 0.89 0.89 2224
macro avg 0.89 0.89 0.89 2224
weighted avg 0.89 0.89 0.89 2224
-----------------------------------
-------------RF Model-------------
RF Evaluation parameters:
Accuracy is 94.244604 (in percentage)
Confusion Matrix:
[[1030 72]
[ 56 1066]]
Recall score is 0.950089.
Precision score is 0.936731.
F1 score is 0.943363.
classification Report:
precision recall f1-score support
0 0.95 0.93 0.94 1102
1 0.94 0.95 0.94 1122
micro avg 0.94 0.94 0.94 2224
macro avg 0.94 0.94 0.94 2224
weighted avg 0.94 0.94 0.94 2224
-----------------------------------
0.64 Time to finish with default nJobs
-------------RF Model with nJobs-------------
N_Jobs: 10
RF Evaluation parameters:
Accuracy is 94.334532 (in percentage)
Confusion Matrix:
[[1031 71]
[ 55 1067]]
Recall score is 0.950980.
Precision score is 0.937610.
F1 score is 0.944248.
classification Report:
precision recall f1-score support
0 0.95 0.94 0.94 1102
1 0.94 0.95 0.94 1122
micro avg 0.94 0.94 0.94 2224
macro avg 0.94 0.94 0.94 2224
weighted avg 0.94 0.94 0.94 2224
-----------------------------------
0.37 Time to finish with 10 nJobs
-------------RF Model with nJobs-------------
N_Jobs: 10
N_Estimators: 1000
RF Evaluation parameters:
Accuracy is 94.514388 (in percentage)
Confusion Matrix:
[[1033 69]
[ 53 1069]]
Recall score is 0.952763.
Precision score is 0.939367.
F1 score is 0.946018.
classification Report:
precision recall f1-score support
0 0.95 0.94 0.94 1102
1 0.94 0.95 0.95 1122
micro avg 0.95 0.95 0.95 2224
macro avg 0.95 0.95 0.95 2224
weighted avg 0.95 0.95 0.95 2224
-----------------------------------
2.52 Time to finish with 10 nJobs and 1000 nEstimators
-------------GS, RF Model-------------
GS based on RF model Evaluation parameters:
Accuracy is 90.287770 (in percentage)
Confusion Matrix:
[[ 997 105]
[ 111 1011]]
Recall score is 0.901070.
Precision score is 0.905914.
F1 score is 0.903485.
classification Report:
precision recall f1-score support
0 0.90 0.90 0.90 1102
1 0.91 0.90 0.90 1122
micro avg 0.90 0.90 0.90 2224
macro avg 0.90 0.90 0.90 2224
weighted avg 0.90 0.90 0.90 2224
-----------------------------------
-------------Extra Trees Model-------------
ET Evaluation parameters:
Accuracy is 94.739209 (in percentage)
Confusion Matrix:
[[1043 59]
[ 58 1064]]
Recall score is 0.948307.
Precision score is 0.947462.
F1 score is 0.947884.
classification Report:
precision recall f1-score support
0 0.95 0.95 0.95 1102
1 0.95 0.95 0.95 1122
micro avg 0.95 0.95 0.95 2224
macro avg 0.95 0.95 0.95 2224
weighted avg 0.95 0.95 0.95 2224
-----------------------------------
0.57 Time to finish ET with 100 nEstimators
-------------Extra Trees Model-------------
Number of estimators: 500
ET Evaluation parameters:
Accuracy is 94.829137 (in percentage)
Confusion Matrix:
[[1044 58]
[ 57 1065]]
Recall score is 0.949198.
Precision score is 0.948353.
F1 score is 0.948775.
classification Report:
precision recall f1-score support
0 0.95 0.95 0.95 1102
1 0.95 0.95 0.95 1122
micro avg 0.95 0.95 0.95 2224
macro avg 0.95 0.95 0.95 2224
weighted avg 0.95 0.95 0.95 2224
-----------------------------------
2.86 Time to finish ET with 500 nEstimators
-------------Extra Trees Model-------------
Number of estimators: 1000
ET Evaluation parameters:
Accuracy is 94.874101 (in percentage)
Confusion Matrix:
[[1043 59]
[ 55 1067]]
Recall score is 0.950980.
Precision score is 0.947602.
F1 score is 0.949288.
classification Report:
precision recall f1-score support
0 0.95 0.95 0.95 1102
1 0.95 0.95 0.95 1122
micro avg 0.95 0.95 0.95 2224
macro avg 0.95 0.95 0.95 2224
weighted avg 0.95 0.95 0.95 2224
-----------------------------------
6.02 Time to finish ET with 1000 nEstimators
-------------RFE Model-------------
Accuracy is 77.113309 (in percentage)
Confusion Matrix:
[[929 173]
[336 786]]
Recall score is 0.700535.
Precision score is 0.819604.
F1 score is 0.755406.
classification Report:
precision recall f1-score support
0 0.73 0.84 0.78 1102
1 0.82 0.70 0.76 1122
micro avg 0.77 0.77 0.77 2224
macro avg 0.78 0.77 0.77 2224
weighted avg 0.78 0.77 0.77 2224
-----------------------------------
-------------NB Model-------------
NB Evaluation parameters:
Accuracy is 54.946043 (in percentage)
Confusion Matrix:
[[ 174 928]
[ 74 1048]]
Recall score is 0.934046.
Precision score is 0.530364.
F1 score is 0.676566.
classification Report:
precision recall f1-score support
0 0.70 0.16 0.26 1102
1 0.53 0.93 0.68 1122
micro avg 0.55 0.55 0.55 2224
macro avg 0.62 0.55 0.47 2224
weighted avg 0.62 0.55 0.47 2224
-----------------------------------
Code took approximately 21 mins to be compiled and executed....
-----------------------------------