Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ex2_3_5.py 777 B
# Exercise 2.3.5
# (requires data from exercise 2.3.1)
from ex2_3_1 import *
from matplotlib.pyplot import (
figure,
legend,
plot,
show,
subplot,
xlabel,
xticks,
ylabel,
yticks,
)
figure(figsize=(12, 10))
for m1 in range(M):
for m2 in range(M):
subplot(M, M, m1 * M + m2 + 1)
for c in range(C):
class_mask = y == c
plot(np.array(X[class_mask, m2]), np.array(X[class_mask, m1]), ".")
if m1 == M - 1:
xlabel(attributeNames[m2])
else:
xticks([])
if m2 == 0:
ylabel(attributeNames[m1])
else:
yticks([])
legend(classNames)
show()
print("Ran Exercise 2.3.5")