Skip to content
Snippets Groups Projects
Commit af34a436 authored by vvye's avatar vvye
Browse files

Remove date uniformity plotting

parent 12028201
No related branches found
No related tags found
No related merge requests found
......@@ -68,12 +68,6 @@ def rank_dates_by_wilson(articles, start_date, end_date, num_dates):
best_uniformity = uniformity
best_ranked_dates = ranked_dates
plot_dates(plt, best_ranked_dates[:num_dates])
pagerank_scores = g.pagerank(directed=True, weights=g.es['weight'])
ranked_dates = util.rank(vertex_names, scores=pagerank_scores)
plot_dates(plt, ranked_dates[:num_dates])
plt.show()
return best_ranked_dates
......@@ -81,13 +75,3 @@ def date_uniformity(dates):
dates.sort()
date_diffs = [util.days_between(dates[i], dates[i + 1]) for i in range(len(dates) - 1)]
return np.std(date_diffs)
def plot_dates(plt, dates):
xs = [0.01 * x for x in range(100)]
ys = [len([date for date in dates if frac(date, dates) <= x]) / len(dates) for x in xs]
plt.plot(xs, ys)
def frac(date, dates):
return util.days_between(date, min(dates)) / util.days_between(max(dates), min(dates))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment