Skip to content

Commit

Permalink
post recording
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Feb 22, 2022
1 parent 4e7aed9 commit f912a93
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions 049_modelstudio/049_modelstudio.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# R TIPS ----
# TIP 049| ModelStudio: Interactive Studio for Explanatory Model Analysis ----
#
# 👉 For Weekly R-Tips, Sign Up Here:
# https://mailchi.mp/business-science/r-tips-newsletter

# Documentation: https://modelstudio.drwhy.ai/index.html

# INSTALLATION ----
# install.packages("modelStudio")


# LIBRARIES ----

library(modelStudio)
library(DALEX)
library(tidyverse)
library(tidymodels)

# DATA ----

data_tbl <- mpg %>%
select(hwy, manufacturer:drv, fl, class)

# MODEL ----

fit_xgboost <- boost_tree(learn_rate = 0.3) %>%
set_mode("regression") %>%
set_engine("xgboost") %>%
fit(hwy ~ ., data = data_tbl)

fit_xgboost

# EXPLAINER ----

explainer <- DALEX::explain(
model = fit_xgboost,
data = data_tbl,
y = data_tbl$hwy,
label = "XGBoost"
)

# MODEL STUDIO ----

modelStudio::modelStudio(explainer)

# LEARNING MORE ----

# FREE MASTERCLASS
# - 10 SECRETS TO BECOMING A DATA SCIENTIST
# https://mailchi.mp/business-science/rtrack-master-class-signup-3

0 comments on commit f912a93

Please sign in to comment.