ComeçarComece de graça

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.

Este exercício faz parte do curso

Dealing with Missing Data in Python

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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)
Editar e executar o código