Skip to content

Commit 68a9c38

Browse files
committed
fix bugs
1 parent 2e1966a commit 68a9c38

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,17 @@ def evaluation(self):
120120
@staticmethod
121121
def calculate_accuray(grand_truth, predictions):
122122
true_positives = 0
123-
false_positives = 0
123+
true_negatives = 0
124124

125125
for true, pred in zip(grand_truth, predictions):
126126
if (pred > 0.5) and (true == 1):
127127
true_positives += 1
128128
elif (pred < 0.5) and (true == 0):
129-
false_positives += 1
129+
true_negatives += 1
130130
else:
131131
pass
132132

133-
return (true_positives+false_positives) / len(grand_truth)
133+
return (true_positives+true_negatives) / len(grand_truth)
134134

135135
if __name__ == "__main__":
136136

src/fortest.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class Preprocessing:
1212

1313
def __init__(self, args):
14-
self.data = 'data/tweets.csv'
14+
self.data = '../data/tweets.csv'
1515
self.max_len = args.max_len
1616
self.max_words = args.max_words
1717
self.test_size = args.test_size

0 commit comments

Comments
 (0)