Skip to content

Commit

Permalink
potential full fix #82 (#90)
Browse files Browse the repository at this point in the history
* potential full fix

* update NEWS + rebuild site
  • Loading branch information
hbaniecki authored and pbiecek committed Dec 17, 2019
1 parent 0aec450 commit 7bf16aa
Show file tree
Hide file tree
Showing 123 changed files with 756 additions and 530 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ingredients 0.5.0
---------------------------------------------------------------
* `feature_importance` now does `15` permutations on each variable by default. Use the `B` argument to change this number
* added boxplots to `plot.feature_importance` and `plotD3.feature_importance` that showcase the permutation data
* in `aggregate_profiles`: preserve `_x_` column factor order and sort its values [#82](https://github.com/ModelOriented/ingredients/issues/82)

ingredients 0.4.2
---------------------------------------------------------------
Expand Down
11 changes: 5 additions & 6 deletions R/aggregate_profiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ aggregated_profiles_partial <- function(all_profiles, groups = NULL) {
# as in https://github.com/ModelOriented/ingredients/issues/82
if (!is.numeric(all_profiles$`_x_`)) {
aggregated_profiles$`_x_` <- factor(aggregated_profiles$`_x_`, levels = unique(all_profiles$`_x_`))
aggregated_profiles <- aggregated_profiles[order(aggregated_profiles$`_x_`),]
}

aggregated_profiles
Expand Down Expand Up @@ -352,6 +353,10 @@ aggregated_profiles_conditional <- function(all_profiles, groups = NULL, span =
# for categorical variables we will calculate weighted average
# but weights are 0-1, 1 if it's the same level and 0 otherwise
split_profile$`_w_` <- split_profile$`_orginal_` == split_profile$`_x_`

# for factors, keep proper order
# as in https://github.com/ModelOriented/ingredients/issues/82
split_profile$`_x_` <- factor(split_profile$`_x_`, levels = unique(split_profile$`_x_`))
}

per_points <- split(split_profile, split_profile[, c("_x_", groups)])
Expand All @@ -373,12 +378,6 @@ aggregated_profiles_conditional <- function(all_profiles, groups = NULL, span =
aggregated_profiles$`_label_` <- paste(aggregated_profiles$`_label_`, aggregated_profiles$`_groups_`, sep = "_")
}


# for factors, keep proper order
# as in https://github.com/ModelOriented/ingredients/issues/82
if (!is.numeric(all_profiles$`_x_`)) {
aggregated_profiles$`_x_` <- factor(aggregated_profiles$`_x_`, levels = unique(all_profiles$`_x_`))
}
aggregated_profiles$`_ids_` <- 0

aggregated_profiles
Expand Down
5 changes: 3 additions & 2 deletions R/plotD3_aggregated_profiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ plotD3.aggregated_profiles_explainer <- function(x, ..., size = 2, alpha = 1,

ymax <- max(aggregated_profiles$`_yhat_`)
ymin <- min(aggregated_profiles$`_yhat_`)
ymargin <- abs(ymax - ymin)*0.1;
ymargin <- abs(ymax - ymin)*0.1

aggregated_profiles_list <- split(aggregated_profiles, aggregated_profiles$`_vname_`)

Expand Down Expand Up @@ -120,7 +120,8 @@ plotD3.aggregated_profiles_explainer <- function(x, ..., size = 2, alpha = 1,
ret
})

ymean <- round(attr(x, "mean_prediction"),3)

ymean <- ifelse("partial_dependency_explainer" %in% class(x), round(attr(x, "mean_prediction"), 3), 0)
}

options <- list(variableNames = as.list(all_variables),
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/articles/index.html

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

142 changes: 70 additions & 72 deletions docs/articles/vignette_describe.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 85 additions & 86 deletions docs/articles/vignette_simulated.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 82 additions & 83 deletions docs/articles/vignette_titanic.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/authors.html

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

8 changes: 4 additions & 4 deletions docs/index.html

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

118 changes: 60 additions & 58 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandoc: 2.3.1
pandoc: '2.6'
pkgdown: 1.4.1
pkgdown_sha: ~
articles:
Expand Down
Binary file modified docs/reference/accumulated_dependency-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/accumulated_dependency-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7bf16aa

Please sign in to comment.