In my last post I have plotted randu dataset to show that all its points lie on 15 parallel planes. But I was not fully satified with the solution and decided to show this numerically.
It can be done in four steps:
- identifying four points lying on the same plane and finding its equation (we know that we have 15 planes so it is enough to check 15*3+1 points to find them);
- applying the equation to all points in randu dataset to divide them into 15 classes;
- veryfying that the classes separate points into 15 parallel planes;
- plotting the solution changing colors for points on different planes.
Here is the code I used to do this:
At step three we can see that the model obtains perfect fit. The final figure is plotted below: