Type Error in Code
Hi Mehdi please I am getting this error message not sure why. I attached a word document with the error message. Thanks
TypeError Traceback (most recent call last) in () 1 for cntr in centers: ----> 2 plot_population(df, center=cntr, start=0., yrs=yrs, method='monthly')
in plot_population(df, center, yrs, start, method) 89 model1.fit(x_t, y_ts) 90 plt.scatter(x, y_ts, color='black', s=1, marker='o', alpha=0.2) # , label="Sentenced actual counts") ---> 91 y_ps = model1.predict(x_f.reshape(-1, 1)) 92 plt.plot(x_f, y_ps, color='lightgreen', linewidth=1, label="Sentenced") 93 plt.fill_between(x_f,
G:\REBE\Common\1535_Research_Studies_and_Surveys\Iruoma\Remand Initiative data visualization\Forecasting\GeneralRegression\GeneralRegression.py in predict(self, X) 42 from numpy import sqrt 43 from scipy.stats import norm ---> 44 pred, std = self.model.predict(X, return_std=True) 45 z_bar = norm.ppf(self.ci, 0, 1) 46 self.ci_band = z_bar * std # / sqrt(max(self.size - 1 , 1))
C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\metaestimators.py in (*args, **kwargs) 113 114 # lambda, but not partial, allows help() to work with update_wrapper --> 115 out = lambda *args, **kwargs: self.fn(obj, *args, **kwargs) 116 # update the docstring of the returned function 117 update_wrapper(out, self.fn)
TypeError: predict() got an unexpected keyword argument 'return_std'