예제 #1
0
                            & (assessment1A['perCorrect1A'] < 0.6)]

ex2_excellent = assessment2A.loc[(assessment2A['perCorrect2A'] <= 1)
                                 & (assessment2A['perCorrect2A'] >= 0.5)]
ex2_weak = assessment2A.loc[(assessment2A['perCorrect2A'] >= 0)
                            & (assessment2A['perCorrect2A'] < 0.5)]

nonExUpload = dataUpload.drop(
    dataUpload.loc[dataUpload['task'].str.match('ex')].index)
nonExUploadByWeek = [
    g for n, g in nonExUpload.groupby(pd.Grouper(key='date', freq='W'))
]

nonExUpload['version'].unique()
#merge exam result with transition data matrix:
reLabelIndex = dataProcessing.reLabelStudentId(assessment.index)

#practice results
workingWeekExcercise = []
cummulativeExerciseWeeks = []
for week in range(0, 12):

    workingWeekExcercise.append(nonExUploadByWeek[week])
    practiceResult = pd.concat(workingWeekExcercise)  #nonExUploadByWeek[week]

    #adjust number of correct: For each task, number of correct submission/number of submission for that task
    practiceResultSum = practiceResult.groupby(
        [pd.Grouper(key='user'),
         pd.Grouper(key='task')]).sum()
    practiceResultSum['correct_adjusted'] = practiceResultSum[
        'correct'] / practiceResult.groupby(
예제 #2
0
listIndex = []
for w in range(0, 10):
    # ca1162018_transitionDataMatrixWeeks[w]['covid'] = 0
    # ca1162019_transitionDataMatrixWeeks[w]['covid'] = 0
    # ca1162020_transitionDataMatrixWeeks[w]['covid'] = 1
    transitionDataMatrixWeeks.append(
        pd.concat([
            ca1162018_transitionDataMatrixWeeks[w],
            ca1162019_transitionDataMatrixWeeks[w],
            ca1162020_transitionDataMatrixWeeks[w]
        ],
                  join='inner'))
    listIndex = listIndex + list(transitionDataMatrixWeeks[w].index)

listIndex = list(set(listIndex))
reLabelIndex = dataProcessing.reLabelStudentId(listIndex)
for w in range(0, 10):
    ca1162018_transitionDataMatrixWeeks[w] = graphLearning.mapNewLabel(
        ca1162018_transitionDataMatrixWeeks[w], reLabelIndex)
    ca1162019_transitionDataMatrixWeeks[w] = graphLearning.mapNewLabel(
        ca1162019_transitionDataMatrixWeeks[w], reLabelIndex)
    ca1162020_transitionDataMatrixWeeks[w] = graphLearning.mapNewLabel(
        ca1162020_transitionDataMatrixWeeks[w], reLabelIndex)
    transitionDataMatrixWeeks[w] = graphLearning.mapNewLabel(
        transitionDataMatrixWeeks[w], reLabelIndex)

transitionDataMatrixWeeks_directFollow_standardised = []
for w in range(0, 10):
    transitionDataMatrixWeeks_directFollow_standardised.append(
        dataProcessing.normaliseData(transitionDataMatrixWeeks[w].T))