how to plot uncertainty bands where each set of (x, y) data points has different x-values to be available.
The use case here is training neural network experiment (reinforcement learning) with multiple random runs. Each experiment produces a list of (x, y) data points, where x-axis is the number of environment interactions, y-axis is the performance. Due to randomness, the available x-values are different across random runs.
To simplify the problem, let us formulate it as the following toy version:
Suppose we have following data points for 3 curves
import numpy as np import matplotlib.pyplot as plt x1 = [0.3, 0.5, 0.7, 0.85, 0.9] y1 = np.sin(x1)*np.exp(np.cos(x1)) x2 = [0.05, 0.12, 0.3, 0.7, 0.8] y2 = np.sin(x2)*np.exp(0.2*np.cos(x2)) x3 = [0.2, 0.34, 0.56, 0.78, 0.89, 0.9, 0.95] y3 = 2*np.sin(x3)*np.exp(np.cos(x3)) plt.scatter(x1, y1, label='curve1') plt.scatter(x2, y2, label='curve2') plt.scatter(x3, y3, label='curve3') plt.legend()
Is there a good way to plot uncertainty bands (mean plus/minus std) across different random runs ?
The first solution coming to my mind is to fit a polynomial for each curve and generate new data points for consistent x-values, but this can be very misleading in research curve. Because some of the curves might be very sparse in the data point, fitting a polynomial probably is not a good idea.