1. Learn
  2. /
  3. Courses
  4. /
  5. Bayesian Regression Modeling with rstanarm

Connected

Exercise

Format prediction posteriors

Now let's plot some new predictions. In this exercise, we'll predict how popular a song would be that was newly released and has a song_age of 0. We're still predicting popularity from song_age and artist_name. The new_predictions object has already been created and contains the distributions for the predicted scores for a new song from Adele, Taylor Swift, and Beyoncé.

Instructions

100 XP
  • Print the predicted scores from the first 10 iterations of new_predictions.
  • Convert new_predictions to a data frame and name the columns of the data frame "Adele", "Taylor Swift", and "Beyoncé".
  • Structure the data in long format, with only two columns: artist_name and predict.
  • Print the first six rows of the newly structured plot_posterior data frame.