mirror of
https://github.com/13hannes11/UU_NCML_Project.git
synced 2024-09-03 20:50:59 +02:00
Corrected years
This commit is contained in:
@@ -17,9 +17,8 @@ ep = 300 # No of epochs
|
|||||||
# Load data
|
# Load data
|
||||||
dataset = ld.load_german_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():
|
for period, df in dataset.items():
|
||||||
|
|
||||||
print("Election Period ", period)
|
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)
|
model = va.train_model(X, grid_h, grid_w, radius, step, ep)
|
||||||
|
|
||||||
# Predict and visualize output
|
# Predict and visualize output
|
||||||
va.predict(model, data, grid_h, grid_w, pc.get_compass_parties(year=years[i], country='de'))
|
va.predict(model, data, grid_h, grid_w, pc.get_compass_parties(year=years[period], country='de'))
|
||||||
i += 1
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ def get_compass_parties(year=2017, country='de'):
|
|||||||
elif year == 2013:
|
elif year == 2013:
|
||||||
data = [[-3.5, -4], [7, 6.5], [-7, -6.5], [1, 2]]
|
data = [[-3.5, -4], [7, 6.5], [-7, -6.5], [1, 2]]
|
||||||
index = ['BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']
|
index = ['BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']
|
||||||
elif year == 2009:
|
elif year == 2005:
|
||||||
# TODO: add data for 2011
|
# TODO: add data for 2011
|
||||||
data = [[-1.5, -1.5], [9.5, 8], [-6, -2], [3, 3.5]]
|
data = [[-1.5, -1.5], [9.5, 8], [-6, -2], [3, 3.5]]
|
||||||
index = [ 'BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']
|
index = [ 'BÜ90/GR', 'CDU/CSU', 'DIE LINKE.', 'SPD']
|
||||||
|
|||||||
Reference in New Issue
Block a user