

def bgplvm_test_model(optimize=False, verbose=1, plot=False, output_dim=200, nan=False):
    '\n    model for testing purposes. Samples from a GP with rbf kernel and learns\n    the samples with a new kernel. Normally not for optimization, just model cheking\n    '
    import GPy
    num_inputs = 13
    num_inducing = 5
    if plot:
        output_dim = 1
        input_dim = 3
    else:
        input_dim = 2
        output_dim = output_dim
    X = _np.random.rand(num_inputs, input_dim)
    lengthscales = _np.random.rand(input_dim)
    k = GPy.kern.RBF(input_dim, 0.5, lengthscales, ARD=True)
    K = k.K(X)
    Y = _np.random.multivariate_normal(_np.zeros(num_inputs), K, (output_dim,)).T
    p = 0.3
    m = GPy.models.BayesianGPLVM(Y, K, kernel=k, num_inducing=num_inducing)
    if nan:
        m.inference_method = GPy.inference.latent_function_inference.var_dtc.VarDTCMissingData()
        m.Y[_np.random.binomial(1, p, size=Y.shape).astype(bool)] = _np.nan
        m.parameters_changed()
    if plot:
        import matplotlib.pyplot as pb
        m.plot()
        pb.title('PCA initialisation')
    if optimize:
        m.optimize('scg', messages=verbose)
        if plot:
            m.plot()
            pb.title('After optimisation')
    return m

dataset/ETHPy150Open SheffieldML/GPy/GPy/examples/dimensionality_reduction.py bgplvm_test_model/VarMisuse@159/281 `input_dim`->`K`