def bucketed_sccs(g, stamp=''): sccs = graphtools.get_sccs_from_graph(g) buckets = _count_size_of_property(sccs)
largest_scc = [] for start, end in slices: g = cv_from_btc(start * _HMS, end * _HMS) if len(g) == 0: continue stamp = str(start) + '_' + str(end) tags_over_time.user_transaction_frequency(g, 'model_' + stamp) tags_over_time.user_buy_frequency(g, 'model_' + stamp) tags_over_time.user_sell_frequency(g, 'model_' + stamp) undir_g = nx.Graph(g.copy()) avg_clust.append(nx.average_clustering(undir_g)) lccs.append(len(graphtools.get_lcc_from_graph(g))) largest_scc.append(len(graphtools.get_sccs_from_graph(g)[0])) dates.append(start) # hack for now to save time... print 'finished %s tag over time' % i i += 1 utils.save_lists(dates, avg_clust, stamp='model_avg_clust') utils.save_lists(dates, lccs, stamp='model_lccs') utils.save_lists(dates, largest_scc, stamp='model_largest_scc') ''' _HMS = graphgen._HMS slices = graphgen.generate_weighted_time_slices()