Updated party colors & modified training params

This commit is contained in:
Deepthi Pathare
2021-06-25 15:24:09 +02:00
parent 065a3e2ce0
commit 7107b5547a
4 changed files with 15 additions and 16 deletions

View File

@@ -1,13 +1,13 @@
de_name_color = {
'AfD': 'blue',
'BÜ90/GR': 'green',
'CDU/CSU': 'black',
'CDU/CSU': 'orange',
'DIE LINKE.': 'purple',
'FDP': 'yellow',
'DIE LINKE': 'purple',
'FDP': 'magenta',
'SPD': 'red',
}
uk_name_color = {
'Conservative': 'blue',
'Democratic Unionist Party': 'salmon',
@@ -15,9 +15,11 @@ uk_name_color = {
'Labour': 'red',
'Liberal Democrat': 'darkorange',
'Plaid Cymru': 'darkgreen',
'Scottish National Party': 'yellow',
'Scottish National Party': 'magenta',
'Sinn Féin': 'yellowgreen',
'Social Democratic & Labour Party': 'cyan',
'UK Independence Party': 'purple',
'Ulster Unionist Party': 'lightskyblue',
'Alba Party': 'black',
'Alliance': 'olive',
}

View File

@@ -81,6 +81,7 @@ def predict(model, data, grid_h, grid_w, party_colors, comparison_data=pd.DataFr
err = remove_NaN_rows_columns(normalize_df(part_distance_out) - normalize_df(comparison_data_dist))
err = err * err
plot_party_distances(err)
plt.title(f'MSE={np.nanmean(err.to_numpy()):.2f}')
plt.show()
def iter_neighbours(weights, hexagon=False):
@@ -218,7 +219,7 @@ def plot_parties(parties, party_colors, randomize_positions=False, new_plot=True
for i, party in enumerate(party_index_mapping):
print("Party ", party, " x = ", xs_disp[i], "y = ", ys_disp[i])
plt.scatter(xs_disp[i], ys_disp[i], label=party, zorder=2, c=colors[i], edgecolors='black')
plt.scatter(xs_disp[i], ys_disp[i], label=party, zorder=2, c=colors[i], edgecolors='None')
plt.legend(title='Parties', bbox_to_anchor=(1.3, 1), loc='upper left')