Skip to content

Commit

Permalink
feat: preparing v0.0.3
Browse files Browse the repository at this point in the history
also addresses / closes #2
  • Loading branch information
kapsner committed Mar 7, 2024
1 parent a1aa854 commit a6b04fc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mllrnrs
Title: R6-Based ML Learners for 'mlexperiments'
Version: 0.0.2.9001
Version: 0.0.3
Authors@R:
person("Lorenz A.", "Kapsner", , "lorenz.kapsner@gmail.com", role = c("cre", "aut", "cph"),
comment = c(ORCID = "0000-0003-1866-860X"))
Expand All @@ -27,7 +27,7 @@ Imports:
Suggests:
glmnet,
knitr,
lightgbm,
lightgbm (>= 4.0.0),
lintr,
mlbench,
mlr3measures,
Expand All @@ -40,7 +40,7 @@ VignetteBuilder:
knitr
Config/testthat/edition: 3
Config/testthat/parallel: false
Date/Publication: 2023-07-18 18:11:47.228829 UTC
Date/Publication: 2024-03-07 15:19:39.657389 UTC
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# mllrnrs NEWS

## Unreleased (2023-07-18)

#### Other changes

- added cran installation note
([a1aa854](https://github.com/kapsner/mllrnrs/tree/a1aa854b479d78e67a7eb76b71b7d5a4500171fd))

## v0.0.2 (2023-07-18)

#### Bug fixes
Expand Down
18 changes: 6 additions & 12 deletions R/learner_lightgbm.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,14 @@ lightgbm_predict <- function(model, newdata, ncores, ...) {
kwargs
)

# temporary fix due to API change of lightgbm's predict-method:
# - https://lightgbm.readthedocs.io/en/v3.3.5/R/reference/predict.lgb.Booster.html
# - https://lightgbm.readthedocs.io/en/v4.0.0/R/reference/predict.lgb.Booster.html
# this can be removed, once new version is out on cran, but then also
# add lightgbm>=4.0.0 as a requirement to the package description
if (utils::packageVersion("lightgbm") <= package_version("3.3.5")) {
args$data <- newdata
} else {
args$newdata <- newdata
# remove also reshape argument (https://github.com/microsoft/LightGBM/pull/4971)
args$reshape <- NULL
}
args$newdata <- newdata
# remove also reshape argument (https://github.com/microsoft/LightGBM/pull/4971)
# by default, multiclass now outputs a matrix
args$reshape <- NULL

preds <- do.call(stats::predict, args)

# important for predict-args in order to return a vector of classes for some metrics
if (!is.null(kwargs$reshape)) {
if (isTRUE(kwargs$reshape)) {
preds <- kdry::mlh_reshape(preds)
Expand Down
4 changes: 2 additions & 2 deletions data-raw/devstuffs.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ my_desc$set_authors(c(
# Remove some author fields
my_desc$del("Maintainer")
# Set the version
my_desc$set_version("0.0.2.9001")
my_desc$set_version("0.0.3")
# The title of your package
my_desc$set(Title = "R6-Based ML Learners for 'mlexperiments'")
# The description of your package
Expand Down Expand Up @@ -73,7 +73,7 @@ usethis::use_package("lintr", type = "Suggests")
usethis::use_package("knitr", type = "Suggests")
usethis::use_package("glmnet", type = "Suggests")
usethis::use_package("xgboost", type = "Suggests")
usethis::use_package("lightgbm", type = "Suggests")
usethis::use_package("lightgbm", type = "Suggests", min_version = "4.0.0")
usethis::use_package("ranger", type = "Suggests")
usethis::use_package("splitTools", type = "Suggests")
usethis::use_package("mlbench", type = "Suggests")
Expand Down

0 comments on commit a6b04fc

Please sign in to comment.