-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from mlr-org/fix_catboost
Fix catboost, closes #100
- Loading branch information
Showing
16 changed files
with
164 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,3 +125,4 @@ docs/ | |
|
||
.ccache/ | ||
.vscode/settings.json | ||
catboost_info/ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#' Helper function to install catboost | ||
#' @title Install catboost | ||
#' @param version `(character(1))` | ||
#' Version to install, if `NULL` installs latest | ||
#' @param os `(character(1))` \cr | ||
#' Operating system to install on, if `NULL` automatically detected | ||
#' @param install_required `(logical(1))` \cr | ||
#' If `TRUE` (default) then installs required packages: {curl}, {jsonlite}, | ||
#' {devtools} | ||
#' @param INSTALL_opts `(character())` \cr | ||
#' Passed to [devtools::install_url] | ||
#' @param ... `ANY` \cr | ||
#' Other arguments passed to [devtools::install_url] | ||
#' @export | ||
install_catboost <- function(version = NULL, os = NULL, | ||
install_required = TRUE, | ||
INSTALL_opts = c("--no-multiarch", | ||
"--no-test-load"), ...) { | ||
|
||
if (is.null(version)) { | ||
|
||
if (!requireNamespace("jsonlite", quietly = TRUE) && install_required) { | ||
utils::install.packages("jsonlite", repos = "https://cloud.r-project.org") | ||
} | ||
|
||
if (!requireNamespace("curl", quietly = TRUE) && install_required) { | ||
utils::install.packages("curl", repos = "https://cloud.r-project.org") | ||
} | ||
|
||
version <- jsonlite::fromJSON( | ||
"https://api.github.com/repos/catboost/catboost/releases" | ||
)$tag_name[1] | ||
} | ||
|
||
version <- gsub("v", "", version) | ||
|
||
if (is.null(os)) { | ||
os <- as.character(Sys.info()["sysname"]) | ||
} | ||
|
||
url <- sprintf( | ||
"https://github.com/catboost/catboost/releases/download/v%s/catboost-R-%s-%s.tgz", | ||
version, os, version) | ||
|
||
if (!requireNamespace("devtools", quietly = TRUE) && install_required) { | ||
utils::install.packages("devtools", repos = "https://cloud.r-project.org") | ||
} | ||
|
||
devtools::install_url(url, INSTALL_opts = INSTALL_opts, ...) | ||
} |
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.