-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path99_plot_errors_parameter_matrix.py
50 lines (43 loc) · 1.61 KB
/
99_plot_errors_parameter_matrix.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
Plot standardized errors over features for all components.
All features are standardized.
Errors are represented by areas of the circles.
Observe the behavior of model and projection errors over the parameter space.
The errors are likely to be worse at the extremes of the space.
"""
# Author: Arturs Berzins <berzins@cats.rwth-aachen.de>
# License: BSD 3 clause
import config
import utils
from matplotlib import pyplot
dataset = 'test'
model_key = 'FNN'
df = utils.load_error_table(dataset)
features = utils.load_features(dataset)
P = len(config.mu_names)
error_key = F'eps_pod{model_key.lower()}_sq'
for component in config.components:
fig, axes = pyplot.subplots(P,P,sharex='col',sharey='row')
fig.suptitle(f'Standardized POD-{model_key} errors represented by area for component {component}')
L = config.num_basis[component]
df_filtered = df.loc[ (df['component']==component) &
(df['l']==L)]
# Plot matrix
for p1 in range(P):
for p2 in range(P):
xs = features[:,p2]
ys = features[:,p1]
cs = df_filtered[error_key].values
cs = cs ** 0.5
# Plot transparent data due to bug in scatter limits
axes[p1,p2].plot(xs, ys, alpha=0)
# The scale factor is empirical, adjust for better visuals perception
axes[p1,p2].scatter(xs, ys, s=(1e2*cs))
# Label x axes
for p in range(P):
axes[P-1,p].set_xlabel(config.mu_names[p])
# Label y axes
for p in range(P):
axes[p,0].set_ylabel(config.mu_names[p])
fig.set_size_inches(w=6.3, h=6.3)
pyplot.show()