예측 사후분포 형식화
이제 새로운 예측을 시각화해 보겠습니다. 이번 연습에서는 새로 발매되어 song_age가 0인 곡의 인기도를 예측합니다. 여전히 song_age와 artist_name으로 popularity를 예측합니다. new_predictions 객체는 이미 생성되어 있으며, Adele, Taylor Swift, Beyoncé의 신곡에 대한 예측 점수 분포를 담고 있습니다.
이 연습은 강의의 일부입니다
rstanarm으로 배우는 Bayesian 회귀 모델링
연습 안내
new_predictions의 처음 10회 반복에서 예측 점수를 출력하세요.new_predictions를 데이터 프레임으로 변환하고, 열 이름을 "Adele", "Taylor Swift", "Beyoncé"로 지정하세요.- 데이터를 long 형식으로 변환하여
artist_name과predict두 열만 남기세요. - 새로 구성한
plot_posterior데이터 프레임의 처음 6행을 출력하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# View new data predictions
___[___:___, ]
# Convert to data frame and rename variables
new_predictions <- ___(new_predictions)
___(___) <- c("___", "___", "___")
# Create tidy data structure
plot_posterior <- ___(new_predictions, key = "artist_name", value = "predict")
# Print formated data
___(plot_posterior)