Commit 026dce3d authored by Antoine PIGEAU's avatar Antoine PIGEAU
Browse files

improve courseName retrieval

parent 25f4eb25
......@@ -29,11 +29,11 @@ class ProcessMiningUtility:
# Paths
# csv directory
DIR_NAME = "D:/git/2015-Hubble-UserProfiles/2015-Hubble-UserProfile/CSV-Session/ScriptOutput/"
#DIR_NAME = "D:/Programmation/GitLab/2015-Hubble/2015-Hubble-UserProfile/ExperimentProcessMining/"
#DIR_NAME = "D:/git/2015-Hubble-UserProfiles/2015-Hubble-UserProfile/CSV-Session/ScriptOutput/"
DIR_NAME = "D:/Programmation/GitLab/2015-Hubble/2015-Hubble-UserProfile/ExperimentProcessMining/"
JAVA_PROJECT = "D:/git/ProcessMiningLibrary/"
#JAVA_PROJECT = "D:/Programmation/GitLab/ProcessMiningLibrary/ProcessMiningLibrary/"
#JAVA_PROJECT = "D:/git/ProcessMiningLibrary/"
JAVA_PROJECT = "D:/Programmation/GitLab/ProcessMiningLibrary/ProcessMiningLibrary/"
#java lib and bin
......
......@@ -23,12 +23,13 @@ import sys
from datetime import datetime
import numpy as np
from sklearn import cross_validation
from sequenceManager.sequenceSession import SequenceSession
from sequenceManager.sequenceInterface import SequenceInterface
from dataManager.course import Course
from heuristicMiner import HeuristicMiner
from conformanceChecking import ConformanceChecking
import operator
sys.setrecursionlimit(10000)
......@@ -56,38 +57,21 @@ class ScriptConformance:
@param log: Name of the course which you want to apply the test
@return: The score matrix and text file that contain it
'''
def testLog(self,courseID):
def testLog(self,idCourse):
startTime = datetime.now()
#Name correctly the output files
if courseID == Course.COURSE_ID_ARDUINO :
course = "Arduino"
elif courseID == Course.COURSE_ID_JAVA_SCRIPT:
course = "JavaScript"
elif courseID == Course.COURSE_ID_TWITTER:
course ="Twitter"
elif courseID == Course.COURSE_ID_WEB:
course = "Web"
elif courseID == Course.COURSE_ID_RUBY:
course = "Rubys"
elif courseID == Course.COURSE_ID_IONIC:
course = "Inoic"
elif courseID== Course.COURSE_ID_GESTION_PROJET:
course = "Gestion Projet"
elif courseID== Course.COURSE_ID_BOOTSTRAP :
course = "Bootstrap"
else :
return "courseId invalide"
print("script"+course)
courseName = Course.getCourseName(idCourse, summary=True)
print("script"+courseName)
sequenceSession = SequenceSession()
#Cross Validation - We charge and split courses for each group
(idCourse,sequencesSuccess) = sequenceSession.getSequences(courseID, SequenceInterface.GROUP_SUCCEED_ALL_USERS)
(idCourse,sequencesFailed) = sequenceSession.getSequences(courseID, SequenceInterface.GROUP_FULL_VIEWER_FAILED)
(idCourse,sequencesDropout) = sequenceSession.getSequences(courseID, SequenceInterface.GROUP_INCOMPLETE_VIEWER_DROPOUT)
(_,sequencesSuccess) = sequenceSession.getSequences(idCourse, SequenceInterface.GROUP_SUCCEED_ALL_USERS)
(_,sequencesFailed) = sequenceSession.getSequences(idCourse, SequenceInterface.GROUP_FULL_VIEWER_FAILED)
(_,sequencesDropout) = sequenceSession.getSequences(idCourse, SequenceInterface.GROUP_INCOMPLETE_VIEWER_DROPOUT)
sequencesSucceedTrain, sequencesSucceedTest = cross_validation.train_test_split(sequencesSuccess, test_size=0.2)
sequencesFailedTrain, sequencesFailedTest = cross_validation.train_test_split(sequencesFailed, test_size=0.2)
......@@ -150,7 +134,7 @@ class ScriptConformance:
#Test Export
#Write all datas in a text file
dest = open(course+"result.txt", "w")
dest = open(courseName+"result.txt", "w")
stopTime = datetime.now()
dest.write(str(succeedSucceed))
dest.write("\n")
......
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