Skip to content

Instantly share code, notes, and snippets.

@yisongtao
Created November 21, 2016 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yisongtao/7a7e14c3e0e0c15bc732befb78ca970c to your computer and use it in GitHub Desktop.
Save yisongtao/7a7e14c3e0e0c15bc732befb78ca970c to your computer and use it in GitHub Desktop.
importance(rf_df, type = 1)
# %IncMSE
#DirectorScore 30.64382
#ActorScore 44.65084
#MusicianScore 26.36350
#Viewer 53.04153
#Favorite 66.95043
#Type 67.82751
#Rating 49.92500
rf_df
#Call:
# randomForest(formula = Score ~ DirectorScore + ActorScore + MusicianScore + Viewer +
# Favorite + Type + Rating, data = new_df, ntree = 500, mtry = 3, subset = train)
# Type of random forest: regression
# Number of trees: 500
#No. of variables tried at each split: 3
#
# Mean of squared residuals: 0.2776111
# % Var explained: 63.99
# RMSE of the prediction
Metrics::rmse(new_df$Score[-train], pred_test)
#[1] 0.5842004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment