

def sparse_gplvm_oil(optimize=True, verbose=0, plot=True, N=100, Q=6, num_inducing=15, max_iters=50):
    import GPy
    import pods
    _np.random.seed(0)
    data = pods.datasets.oil()
    Y = data['X'][:N]
    Y = (Y - Y.mean(0))
    Y /= Y.std(0)
    kernel = (GPy.kern.RBF(Q, ARD=True) + GPy.kern.Bias(Q))
    m = GPy.models.SparseGPLVM(Y, Q, kernel=kernel, num_inducing=num_inducing)
    m.data_labels = data['Y'][:N].argmax(axis=1)
    if optimize:
        m.optimize('scg', messages=verbose, max_iters=max_iters)
    if plot:
        m.plot_latent(labels=m.data_labels)
        m.kern.plot_ARD()
    return m

dataset/ETHPy150Open SheffieldML/GPy/GPy/examples/dimensionality_reduction.py sparse_gplvm_oil/original