This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mlr3benchmark) | |
| ## create mlr3benchmark object | |
| bma <- as.BenchmarkAggr(bm) | |
| ## run global Friedman test | |
| bma$friedman_test() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## load ggplot2 for autoplots | |
| library(ggplot2) | |
| ## critical difference diagrams for IGS | |
| autoplot(bma, meas = "graf", type = "cd", ratio = 1/3, p.value = 0.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| raincloudplot <- function(data, y, fill, x = fill, cols = NULL, | |
| boxplots = c("below", "in", "none")) { | |
| require(dplyr) | |
| require(ggplot2) | |
| source("https://raw.githubusercontent.com/datavizpyr/data/master/half_flat_violinplot.R") | |
| boxplots <- match.arg(boxplots) | |
| p <- ggplot(data, aes_string(y = y, x = x, fill = fill)) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| `%=%` <- function(l, r) { | |
| l <- trimws(strsplit(l, ",", TRUE)[[1]]) | |
| if (all(l == "USE.NAMES") || all(l == "*") || all(l == "?")) { | |
| stopifnot(length(names(r)) > 0) | |
| l <- names(r) | |
| } else { | |
| stopifnot(identical(length(l), length(r))) | |
| which <- l == "?" | |
| if (any(which)) { | |
| stopifnot(length(names(r)) > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Get SHAPs from a trained xgboost model | |
| #' @param model trained xgboost model | |
| #' @param data new data for calculating shaps | |
| get_shaps <- function(model, data) { | |
| p = predict(model, data, | |
| predcontrib = T, approxcontrib = F) | |
| p = p[, -ncol(p)] | |
| shaps = reshape2::melt(p) | |
| vars = reshape2::melt(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| tags: '*' | |
| pull_request: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(distr6); library(stats4);library(data.table) | |
| mleEstimate <- function(distr, data, method = "BFGS", fixed = list(), nobs, ...){ | |
| p = as.data.table(distr$parameters()) | |
| p = subset(p, subset = p$settable, select = c("id","value")) | |
| f = vector("list",length(p$id)) | |
| names(f) = p$id | |
| LL <- function(){} | |
| formals(LL) = f |
OlderNewer