From fa63cb9e065afd0da3210187cf3976a3c63fb870 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Sun, 7 Apr 2019 00:03:50 +0200 Subject: [PATCH] pls --- server/nightr/strategies/svm_strat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/nightr/strategies/svm_strat.py b/server/nightr/strategies/svm_strat.py index 81d1569..90fa84f 100644 --- a/server/nightr/strategies/svm_strat.py +++ b/server/nightr/strategies/svm_strat.py @@ -1,3 +1,5 @@ +from pathlib import Path + from sklearn import svm from sklearn.externals import joblib import requests @@ -36,7 +38,7 @@ def train(): joblib.dump(classifier, "nightness_classifier.pkl") def predict(X): - classifier = joblib.load("nightness_classifier.pkl") + classifier = joblib.load(str(Path(__file__).parent.joinpath("nightness_classifier.pkl"))) prob = classifier.predict_proba(np.array(X).reshape(1, -1)) return prob[0, 1]