Calmcode - patsy: model

Model

1 2 3 4 5 6 7 8 9

To run the scikit-learn model, you need to run;

from sklearn.linear_model import LinearRegression
import matplotlib.pylab as plt

df_ml = df_clean.head(100)
y, X = ps.dmatrices("n_born ~ wday + yday", df_ml)
mod = LinearRegression().fit(X, y)

plt.figure(figsize=(12, 3))
plt.scatter(df_ml['date'], y)
plt.plot(df_ml['date'], mod.predict(X), color='orange');