def uncertain_inputs_sparse_regression(max_iters=<NUM_LIT:200>, optimize=True, plot=True):
fig, axes = pb.subplots(<NUM_LIT:1>, <NUM_LIT:2>, figsize=(<NUM_LIT:12>, <NUM_LIT:5>), sharex=True, sharey=True)<EOL>S = np.ones((<NUM_LIT:20>, <NUM_LIT:1>))<EOL>X = np.random.uniform(-<NUM_LIT>, <NUM_LIT>, (<NUM_LIT:20>, <NUM_LIT:1>))<EOL>Y = np.sin(X) + np.random.randn(<NUM_LIT:20>, <NUM_LIT:1>) * <NUM_LIT><EOL>Z = np.random.uniform(-<NUM_LIT>, <NUM_LIT>, (<NUM_LIT:7>, <NUM_LIT:1>))<EOL>k = GPy.kern.RBF(<NUM_LIT:1>)<EOL>m = GPy.models.SparseGPRegression(X, Y, kernel=k, Z=Z)<EOL>if optimize:<EOL><INDENT>m.optimize('<STR_LIT>', messages=<NUM_LIT:1>, max_iters=max_iters)<EOL><DEDENT>if plot:<EOL><INDENT>m.plot(ax=axes[<NUM_LIT:0>])<EOL>axes[<NUM_LIT:0>].set_title('<STR_LIT>')<EOL><DEDENT>print(m)<EOL>m = GPy.models.SparseGPRegression(X, Y, kernel=GPy.kern.RBF(<NUM_LIT:1>), Z=Z, X_variance=S)<EOL>if optimize:<EOL><INDENT>m.optimize('<STR_LIT>', messages=<NUM_LIT:1>, max_iters=max_iters)<EOL><DEDENT>if plot:<EOL><INDENT>m.plot(ax=axes[<NUM_LIT:1>])<EOL>axes[<NUM_LIT:1>].set_title('<STR_LIT>')<EOL>fig.canvas.draw()<EOL><DEDENT>print(m)<EOL>return m<EOL>
Run a 1D example of a sparse GP regression with uncertain inputs.