gbm-developers / gbm

Gradient boosted models (the old gbm package)
Other
51 stars 27 forks source link

Bug: Quantile regression impossible #64

Closed tnagler closed 9 months ago

tnagler commented 2 years ago
gbm(
    y ~ ., 
    data = data.frame(y = rnorm(100), x = rnorm(100)), 
    distribution = list(name = "quantile", alpha = 0.5)
)

returns

Error in if (object$distribution == "multinomial") { : 
  the condition has length > 1

Session info:

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 20.3

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gbm_2.1.8

loaded via a namespace (and not attached):
[1] compiler_4.2.1  Matrix_1.4-1    tools_4.2.1     survival_3.3-1  splines_4.2.1  
[6] grid_4.2.1      kernlab_0.9-31  lattice_0.20-45
gregridgeway commented 2 years ago

I don't see how gbm() could give that error, but perhaps in relative.influence.R. Make sure you have the latest version. Consider switching to gbm3 instead

tnagler commented 2 years ago

It's indeed in relative.influence.R. Just realized that the error comes when printing the model, fitting actually works.

bgreenwell commented 2 years ago

Thanks for the note @tnagler, I’ll get a fix in shortly! @gregridgeway is gbm3 still being actively developed?

gregridgeway commented 9 months ago

This appears to have been fixed