From a1e551567cfdcf57fb955e0f836f9dfbd4e4ea22 Mon Sep 17 00:00:00 2001 From: rink <rink@ssec.wisc.edu> Date: Mon, 7 Apr 2025 12:03:49 -0500 Subject: [PATCH] add option to pass in absolute tolerance --- modules/deeplearning/quantile_regression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/deeplearning/quantile_regression.py b/modules/deeplearning/quantile_regression.py index cb038e96..f5ff7893 100644 --- a/modules/deeplearning/quantile_regression.py +++ b/modules/deeplearning/quantile_regression.py @@ -22,7 +22,7 @@ def true_func(x): # Y = 2 + 1.5 * X + epsilon # Linear relationship with variance increasing # Y = 1 + np.exp(X / 4) + epsilon # Y = 1 + np.exp(X / 4) + np.sin((2*np.pi/5)*X) - return 1 + np.exp(x / 4) + 3*np.sin((2*np.pi/5)*x) + return 1 + np.exp(x / 3) + 4*np.sin((2*np.pi/5)*x) + (0.5 + x/5)*np.cos((2*np.pi/2)*x) # Generate synthetic dataset def make_data(num_points=1000): @@ -85,7 +85,7 @@ def run(num_points=1000, num_plot_pts=200): # Plot the results plt.figure(figsize=(8, 6)) - plt.scatter(X_test[::4, 0], Y_test[::4, 0], alpha=0.3, label="Test Data") + # plt.scatter(X_test[::4, 0], Y_test[::4, 0], alpha=0.3, label="Test Data") plt.plot(X_range, predictions[0.05], label="Quantile 0.05", color='red') plt.plot(X_range, predictions[0.5], label="Quantile 0.5 (Median)", color='green') plt.plot(X_range, predictions[0.95], label="Quantile 0.95", color='blue') -- GitLab