CommencerCommencer gratuitement

Popularity for New Songs

Beyoncé's most recent album, Lemonade, is not in our songs dataset. Let's predict how popular a song on that album would be. The Lemonade album was released 663 days before this dataset was created. The stan_model object you created in the last exercise is loaded in your environment.

Cet exercice fait partie du cours

Bayesian Regression Modeling with rstanarm

Afficher le cours

Instructions

  • Create a data frame of new data to be predicted including the song_age and artist_name variables
  • Create a posterior distribution for predicted popularity of a song on Lemonade
  • Print the predicted popularity for the first 10 draws from the posterior distribution
  • Print a summary of the posterior predictions for the 1 new observation

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create data frame of new data
predict_data <- data.frame(___ = ___, ___ = "Beyoncé")

# Create posterior predictions for Lemonade album
new_predictions <- ___(stan_model, ___ = predict_data)

# Print first 10 predictions for the new data
___[___:___,]

# Print a summary of the posterior distribution of predicted popularity
___(new_predictions[, ___])
Modifier et exécuter le code