suiji / Arborist

Scalable decision tree training and inference.
Other
82 stars 14 forks source link

ForestFloorExport does not work. #30

Closed hadjipantelis closed 5 years ago

hadjipantelis commented 7 years ago

Hello, thank you for making Rborist, it is an extremely useful R-package. Unfortunately, ForestFloorExport does not work. The documentation is also missing commas (,) when indexing the iris dataset and has some wrong capitalisation (ForestFloor instead of forestFloor).

data(iris)
rb <- Rborist(iris[,-5], iris[,5])
ffe <- ForestFloorExport(rb)

library(forestFloor)
forestFloor(ffe)
Error in forestFloor(ffe) : 
  The rf.fit argument is not valid, should be 'randomForest' or 'train'

My sessionInfo() is as follows:

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] forestFloor_1.11.1 Rborist_0.1-7      Rcpp_0.12.11      

loaded via a namespace (and not attached):
 [1] rgl_0.98.1          kknn_1.3.1          lattice_0.20-35    
 [4] randomForest_4.6-12 digest_0.6.12       mime_0.5           
 [7] R6_2.2.2            grid_3.4.0          xtable_1.8-2       
[10] jsonlite_1.5        magrittr_1.5        Matrix_1.2-9       
[13] tools_3.4.0         htmlwidgets_0.8     igraph_1.0.1       
[16] shiny_1.0.3         httpuv_1.3.5        compiler_3.4.0     
[19] htmltools_0.3.6     knitr_1.16         
suiji commented 7 years ago

Thank you for reporting the problem, and for using the package. I will tend to the documentation errors shortly, and report back to you. It appears that the ForestFloor package may be screening its arguments to have type 'randomForest' or 'train'. Rborist, however, creates objects of type 'Rborist'. I will reach out to ForestFloor's author to correct this and reallow 'Rborist' objects to be passed. Please also contact the author yourself, as this is not a problem solvable within the Rborist code. It would not be correct, for example, to attempt to remedy the problem by making class 'Rborist' be a subclass of 'randomForest'.

hadjipantelis commented 7 years ago

Hello @suiji, thank you for the quick reply. I will report the issue to the devs of forestFloor too; I appreciate that such "inter-package" functionality can be brittle at times.

suiji commented 7 years ago

Changes to the documentation are now in the source tree. Thank you for providing the corrections.

We'll see what happens with ForestFloor support. I contacted the author directly, but so far have not heard anything.

Leaving this open for a while.

suiji commented 5 years ago

ForestFloorExport is deprecated in 0-2.0, replaced by a general-purpose Export utility.

Special-purpose enhancements of Export can be introduced at will, provide downstream packages publish a specification.