Open krpwn opened 4 years ago
I have been doing the codes as -
df=pd.DataFrame(adata) df.head()
xq=adata['batch size'].values.reshape(-1,1) yq=adata['Price'].values.reshape(-1,1)
mod = smf.quantreg('yq ~ xq', df) res = mod.fit(q=.5) print(res.summary())
quantiles = [.05, .25, .50, .75, .95] def fit_model(q): res = mod.fit(q=q) return [q, res.params['Intercept'], res.params[xq]] + res.conf_int().ix[xq].tolist() models = [fit_model(xq) for xq in quantiles]
However am getting the error as IndexError: index 200 is out of bounds for axis 0 with size 2
I have been doing the codes as -
df=pd.DataFrame(adata) df.head()
xq=adata['batch size'].values.reshape(-1,1) yq=adata['Price'].values.reshape(-1,1)
mod = smf.quantreg('yq ~ xq', df) res = mod.fit(q=.5) print(res.summary())
quantiles = [.05, .25, .50, .75, .95] def fit_model(q): res = mod.fit(q=q) return [q, res.params['Intercept'], res.params[xq]] + res.conf_int().ix[xq].tolist() models = [fit_model(xq) for xq in quantiles]
However am getting the error as IndexError: index 200 is out of bounds for axis 0 with size 2