Commit 18329d4a1d4b65bf847c70ca7983ef6cfa6a650f

Authored by Cristina Muntean
1 parent 36a797c0

test

Showing 1 changed file with 25 additions and 25 deletions   Show diff stats
prepare_plot_scatter_2_distrib.py
... ... @@ -95,30 +95,30 @@ if __name__ == '__main__':
95 95 print len(a), len(b)
96 96 print "Maxes: ", a_max, b_max
97 97  
98   - # make b a default dict as we search for elements from a
99   - bDict = {rows[0]: int(rows[1]) for rows in b}
100   - bDict = defaultdict(int, bDict)
101   -
102   - # initialize the lists of elements selected
103   - X = list()
104   - Y = list()
105   -
106   - # populate the lists with the subset of k values
107   - # now we normalize
108   - local_topics = []
109   - for word, counter in a[:k]:
110   - X.append(int(counter)/a_max)
111   - Y.append(int(bDict[word])/b_max)
112   - if int(bDict[word]) < 0.25 * float(counter):
113   - local_topics.append(word)
114   - labels = [row[0] for row in a[:k]]
115   -
116   - print local_topics
117   - print len(X), len(Y), len(labels)
118   -
119   - # write files for plots
120   - for (x,y,label) in zip(X,Y,labels):
121   - dataFile.write("{}\t{}\t{}\n".format(str(x),str(y),label))
122   - dataFile.close()
  98 + # # make b a default dict as we search for elements from a
  99 + # bDict = {rows[0]: int(rows[1]) for rows in b}
  100 + # bDict = defaultdict(int, bDict)
  101 + #
  102 + # # initialize the lists of elements selected
  103 + # X = list()
  104 + # Y = list()
  105 + #
  106 + # # populate the lists with the subset of k values
  107 + # # now we normalize
  108 + # local_topics = []
  109 + # for word, counter in a[:k]:
  110 + # X.append(int(counter)/a_max)
  111 + # Y.append(int(bDict[word])/b_max)
  112 + # if int(bDict[word]) < 0.25 * float(counter):
  113 + # local_topics.append(word)
  114 + # labels = [row[0] for row in a[:k]]
  115 + #
  116 + # print local_topics
  117 + # print len(X), len(Y), len(labels)
  118 + #
  119 + # # write files for plots
  120 + # for (x,y,label) in zip(X,Y,labels):
  121 + # dataFile.write("{}\t{}\t{}\n".format(str(x),str(y),label))
  122 + # dataFile.close()
123 123  
124 124  
... ...