-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvaluate.py
More file actions
26 lines (18 loc) · 753 Bytes
/
Copy pathEvaluate.py
File metadata and controls
26 lines (18 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pickle
from Config import *
featuresDict = {}
print "Loading the features..."
pickledFeaturesFileHandle = open(pickledFeaturesFileName, 'rb')
featuresDict = pickle.load(pickledFeaturesFileHandle)
print "Loading the model..."
pickledModelFileName = open(pickledModelFileName, 'rb')
svcModelLoaded = pickle.load(pickledModelFileName)
svcModel = svcModelLoaded['model']
print "Evaluating on developement set..."
predictedClasses = svcModel.predict(featuresDict["developmentFeatures"])
hits=0.00
for i in range(0,len(predictedClasses)):
if predictedClasses[i]==featuresDict["developmentClasses"][i]:
hits = hits+1
print "Number of hits = ",hits
print "The accuracy is ",((hits/len(featuresDict["developmentClasses"]))*100.0)," %"