ComenzarEmpieza gratis

Assessing model performance

To test which approach is best — the whole dataset model or the models for each house age category — you need to calculate some metrics. Here, you'll compare the coefficient of determination and the residual standard error for each model.

Four models of price versus no. of convenience stores (mdl_all_ages, mdl_0_to_15, mdl_15_to_30, and mdl_30_to_45) are available.

Este ejercicio forma parte del curso

Intermediate Regression with statsmodels in Python

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Print the coeff. of determination for mdl_all_ages
print("R-squared for mdl_all_ages: ", ____)

# Print the coeff. of determination for mdl_0_to_15
print("R-squared for mdl_0_to_15: ", ____)

# Print the coeff. of determination for mdl_15_to_30
print("R-squared for mdl_15_to_30: ", ____)

# Print the coeff. of determination for mdl_30_to_45
print("R-squared for mdl_30_to_45: ", ____)
Editar y ejecutar código