From 1c2bfd7c41711b94fe549b3379552d31b0ac5180 Mon Sep 17 00:00:00 2001 From: Deepthi Pathare Date: Tue, 18 May 2021 19:05:32 +0200 Subject: [PATCH] Corrected years --- german_analysis.py | 6 ++---- voting_lib/political_compass.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/german_analysis.py b/german_analysis.py index 0858b8e..e0ec30f 100755 --- a/german_analysis.py +++ b/german_analysis.py @@ -17,9 +17,8 @@ ep = 300 # No of epochs # Load data dataset = ld.load_german_data() -years = [2017, 2013, 2009] +years = {17:2005, 18:2013, 19:2017} -i = 0 for period, df in dataset.items(): print("Election Period ", period) @@ -31,6 +30,5 @@ for period, df in dataset.items(): model = va.train_model(X, grid_h, grid_w, radius, step, ep) # Predict and visualize output - va.predict(model, data, grid_h, grid_w, pc.get_compass_parties(year=years[i], country='de')) - i += 1 + va.predict(model, data, grid_h, grid_w, pc.get_compass_parties(year=years[period], country='de')) diff --git a/voting_lib/political_compass.py b/voting_lib/political_compass.py index 9271f27..67b4c21 100644 --- a/voting_lib/political_compass.py +++ b/voting_lib/political_compass.py @@ -8,7 +8,7 @@ def get_compass_parties(year=2017, country='de'): elif year == 2013: data = [[-3.5, -4], [7, 6.5], [-7, -6.5], [1, 2]] index = ['BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD'] - elif year == 2009: + elif year == 2005: # TODO: add data for 2011 data = [[-1.5, -1.5], [9.5, 8], [-6, -2], [3, 3.5]] index = [ 'BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']