Corrected years

This commit is contained in:
Deepthi Pathare
2021-05-18 19:05:32 +02:00
parent c5cf10ff65
commit 1c2bfd7c41
2 changed files with 3 additions and 5 deletions

View File

@@ -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'))

View File

@@ -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']