for i in range(2, 5): if i != 4: df_slice = df[:-50*(4-i)] elif i == 4: df_slice = df floor = len(df_slice)-50 roof = len(df_slice) values = [loaded_models[i-1].predict(np.asarray(df_slice['Price'])[j-Obs:j].reshape(1, Obs, 1)) for j in range(floor, roof)] Predictions = Predictions + [val[0][0] for val in values] print i, floor, roof, roof-floor
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter