Example #1
0
    exellentPractice.append(extract[0])
    weakPractice.append(extract[1])

# excellentList = exellentPractice[w]
# weakList = weakPractice[w]
# excellentList = labsheetActiveWeeks[w]
# weakList = labsheetLessActiveWeeks[w]

ex1_excellent = graphLearning.mapNewLabel(ex1_excellent, reLabelIndex)
ex1_weak = graphLearning.mapNewLabel(ex1_weak, reLabelIndex)
ex2_excellent = graphLearning.mapNewLabel(ex2_excellent, reLabelIndex)
ex2_weak = graphLearning.mapNewLabel(ex2_weak, reLabelIndex)

excellentList = ex2_excellent.index
weakList = ex2_weak.index
graphLearning.visualiseMSTGraph(graph_all_weeks[11], excellentList, weakList,
                                reLabelIndex)

#----------------------------------------------
#Node embedding analysis
#----------------------------------------------

node_embeddings_weeks = []
for w in range(0, 12):
    print('Week ' + str(w) + '...')
    node2vec = Node2Vec(graph_all_weeks[w].graph,
                        dimensions=64,
                        walk_length=8,
                        num_walks=15,
                        p=0.1,
                        q=1)
    model = node2vec.fit(window=8, min_count=1)
Example #2
0
    ~ca1162019_transitionDataMatrixWeeks[w].index.isin(ex3_excellent_2019.index
                                                       )].index
student2020_excellent = ca1162020_transitionDataMatrixWeeks[w].loc[
    ca1162020_transitionDataMatrixWeeks[w].index.isin(
        ex3_excellent_2020.index)].index
student2020_weak = ca1162020_transitionDataMatrixWeeks[w].loc[
    ~ca1162020_transitionDataMatrixWeeks[w].index.isin(ex3_excellent_2020.index
                                                       )].index

studentCohort = {
    "2018 2019 excellent": student2018_excellent.union(student2019_excellent),
    "2018 2019 weak": student2018_weak.union(student2019_weak),
    "2020 excellent": student2020_excellent,
    "2020 weak": student2020_weak
}
graphLearning.visualiseMSTGraph(graph_all_weeks[w], studentCohort,
                                reLabelIndex)

import matplotlib.cm as cm

G = graph_all_weeks[9].graph
node_color = []
nodelist = []
nodelist = []

for n in G.nodes:
    nodelist.append(n)
    if n in student2018_excellent.union(student2018_weak):
        node_color.append('blue')
    elif n in student2019_excellent.union(student2019_weak):
        node_color.append('red')
    elif n in student2020_excellent.union(student2020_weak):