def sparse_GP_regression_1D(num_samples=<NUM_LIT>, num_inducing=<NUM_LIT:5>, max_iters=<NUM_LIT:100>, optimize=True, plot=True, checkgrad=False):
<EOL>X = np.random.uniform(-<NUM_LIT>, <NUM_LIT>, (num_samples, <NUM_LIT:1>))<EOL>Y = np.sin(X) + np.random.randn(num_samples, <NUM_LIT:1>) * <NUM_LIT><EOL>rbf = GPy.kern.RBF(<NUM_LIT:1>)<EOL>m = GPy.models.SparseGPRegression(X, Y, kernel=rbf, num_inducing=num_inducing)<EOL>if checkgrad:<EOL><INDENT>m.checkgrad()<EOL><DEDENT>if optimize:<EOL><INDENT>m.optimize('<STR_LIT>', max_iters=max_iters)<EOL><DEDENT>if plot:<EOL><INDENT>m.plot()<EOL><DEDENT>return m<EOL>
Run a 1D example of a sparse GP regression.