Allow for arbitrary dimensionality of the dependent variables; add checks
Hi @mingxuan, I have a following request:
It seems that your regression code assumes that dimensionality of the predicted variables is always equal to the dimensionality of the independent variables. For example, in gpr.py
function singular_kernel_average
you have:
where d
was taken from: n,d = Query_Point.shape
.
This doesn't have to always be the case. We might want to predict more (or less) variables than there are independent variables.
I would then suggest that when you construct var_y_1
, you take the dimensionality from Y
, (or from Query_Point_y
). Otherwise, the code breaks when we want to predict more variables than the current value d
.
Do you agree with my interpretation of your code? Could you please modify the scripts to allow for that?
It would also be good if you could add some checks if the number of observations and variables are consistent between all four input variables: X
, Y
, Query_Point
and Query_Point_y
. You could do something like this:
if n_observations_X != n_observations_Y:
raise ValueError("Observations not consistent.")
Thanks!