mirror of
https://github.com/13hannes11/UU_NCML_Project.git
synced 2024-09-03 20:50:59 +02:00
add mps and party plotting to UK dataset, #7
This commit is contained in:
@@ -297,3 +297,18 @@ ax.set_zlabel('vote_2')
|
|||||||
ax.legend()
|
ax.legend()
|
||||||
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
# predicting mp positions
|
||||||
|
prediction = sofmnet.predict(X)
|
||||||
|
print(f'prediction: {prediction}')
|
||||||
|
|
||||||
|
# converting to x and y coordinates
|
||||||
|
ys, xs = np.unravel_index(np.argmax(X, axis=1), (h, w))
|
||||||
|
|
||||||
|
# plotting mps
|
||||||
|
plot_mps(data[:,0], xs, ys, data[:,1])
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
# plotting parties
|
||||||
|
plot_parties(xs, ys, data[:,1])
|
||||||
|
plt.show()
|
||||||
|
|||||||
Reference in New Issue
Block a user