

def stick(kernel=None, optimize=True, verbose=True, plot=True):
    from matplotlib import pyplot as plt
    import GPy
    import pods
    data = pods.datasets.osu_run1()
    m = GPy.models.GPLVM(data['Y'], 2, kernel=kernel)
    if optimize:
        m.optimize('bfgs', messages=verbose, max_f_eval=10000)
    if plot:
        plt.clf
        ax = m.plot_latent()
        y = m.Y[0, :]
        data_show = GPy.plotting.matplot_dep.visualize.stick_show(y[None, :], connect=data['connect'])
        lvm_visualizer = GPy.plotting.matplot_dep.visualize.lvm(m.X[:1, :].copy(), m, data_show, latent_axes=y)
        raw_input('Press enter to finish')
        lvm_visualizer.close()
        data_show.close()
    return m

dataset/ETHPy150Open SheffieldML/GPy/GPy/examples/dimensionality_reduction.py stick/VarMisuse@175/221 `ax`->`y`