Exemple #1
0
                      cmap=cmap, node_color= )
nx.draw_networkx_edges(G, pos, alpha=0.5)
plt.show()

#community detection
communityListWeeks = []
for w in range(0,10):
    print('Week ' + str(w) + '...')      
    num_comms = len(graph_all_weeks[w].graph._node)
    communityListWeeks.append(graphLearning.community_dection_graph(graph_all_weeks[w], num_comms=num_comms))
    
import graphLearning
import scikit_posthocs as sp
pd.set_option("display.max_rows", None, "display.max_columns", None)
aw10 = graphLearning.extractAssessmentResultOfCommunities(communityListWeeks[9], assessment3A, 'perCorrect3A')
aw10t = sp.posthoc_conover(aw10[3][5])

goodCommunity = aw10[3][5][0]
badCommunity = aw10[3][5][1]
w = 9

for w in range(0,10):
    activityDataMatrixWeeks_pageTypeWeek[w] = graphLearning.mapNewLabel(activityDataMatrixWeeks_pageTypeWeek[w] , reLabelIndex)

extractGoodBadCommunity = activityDataMatrixWeeks_pageTypeWeek[w].loc[activityDataMatrixWeeks_pageTypeWeek[w].index.astype(int).isin(goodCommunity.index) | activityDataMatrixWeeks_pageTypeWeek[w].index.astype(int).isin(badCommunity.index)]
extractGoodBadCommunity['group'] = 0
extractGoodBadCommunity.loc[extractGoodBadCommunity.index.astype(int).isin(goodCommunity.index),['group']] = 0
extractGoodBadCommunity.loc[extractGoodBadCommunity.index.astype(int).isin(badCommunity.index),['group']] = 1

columnListStatsSig = []
for c in extractGoodBadCommunity.columns:
Exemple #2
0
                                              num_comms=num_comms))

communityListWeeks_cleaned_correlation = []
for w in range(0, 12):
    print('Week ' + str(w) + '...')
    num_comms = len(graph_all_weeks_cleaned_correlation[w].graph._node)
    communityListWeeks_cleaned_correlation.append(
        graphLearning.community_dection_graph(
            graph_all_weeks_cleaned_correlation[w], num_comms=num_comms))

import graphLearning
import scikit_posthocs as sp
pd.set_option("display.max_rows", None, "display.max_columns", None)
aw10 = graphLearning.extractAssessmentResultOfCommunities(
    communityListWeeks_cleaned_correlation[11], assessment2A, 'perCorrect2A')
aw10t = sp.posthoc_conover(aw10[1][5])

aw6 = graphLearning.extractAssessmentResultOfCommunities(
    communityListWeeks[6], assessment1A, 'perCorrect1A')
aw6t = sp.posthoc_conover(aw6[3][5])

a = graphLearning.findTogetherMembers(aw10[18][5], aw11[18][5], aw10[18][1],
                                      aw11[18][1])
len(set(assessment2A.index).intersection(set(assessment3A.index)))

a = graphLearning.findTogetherMembers(aw7[18][5], aw11[18][5], aw7[18][1],
                                      aw11[18][1])
for i in range(0, 8):
    for j in range(0, 8):
        if len(a[i][j]) > 1:
            print(a[i][j])
Exemple #3
0
    print('Week ' + str(w) + '...')      
    num_comms = len(graph_all_weeks[w].graph._node)
    communityListWeeks.append(graphLearning.community_dection_graph(graph_all_weeks[w], most_valuable_edge=graphLearning.most_central_edge, num_comms=num_comms))

communityListWeeks_not_cleaned = []
for w in range(0,12):
    print('Week ' + str(w) + '...')      
    num_comms = len(graph_all_weeks_not_cleaned[w].graph._node)
    communityListWeeks_not_cleaned.append(graphLearning.community_dection_graph(graph_all_weeks_not_cleaned[w], most_valuable_edge=graphLearning.most_central_edge, num_comms=num_comms))


import graphLearning
import scikit_posthocs as sp
pd.set_option("display.max_rows", None, "display.max_columns", None)
aw10 = graphLearning.extractAssessmentResultOfCommunities(communityListWeeks[10], assessment2A, 'perCorrect2A')
aw10t = sp.posthoc_conover(aw10[0][5])


aw6 = graphLearning.extractAssessmentResultOfCommunities(communityListWeeks[6], assessment1A, 'perCorrect1A')
aw6t = sp.posthoc_conover(aw7[3][5])

a = graphLearning.findTogetherMembers(aw10[18][5],aw11[18][5], aw10[18][1],aw11[18][1])
len(set(assessment2A.index).intersection(set(assessment3A.index)))

a = graphLearning.findTogetherMembers(aw7[18][5],aw11[18][5], aw7[18][1],aw11[18][1])
for i in range(0,8):
    for j in range(0,8):
        if len(a[i][j]) > 1:
            print(a[i][j])