<jupyter_start><jupyter_text>nnn= 'SOF_results_Symmetric.csv'df_tmp = pd.read_csv(nnn)df_tmp = df_tmp.drop(columns=["Unnamed: 0"])df_tmp['target']="STEAK"df_tmp.to_csv(nnn, index=False)<jupyter_code>df_plot = df_res
#df_plot = pd.read_csv('res_data/gp_all-paste.csv')
df_plot = df_plot[~(df_plot.type.isin(["rf_rf", "rf_grf", "rf_oracle"]))]
#df_plot = df_plot[~(df_plot.type.isin(["rf_approx_risk", "rf_approx_sol", "oracle"]))]
#df_plot = df_plot[~(df_plot.type.isin(["saa", "rf"]))]
sns.set(rc={'figure.figsize':(15,15)})
sns.set_style('whitegrid')
sns.relplot(data=df_plot, x="cu", y="cost",col_wrap=3,facet_kws={'sharey':False},
    col="target", hue="type",kind="line", aspect=1, height=4);<jupyter_output><empty_output><jupyter_text>Visualize<jupyter_code>test_df = load_yaz(encode_date_features=False, include_prod=[target]).frame.iloc[n_train:,:].copy()
test_df['mean_pred'] = nv_means_unscaled
test_df['std'] = nv_sigma_unscaled
g = sns.catplot(x="WEEKDAY", y="STEAK",
                col="MONTH",# hue="MONTH",
                aspect=.8,
                data=test_df, kind="box");
g = sns.catplot(x="WEEKDAY", y="mean_pred",
                col="MONTH",# hue="MONTH",
                aspect=.8,
                data=test_df, kind="box");
g = sns.catplot(x="WEEKDAY", y="std",
                col="MONTH",# hue="MONTH",
                aspect=.8,
                data=test_df, kind="box");<jupyter_output><empty_output><jupyter_text>Plot Space<jupyter_code>f0 = [torch.linspace(0, 1, 200) for i in range(1)]
fx = torch.linspace(1,1, 200) #temp
fn = [torch.linspace(0, 1, 200) for i in range(5)]#[torch.linspace(0.5, 0.5, 200) for i in range(2)]

with torch.no_grad(), gpytorch.settings.fast_pred_var():
    #test_x = torch.linspace(0, 1, 51)
    sample_x = torch.stack([*f0,fx,*fn] , axis=-1).cuda()
    observed_pred = likelihood(model(sample_x))
feature_idx=2
with torch.no_grad():
    # Initialize plot
    f, ax = plt.subplots(1, 1, figsize=(15, 15))

    # Get upper and lower confidence bounds
    lower, upper = observed_pred.confidence_region()
    # Plot training data as black stars
    #ax.plot(train_x[:,feature_idx].cpu().numpy(), train_y.cpu().numpy(), 'k*')
    #ax.plot(sample_x[:,feature_idx].cpu().numpy(), y_samples.cpu().numpy(), lw=1)
    # Plot predictive means as blue line
    ax.plot(fx.numpy(), observed_pred.mean.cpu().numpy(), 'b')
    ax.plot(sample_x[:,feature_idx].cpu().numpy(), observed_pred.mean.cpu().numpy(), 'b')
    # Shade between the lower and upper confidence bounds
    ax.fill_between(sample_x[:,feature_idx].cpu().numpy(), lower.cpu().numpy(), upper.cpu().numpy(), alpha=0.5)
    #ax.fill_between(sample_x[:,feature_idx].cpu().numpy(), lower.cpu().numpy(), upper.cpu().numpy(), alpha=0.5)
    #ax.set_ylim([-3, 3])
    ax.legend(['Observed Data', 'Mean', 'Confidence'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20084121976866456, 'fraction_numerical': 0.019978969505783387, 'mean_word_length': 4.765656565656566, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '102032', 'license': 'Apache-2.0', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1123, 'n_words': 163, 'path': 'nbs_dev/GP_YAZ_gpy.ipynb', 'repo_name': 'matjesg/gp_dev', 'size': '2853'}