예측 다시 해보기
여러 번에 걸쳐 서로 다른 설명 변수 조합으로 예측 워크플로를 진행해 보셨죠. 이제 세 가지 설명 변수가 있는 모델로 한 번 더 시도해 볼 시간이에요. 여기서는 3원 상호작용이 포함된 모델을 사용할 텐데, 이전 연습 문제의 세 모델 중 어떤 것을 쓰더라도 코드 구조는 동일해요.
taiwan_real_estate와 mdl_price_vs_all_3_way_inter가 준비되어 있고, itertools.product가 로드되어 있어요.
이 연습은 강의의 일부입니다
Python의 statsmodels로 배우는 중급 회귀
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Create n_convenience as an array of numbers from 0 to 10
n_convenience = ____
# Create sqrt_dist_to_mrt_m as an array of numbers from 0 to 80 in steps of 10
sqrt_dist_to_mrt_m = ____
# Create house_age_years with unique values
house_age_years = ____
# Create p as all combinations of n_convenience, sqrt_dist_to_mrt_m, and house_age_years, in that order
p = ____
# Transform p to a DataFrame and name the columns
explanatory_data = ____
# See the result
print(explanatory_data)