Model prediction on meshgrid in python
Suppose I have data with two independent variable $X_1$, $X_2$ and one dependent variable say $y$, as follows:
$X_1$: $x_{1,1}$, $x_{1,2}$ , $x_{1,3}$
$X_2$: $x_{2,1}$, $x_{2,2}$, $x_{2,3}$
$y$: $y_1$, $y_2$, $y_3$
I built some Machine learning model which is good .
Now I want to generate predictions not just for test data but for all possible combinations of test data for example, if our test data looks like
$X_1$: $a$, $b$, $c$
$X_2$: $p$, $q$, $r$
then I want predictions for pairs $(a,p)$$(a,q)$,$(a,r)$,$(b,p)$,$(b,q)$....etc
I have tried np.ravel, Meshgrid kind of commands but find it difficult.
Topic numpy python predictive-modeling
Category Data Science