Commit 6aa6b10c authored by Antoine PIGEAU's avatar Antoine PIGEAU
Browse files

update test

parent 7d1b265c
......@@ -512,24 +512,24 @@ class ScriptClassifier:
exportLatex.exportResultAccuracy(fileNameResultAccuracy, dictResult, self.classifier.getCourses())
exportLatex.exportResultAUC(fileNameResultAUC, dictResult, self.classifier.getCourses())
def exportLastResult(self, experimentDirectory):
fileNameSavedResult = os.path.join(experimentDirectory, "launchTestForAllCoursesAlgoPeriod.p")
with open(fileNameSavedResult, "rb") as fileResult:
(dictResult, features, sessionCut, unity, groups) = pickle.load(fileResult)
fileNameExport = os.path.join(experimentDirectory, ScriptClassifier.NAME_FILE_RESULT+"-"+str(sessionCut)+".txt")
exportLatex.exportResultAccuracy(fileNameExport, dictResult, experimentDirectory)
def loadLastResult(self, experimentDirectory):
fileNameSavedResult = os.path.join(experimentDirectory, "launchTestForAllCoursesAlgoPeriod.p")
with open(fileNameSavedResult, "rb") as fileResult:
(dictResult, features, sessionCut, groups) = pickle.load(fileResult)
return (dictResult, features, sessionCut, groups)
# def exportLastResult(self, experimentDirectory):
#
# fileNameSavedResult = os.path.join(experimentDirectory, "launchTestForAllCoursesAlgoPeriod.p")
#
# with open(fileNameSavedResult, "rb") as fileResult:
# (dictResult, features, whereToCut, whereToCutUnity, groups) = cloudpickle.load(fileResult)
#
# fileNameExport = os.path.join(experimentDirectory, ScriptClassifier.NAME_FILE_RESULT+"-"+str(whereToCut)+".txt")
# exportLatex.exportResultAccuracy(fileNameExport, dictResult, experimentDirectory)
#
# def loadLastResult(self, experimentDirectory):
#
# fileNameSavedResult = os.path.join(experimentDirectory, "launchTestForAllCoursesAlgoPeriod.p")
#
# with open(fileNameSavedResult, "rb") as fileResult:
# (dictResult, features, sessionCut, groups) = cloudpickle.load(fileResult)
#
# return (dictResult, features, sessionCut, groups)
def predictionForMergedCourse(self, mergedCourse, whereToCut, ntime=10):
......@@ -667,7 +667,7 @@ class ScriptClassifier:
print("groups : " + str(groups) + "\n")
with open(fileNameSavedResult, "wb") as fileResult:
pickle.dump((dictResult,
cloudpickle.dump((dictResult,
self.classifier.getFeatures(),
self.classifier.getWhereToCuts,
self.classifier.getWhereToCutUnity(),
......@@ -806,7 +806,7 @@ class ScriptClassifier:
if os.path.exists(fileNameSavedResult):
with open(fileNameSavedResult, "rb") as fileResult:
(featureBase, scores) = pickle.load(fileResult)
(featureBase, scores) = cloudpickle.load(fileResult)
else:
while len(featureBase) < len(features) :
......@@ -855,7 +855,7 @@ class ScriptClassifier:
print(("scores: "+str(scores)))
with open(fileNameSavedResult, "wb") as fileResult:
pickle.dump((featureBase, scores), fileResult)
cloudpickle.dump((featureBase, scores), fileResult)
print(("Ordered Feature:"+str(featureBase)))
......
......@@ -109,7 +109,7 @@ if __name__ == "__main__":
''' for all periods '''
classifier.predictionTaskForAllPeriods(ntime=10, cache=True)
classifier.predictionTaskForAllPeriods(ntime=10, cache=False)
''' NN : all courses with hidden layers'''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment