IniziaInizia gratis

Comparing and choosing the best adjusted R-squared

During the analysis of imputed DataFrames on a linear model, the adjusted R-squared(\(adj.R^2\)) score that explains the best fit model.

In this exercise, you will compare the \(adj.R^2\) scores of the linear models (for each of the imputed datasets) you created earlier, namely lm_mean, lm_KNN and lm_MICErespectively.

You will first neatly print (by creating a DataFrame) their attributes rsquared_adj and finally choose the model with maximum \(adj.R^2\).

The above models have already been loaded for you as lm_mean, lm_KNN and lm_MICE.

Questo esercizio fa parte del corso

Dealing with Missing Data in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Store the Adj. R-squared scores of the linear models
rsquared_df = pd.DataFrame({'Mean Imputation': ___, 
                          'KNN Imputation': ___, 
                          'MICE Imputation': ___}, 
                         index=['Adj. R-squared'])

# Neatly print the Adj. R-squared scores in the console
print(rsquared_df)
Modifica ed esegui il codice