-
Notifications
You must be signed in to change notification settings - Fork 1
/
save_models.py
31 lines (24 loc) · 894 Bytes
/
save_models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# coding: utf-8
# Imports
import joblib as joblib
# Call function saveBoVF
def saveBoVF(kmeans,
descriptor_name,
dataset_name):
joblib.dump(value = kmeans,
filename = 'Saves/Datasets/%s/BoVF-Features/%s-BoVF-K-Means.pkl' % (dataset_name, descriptor_name))
# Call function saveDescriptors
def saveDescriptors(feature_vector,
descriptor_name,
dataset_name,
flag):
joblib.dump(value = feature_vector,
filename = 'Saves/Datasets/%s/Descriptors/%s-%s-desc.pkl' % (dataset_name, descriptor_name, flag))
# Call function saveSVM
def saveSVM(model,
descriptor_name,
dataset_name,
model_name):
joblib.dump(value = model,
filename = 'Saves/Datasets/%s/SVM-Models/%s-%s.pkl' % (dataset_name, descriptor_name, model_name))