xdata = (np.array(ret_rates.time_since_acqm)).reshape(-1,1) #xdata.reshape(-1,1) plt.plot(xdata, ret_rates.value_retention) model = LinearRegression().fit(xdata, ret_rates.value_retention) y_pred = model.predict(xdata) plt.plot(xdata, y_pred) ##be sure to reshape the x value so you can get the ypred against it
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