Jun-08-2017, 09:11 PM
Remove first elements from prediction (and y) with slicing when plotting. You can get length of first split either by directly computing it with
skip_size = len(X) - 10 * (len(X) // (10 + 1)) # for n_splits=10or by using tcsv.split again (or you could do it in your for loop first iteration ...)
skip_size = len(next(tscv.split(X)[0]))After that its just
pl.plot(y[skip_size:]) ... pl.plot(prediction[skip_size:], y[skip_size:], 'ro')Your plot is not piecewise linear, so it seems that your time series is not a time series (= data points in time order).