Skip to content

Commit

Permalink
fix: add missing try_require("h2o")'s
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed Sep 12, 2024
1 parent 6140cae commit de4b76c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Package: lares
Type: Package
Title: Analytics & Machine Learning Sidekick
Version: 5.2.9
Version: 5.2.9.9000
Authors@R: c(
person("Bernardo", "Lares", , "laresbernardo@gmail.com", c("aut", "cre")))
Maintainer: Bernardo Lares <laresbernardo@gmail.com>
Description: Auxiliary package for better/faster analytics, visualization, data mining, and machine
learning tasks. With a wide variety of family functions, like Machine Learning, Data Wrangling,
MMM, Exploratory, API, and Scrapper, it helps the analyst or data scientist to get quick and
robust results, without the need of repetitive coding or advanced R programming skills.
Marketing Mix Modeling (Robyn), Exploratory, API, and Scrapper, it helps the analyst or
data scientist to get quick and robust results, without the need of repetitive coding or
advanced R programming skills.
Depends:
R (>= 3.5.0)
Imports:
Expand Down
1 change: 1 addition & 0 deletions R/lasso.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ lasso_vars <- function(df, variable,
quiet = FALSE,
seed = 123, ...) {
tic("lasso_vars")
try_require("h2o")
quiet(h2o.init(nthreads = -1, port = 54321))
h2o.no_progress()
on.exit(set.seed(seed))
Expand Down
1 change: 1 addition & 0 deletions R/model_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ export_results <- function(results,
save = TRUE,
seed = 0) {
if (save) {
try_require("h2o")
quiet(h2o.init(nthreads = -1, port = 54321))

pass <- !is.null(attr(results, "type"))
Expand Down
2 changes: 2 additions & 0 deletions R/model_predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @export
#' @rdname h2o_predict
h2o_predict_MOJO <- function(df, model_path, method = "mojo", batch = 300) {
try_require("h2o")
quiet(h2o.init(nthreads = -1, port = 54321))

files <- list.files(model_path)
Expand Down Expand Up @@ -82,6 +83,7 @@ h2o_predict_MOJO <- function(df, model_path, method = "mojo", batch = 300) {
#' @rdname h2o_predict
h2o_predict_binary <- function(df, model_path, sample = NA) {
message("Use of h2o_predict_MOJO instead highly recommended!")
try_require("h2o")
quiet(h2o.init(nthreads = -1, port = 54321))

if (!right(model_path, 4) == ".zip") {
Expand Down

0 comments on commit de4b76c

Please sign in to comment.