Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hbaniecki committed May 8, 2020
1 parent ac82198 commit 3f1c0c6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 44 deletions.
3 changes: 1 addition & 2 deletions R/modelStudio.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@
#'
#' # make a studio for the model
#' modelStudio(explainer_titanic,
#' new_observations,
#' N = 200, B = 5) # faster example
#' new_observations)
#'
#' \donttest{
#'
Expand Down
25 changes: 14 additions & 11 deletions R/ms_update_observations.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,34 @@
#' library("modelStudio")
#'
#' # fit a model
#' model_apartments <- glm(m2.price ~. , data = apartments)
#' model_titanic <- glm(survived ~., data = titanic_imputed, family = "binomial")
#'
#' # create an explainer for the model
#' explainer_apartments <- explain(model_apartments,
#' data = apartments,
#' y = apartments$m2.price)
#' explainer_titanic <- explain(model_titanic,
#' data = titanic_imputed,
#' y = titanic_imputed$survived)
#'
#' # make a studio for the model
#' ms <- modelStudio(explainer_apartments)
#' ms
#' ms <- modelStudio(explainer_titanic)
#'
#' # add new observations
#' ms <- ms_update_observations(ms,
#' explainer_apartments,
#' new_observation = apartments[100:101,],
#' new_observation_y = apartments$m2.price[100:101])
#' explainer_titanic,
#' new_observation = titanic_imputed[100:101,],
#' new_observation_y = titanic_imputed$survived[100:101])
#' ms
#'
#' \donttest{
#'
#' # overwrite the observations with new ones
#' ms <- ms_update_observations(ms,
#' explainer_apartments,
#' new_observation = apartments[100:101,],
#' explainer_titanic,
#' new_observation = titanic_imputed[100:101,],
#' overwrite = TRUE)
#' ms
#'
#' }
#'
#' @export
#' @rdname ms_update_observations
ms_update_observations <- function(object,
Expand Down
11 changes: 5 additions & 6 deletions R/ms_update_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
#' library("modelStudio")
#'
#' # fit a model
#' model_apartments <- glm(m2.price ~. , data = apartments)
#' model_titanic <- glm(survived ~., data = titanic_imputed, family = "binomial")
#'
#' # create an explainer for the model
#' explainer_apartments <- explain(model_apartments,
#' data = apartments,
#' y = apartments$m2.price)
#' explainer_titanic <- explain(model_titanic,
#' data = titanic_imputed,
#' y = titanic_imputed$survived)
#'
#' # make a studio for the model
#' ms <- modelStudio(explainer_apartments)
#' ms
#' ms <- modelStudio(explainer_titanic)
#'
#' # update the options
#' new_ms <- ms_update_options(ms,
Expand Down
13 changes: 5 additions & 8 deletions man/modelStudio.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions man/ms_update_observations.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions man/ms_update_options.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3f1c0c6

Please sign in to comment.