ComeçarComece de graça

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.

Este exercício faz parte do curso

Bayesian Regression Modeling with rstanarm

Ver curso

Instruções do exercício

  • 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

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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[, ___])
Editar e executar o código