... patsy: model


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');

Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider signing up for the newsletter.