Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linear_tree parameter not recognised by R version of LightGBM #4001

Closed
SpeckledJim2 opened this issue Feb 19, 2021 · 5 comments
Closed

linear_tree parameter not recognised by R version of LightGBM #4001

SpeckledJim2 opened this issue Feb 19, 2021 · 5 comments

Comments

@SpeckledJim2
Copy link

SpeckledJim2 commented Feb 19, 2021

Description

Warning message: [LightGBM] [Warning] Unknown parameter: linear_tree

Reproducible example

library(lightgbm)
x <- matrix(data = sample(rnorm(100L), size = 100L), ncol = 1L)
y <- 2L * x + runif(nrow(x), 0L, 0.1)
dtrain <- lgb.Dataset(data = x, label = y)

lgb_parameters <- list(
objective = "regression"
, linear_tree = TRUE # this parameter isn't recognised by lightGBM
, verbose = -1L
, metric = "mse"
, seed = 0L
, num_leaves = 2L
, bagging_freq = 1L
, subsample = 1.0
)

bst_linear <- lgb.train(
data = dtrain
, nrounds = 10L
, params = lgb_parameters
, valids = list("train" = dtrain)
)

Environment info

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

lightgbm_3.1.1 R6_2.5.0, installed from CRAN using install.packages('lightgbm')

Many thanks for creating lightgbm!

@btrotta
Copy link
Collaborator

btrotta commented Feb 19, 2021

@SpeckledJim2 Linear trees are not yet available in the CRAN release. As a workaround you can build the package from source, see: #3910 (comment)

@StrikerRUS
Copy link
Collaborator

@SpeckledJim2
You can subscribe to LightGBM repository releases

image

or to #3872 particularly

image

to be notified about updates.

@SpeckledJim2
Copy link
Author

That's great, all installed and working, thank you!

I will raise another issue when I have created an example because when using predict() with predcontrib = TRUE the feature contributions no longer sum to prediction for the row if linear_tree = TRUE . I think the feature contributions aren't using the linear model in the leaves, they are still using the constant value, even when linear_tree = TRUE.

@StrikerRUS
Copy link
Collaborator

StrikerRUS commented Feb 19, 2021

I will raise another issue

Could you please check this one #3998? I guess it is the same case.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants