Skip to content

Commit 4700517

Browse files
committed
Added comments and notes.
1 parent cc41de1 commit 4700517

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# MP16_17
22
Classification of network traffic types
3+
4+
## TODO
5+
Gather more data
6+
Add features
7+
Countermeasures
8+
"Future Work"

Single_label/CV_hyperparameters.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def log(s):
2424
print '[INFO] ' + s
2525

2626

27+
# Example usage: python2 CV_hyerparameters.py tor burst LR
2728
if __name__ == "__main__":
28-
mode = sys.argv[1]
29+
mode = sys.argv[1] # Type of data to test
2930
FEATURE = sys.argv[2] # use burst features or size_IAT ('size_IAT', 'burst' or 'both')
3031
METHOD = sys.argv[3] # options: 'NB' : Naive Bayes, 'RF' : random forest, 'MLP' : , 'LR': logistic regression
3132
all_traces = load_pickled_traces(mode)
@@ -78,18 +79,11 @@ def log(s):
7879
fold +=1
7980

8081
N = float(len(results))
82+
# For each parameter value, take the average output from each fold
8183
averaged = { k : sum(t[k] for t in results)/N for k in results[0] }
8284

8385
best = max(averaged, key=averaged.get)
8486

8587
for idx, val in enumerate(results):
8688
print 'fold: ' + str(idx+1) +'; score: ' + str(val[best])
8789
print 'Best parameter setting: ' + best + '; with average score: ' + str(averaged[best])
88-
89-
90-
91-
92-
93-
94-
95-

notes.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Results with existing samples are better than reported in paper.
2+
* Somewhere between 1-7%
3+
* Program seems deterministic, so unlikely due to RNG
4+
* Does vary slightly (~1-2%) by computer. Maybe be attributable to floating point error or library compilations.
5+
* Possible newer versions of libraries are optimized to perform better
6+
In the paper some of the numbers don't quite add up
7+
* The confusion matrix has columns with sum to greater than 1.
8+
* Possibly just types/copypasta

0 commit comments

Comments
 (0)