모델 성능 평가
전체 데이터셋으로 학습한 모델과 주택 연령대별 모델 중 어느 접근이 더 나은지 확인하려면, 몇 가지 지표를 계산해야 해요. 여기서는 각 모델의 결정 계수와 잔차 표준 오차를 비교하겠습니다.
편의점 수에 따른 가격 모델 네 개(mdl_all_ages, mdl_0_to_15, mdl_15_to_30, mdl_30_to_45)가 준비되어 있어요.
이 연습은 강의의 일부입니다
Python의 statsmodels로 배우는 중급 회귀
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# 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: ", ____)