Einführung in Regression mit statsmodels in Python
Maarten Van den Broeck
Content Developer at DataCamp
Bream: das „gute“ Modell
mdl_bream = ols("mass_g ~ length_cm", data=bream).fit()

Barsch: das „schlechte“ Modell
mdl_perch = ols("mass_g ~ length_cm", data=perch).fit()

Brassen

Barsch

Brassen

Barsch

Brassen

Barsch

sns.residplot(x="length_cm", y="mass_g", data=bream, lowess=True)
plt.xlabel("Fitted values")
plt.ylabel("Residuals")

model_norm_residuals_bream = mdl_bream.get_influence().resid_studentized_internalmodel_norm_residuals_abs_sqrt_bream = np.sqrt(np.abs(model_norm_residuals_bream))sns.regplot(x=mdl_bream.fittedvalues, y=model_norm_residuals_abs_sqrt_bream, ci=None, lowess=True)plt.xlabel("Fitted values") plt.ylabel("Sqrt of abs val of stdized residuals")

Einführung in Regression mit statsmodels in Python