Skip to content
Snippets Groups Projects
Commit 392a4f1b authored by Nicolas Barthes's avatar Nicolas Barthes
Browse files

visualize.py f-string transformed to simple string for server correct display

parent fcb3cb38
No related branches found
No related tags found
No related merge requests found
......@@ -112,10 +112,10 @@ def reg_plot(meas, pred, train_idx, test_idx, trainplot=True):
fig, ax = plt.subplots(figsize=(12, 4))
if trainplot:
sns.regplot(x=meas[0], y=pred[0], color="#2C6B6F", label=f'Cal (Predicted = {
a0[0]} + {a1[0]} x Measured)', scatter_kws={'edgecolor': 'black'})
sns.regplot(x=meas[1], y=pred[1], color='#d0f7be', label=f'Val (Predicted = {
a0[1]} + {a1[1]} x Measured)', scatter_kws={'edgecolor': 'black'})
sns.regplot(x=meas[0], y=pred[0], color="#2C6B6F", label='Cal (Predicted = '+
a0[0] +' + '+ a1[0] +' x Measured)', scatter_kws={'edgecolor': 'black'})
sns.regplot(x=meas[1], y=pred[1], color='#d0f7be', label='Val (Predicted = '+
a0[1]+' + '+a1[1]+' x Measured)', scatter_kws={'edgecolor': 'black'})
plt.plot([np.min(meas[0]) - 0.05, np.max([meas[0]]) + 0.05],
[np.min(meas[0]) - 0.05, np.max([meas[0]]) + 0.05], color='black')
......@@ -152,7 +152,7 @@ def resid_plot(meas, pred, train_idx, test_idx, trainplot=True):
ec = np.subtract(meas[0], pred[0])
ecc = np.array(ec).reshape(-1, 1)
sns.scatterplot(x=pred[0], y=ec, color="#2C6B6F",
label=f'Cal', edgecolor="black")
label='Cal', edgecolor="black")
for i, txt in enumerate(train_idx):
if np.abs(ecc[i]) > np.mean(ecc) + 3*np.std(ecc):
......@@ -161,7 +161,7 @@ def resid_plot(meas, pred, train_idx, test_idx, trainplot=True):
sns.scatterplot(x=pred[1], y=et, color="#d0f7be",
label=f'Val', edgecolor="black")
label='Val', edgecolor="black")
for i, txt in enumerate(test_idx):
if np.abs(ett[i]) > np.mean(ett) + 3 * np.std(ett):
plt.annotate(txt, (np.array(pred[1]).reshape(-1)[i], ett[i]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment