SheffieldML / GPy

Gaussian processes framework in python
BSD 3-Clause "New" or "Revised" License
2.04k stars 561 forks source link

GPCoregionalizedRegression Documention #1099

Open anthony-meza opened 1 week ago

anthony-meza commented 1 week ago

I have 3 input dimensions (x, y, time) and 5 outputs. Below is the code I use

num_outputs = n_stations
n_inputs = 2
K1 = GPy.kern.Bias(input_dim=n_inputs)
K2 = GPy.kern.Linear(input_dim=n_inputs)
K3 = GPy.kern.Matern32(input_dim=n_inputs)
lcm_kernel = GPy.util.multioutput.LCM(input_dim=n_inputs,num_outputs=n_stations,kernels_list=[K1,K2,K3], W_rank = 5)

model = GPy.models.GPCoregionalizedRegression(X_list, Y_list, kernel=lcm_kernel)

# Optimize the model
model.optimize(messages=True, max_iters=1000)

X_list and Y_list have a length of num_outputs.

However, the following code does not work: Y_pred, Y_var = model.predict(X_new, full_cov = True, Y_metadata = {"output_index":[0]})

I cannot make a prediction for one of my outputs (supposedly at index 0). I wasn't able to find anything on the documentation about this.

MartinBubel commented 6 days ago

Hi @anthony-meza thank you for reporting this issue. I have reproduced it and feel like there must be some issue with matrix shape or missing documentation. However, I am not that familiar with the backend. I'm a bit busy this week but I'll try to dig into this next week.