관측된 노래의 인기
Spotify의 songs 데이터를 사용해 노래 인기도를 예측해 보세요. 이는 관측되지 않은 새 데이터에 대해 예측할 때 사용할 문법에 익숙해지는 데 도움이 됩니다.
이 연습은 강의의 일부입니다
rstanarm으로 배우는 Bayesian 회귀 모델링
연습 안내
song_age와artist_name으로popularity를 예측하는 모델을 추정하세요- 추정된 모델의 요약을 출력하세요
- 각 노래에 대한 예측 점수의 사후분포를 생성하세요
- 처음 5곡에 대해 예측된 점수의 처음 10개를 출력하세요
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Estimate the regression model
stan_model <- stan_glm(___, data = songs)
# Print the model summary
___(stan_model)
# Get posteriors of predicted scores for each observation
posteriors <- ___(stan_model)
# Print 10 predicted scores for 5 songs
___[___:___, ___:___]