Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Antoine PIGEAU
2015-Hubble-UserProfiles
Commits
1d5253c8
Commit
1d5253c8
authored
Feb 02, 2019
by
ZHOU yao
Browse files
Start to run
parent
a11a23ae
Changes
6
Hide whitespace changes
Inline
Side-by-side
source/classifierManager/oulad/main.py
View file @
1d5253c8
...
...
@@ -19,10 +19,8 @@ This file is part of Hubble-UserProfile.
@author: Antoine Pigeau
'''
from
datetime
import
datetime
from
classifierManager.oulad.scriptAdaBoost
import
ScriptAdaBoost
from
model.oulad.course
import
Course
...
...
@@ -49,9 +47,12 @@ if __name__ == "__main__":
features
=
ConstantFeature
.
FEATURES_ALL
(
accuracy
,
confusionMatrix
,
resultWeight
)
=
scriptAB
.
predictionTask
(
idCourse
,
groupNames
,
whereToCut
=
None
)
print
(
"Accuracy:"
+
str
(
accuracy
))
print
(
"Confusion Matrix:"
+
str
(
confusionMatrix
))
#scriptAB.predictionTaskForAllCoursesPeriod(groupNames)
scriptAB
.
predictionTaskForAllCoursesPeriod
(
groupNames
,
idCourse
)
#scriptABTemporal.predictionTaskForAllCoursesPeriod(groups)
#scriptABTemporalWithStacking.predictionTaskForAllCoursesPeriod(groups)
...
...
source/dataManager/oulad/dataManager.py
View file @
1d5253c8
...
...
@@ -38,7 +38,7 @@ class DataManager(DataManagerInterface):
'''
DIRECTORY_DATA
=
os
.
path
.
join
(
ProjectParameters
.
DIRECTORY_DATA
,
ProjectParameters
.
DIRECTORY_OULAD
,
'Dataraw'
)
print
(
os
.
path
.
abspath
(
'.'
))
PATH_STUDENT_VLE
=
"studentVle.csv"
PATH_STUDENT_INFO
=
"studentInfo.csv"
PATH_STUDENT_REG
=
"studentRegistration.csv"
...
...
@@ -131,7 +131,12 @@ class DataManager(DataManagerInterface):
Constant
.
COLUMN_TYPE_RESOURCE
,
Constant
.
COLUMN_DATE
,
Constant
.
COLUMN_WEIGHT
]
dateExam
=
self
.
courses
[
self
.
courses
[
'id_course'
]
==
idCourse
][
'module_presentation_length'
].
values
[
0
]
if
len
(
self
.
courses
[
self
.
courses
[
'id_course'
]
==
idCourse
][
'module_presentation_length'
])
>
0
:
dateExam
=
self
.
courses
[
self
.
courses
[
'id_course'
]
==
idCourse
][
'module_presentation_length'
].
values
[
0
]
print
(
dateExam
)
else
:
dateExam
=
0
assessment
.
loc
[
assessment
[
Constant
.
COLUMN_TYPE_RESOURCE
]
==
'Exam'
,
Constant
.
COLUMN_DATE
]
=
dateExam
course
=
pd
.
concat
([
material
,
assessment
])
...
...
source/featureManager/oulad/constant.py
View file @
1d5253c8
...
...
@@ -80,7 +80,10 @@ class Constant:
# FEATURE_MAX_AMPLITUDE = 49
FEATURES_ALL
=
[
FEATURE_ALL_MARKS
,
FEATURE_WINDOW_DURATION
]
#list(range(0,50))
FEATURES_ALL
=
[
FEATURE_WINDOW_DURATION
,
FEATURE_DURATION_BEFORE_ASSESSMENT
,
FEATURE_NBR_EVENT_BEFORE_ASSESSMENT
,
FEATURE_NBR_SESSION_BEFORE_ASSESSMENT
,
FEATURE_SUM_FIRST_WEEK
,
FEATURE_DAY_BEFORE_DEADLINE
,
FEATURE_MAX_REST_DAY
,
FEATURE_DURATION_REST
,
FEATURE_AVERAGE_REST_DAY
]
FEATURES_NAMES
=
[
'total intensity'
,
'window duration'
,
'linearity'
,
'inter median'
,
'nbr access per part'
,
'duration per part'
,
'average duration per part'
,
'all marks'
,
'duration before assessment'
,
'nbr event before assessment'
,
'nbr session before assessment'
,
...
...
source/featureManager/oulad/featureGroup.py
View file @
1d5253c8
...
...
@@ -121,6 +121,8 @@ class FeatureGroup:
data
=
self
.
group
.
getData
()
groups
=
data
.
groupby
(
ConstantModel
.
COLUMN_ID_USER
)
dataFeature
=
None
for
idUser
,
group
in
groups
:
...
...
source/featureManager/oulad/featureMultiGroup.py
View file @
1d5253c8
...
...
@@ -85,6 +85,7 @@ class FeatureMultiGroup:
- add the featureGroup
'''
featureGroup
=
FeatureGroup
(
group
)
featureGroup
.
load
(
features
)
...
...
@@ -107,7 +108,8 @@ class FeatureMultiGroup:
for
groupName
in
names
:
group
=
Group
(
course
,
groupName
,
whereToCut
=
whereToCut
,
WhereToCutUnity
=
whereToCutUnity
)
self
.
__addGroup
(
group
,
features
)
if
len
(
group
.
getData
())
>
0
:
self
.
__addGroup
(
group
,
features
)
def
getNumberOfUsers
(
self
):
...
...
source/model/course.py
View file @
1d5253c8
...
...
@@ -28,7 +28,7 @@ class Course:
'''
@
staticmethod
def
getCourseName
(
idCourse
):
def
getCourseName
(
idCourse
,
summary
=
True
):
'''
function that return a textual representation of the course
...
...
@@ -38,7 +38,7 @@ class Course:
@return: string, the name of the course
'''
r
aise
NotImplementedError
r
eturn
str
(
idCourse
)
def
__init__
(
self
,
idCourse
):
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment