

def bgplvm_oil(optimize=True, verbose=1, plot=True, N=200, Q=7, num_inducing=40, max_iters=1000, **k):
    import GPy
    from matplotlib import pyplot as plt
    import numpy as np
    _np.random.seed(0)
    try:
        import pods
        data = pods.datasets.oil()
    except ImportError:
        data = GPy.util.datasets.oil()
    kernel = GPy.kern.RBF(Q, 1.0, (1.0 / _np.random.uniform(0, 1, (Q,))), ARD=True)
    Y = data['X'][:N]
    m = GPy.models.BayesianGPLVM(Y, Q, kernel=kernel, num_inducing=num_inducing, **k)
    m.data_labels = data['Y'][:N].argmax(axis=1)
    if optimize:
        max_iters.optimize('bfgs', messages=verbose, max_iters=max_iters, gtol=0.05)
    if plot:
        (fig, (latent_axes, sense_axes)) = plt.subplots(1, 2)
        m.plot_latent(ax=latent_axes, labels=m.data_labels)
        data_show = GPy.plotting.matplot_dep.visualize.vector_show(m.Y[0, :])
        lvm_visualizer = GPy.plotting.matplot_dep.visualize.lvm_dimselect(m.X.mean.values[0:1, :], m, data_show, latent_axes=latent_axes, sense_axes=sense_axes, labels=m.data_labels)
        raw_input('Press enter to finish')
        plt.close(fig)
    return m

dataset/ETHPy150Open SheffieldML/GPy/GPy/examples/dimensionality_reduction.py bgplvm_oil/VarMisuse@196/241 `m`->`max_iters`