def oil(num_inducing=<NUM_LIT:50>, max_iters=<NUM_LIT:100>, kernel=None, optimize=True, plot=True):
try:import pods<EOL>except ImportError:raise ImportWarning('<STR_LIT>')<EOL>data = pods.datasets.oil()<EOL>X = data['<STR_LIT:X>']<EOL>Xtest = data['<STR_LIT>']<EOL>Y = data['<STR_LIT:Y>'][:, <NUM_LIT:0>:<NUM_LIT:1>]<EOL>Ytest = data['<STR_LIT>'][:, <NUM_LIT:0>:<NUM_LIT:1>]<EOL>Y[Y.flatten()==-<NUM_LIT:1>] = <NUM_LIT:0><EOL>Ytest[Ytest.flatten()==-<NUM_LIT:1>] = <NUM_LIT:0><EOL>m = GPy.models.SparseGPClassification(X, Y, kernel=kernel, num_inducing=num_inducing)<EOL>m.Ytest = Ytest<EOL>m['<STR_LIT>'] = <NUM_LIT><EOL>if optimize:<EOL><INDENT>m.optimize(messages=<NUM_LIT:1>)<EOL><DEDENT>print(m)<EOL>probs = m.predict(Xtest)[<NUM_LIT:0>]<EOL>GPy.util.classification.conf_matrix(probs, Ytest)<EOL>return m<EOL>
Run a Gaussian process classification on the three phase oil data. The demonstration calls the basic GP classification model and uses EP to approximate the likelihood.