Value error array with 0 features in linear regression scikit
The error says that the array you feed into predict has shape=(1,0) meaning that it must be an empty iterable.

And by looking at your code, it's easy to see why. x_test starts of as empty, and in your code, the only way to add things to it is if i &gt; le. But since your loop is defined as for i in range(le), by definition i will never be greater than le since the last value of range is le-1