Skip to content

Commit 3df5bb6

Browse files
authored
fix bug (#100)
1 parent bac93bd commit 3df5bb6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sqlflow_models/one_class_svm.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
import tensorflow as tf
1919
from sklearn.svm import OneClassSVM as SklearnOneClassSVM
2020

21-
MODEL_PATH = "one_class_svm_model"
21+
MODEL_DIR = "model_save"
22+
MODEL_PATH = MODEL_DIR + "/one_class_svm_model"
2223

2324
ENABLE_EAGER_EXECUTION = False
2425

@@ -92,6 +93,10 @@ def sqlflow_train_loop(self, dataset):
9293
X = np.concatenate(X)
9394

9495
self.svm.fit(X)
96+
97+
if not os.path.exists(MODEL_DIR):
98+
os.mkdir(MODEL_DIR)
99+
95100
with open(MODEL_PATH, "wb") as f:
96101
pickle.dump(self.svm, f, protocol=2)
97102

0 commit comments

Comments
 (0)