Skip to content

Commit

Permalink
Replacing joblib library.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Lotfy authored and wisepythagoras committed Jan 21, 2021
1 parent 439ddf1 commit 4cefa1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ torsocks curl -L http://httpbin.org/ip
## Required Python 3 Modules

``` bash
pip install sklearn dpkt
pip install sklearn dpkt joblib
```

## Data Collection
Expand Down
4 changes: 2 additions & 2 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import json
import utils
from sklearn.externals import joblib
from joblib import load


if len(sys.argv) == 1:
Expand Down Expand Up @@ -46,7 +46,7 @@
print("Loading the classifier...")

# Try to read the classifier.
classifier = joblib.load("./classifier-nb.dmp")
classifier = load("./classifier-nb.dmp")
i = 0
right = 0
wrong = 0
Expand Down
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sklearn.naive_bayes import GaussianNB, BernoulliNB, MultinomialNB
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score
from sklearn.externals import joblib
from joblib import dump


def empty_csv():
Expand Down Expand Up @@ -177,7 +177,7 @@ def train(streams, labels):
clf = clf.fit(training_x, training_y)

# Save a snapshot of this classifier.
joblib.dump(clf, "./classifier-nb.dmp", compress=9)
dump(clf, "./classifier-nb.dmp", compress=9)

# Get the prediction.
predictions = clf.predict(testing_x)
Expand Down

0 comments on commit 4cefa1f

Please sign in to comment.