kapelner / bartMachine

An R-Java Bayesian Additive Regression Trees implementation
MIT License
62 stars 27 forks source link

Using bartMachine inside a package #42

Closed bakaburg1 closed 2 years ago

bakaburg1 commented 2 years ago

Hello!

I am trying to use bartMachine as part of a larger package, but I'm struggling against Java memory management.

When used inside a package, I never run library(bartMachine) and even if the java.parameters option is set up, the information is never passed to the java machine underneath.

Trying to emulate the loading of the package I run:

libname <- list.files(R.home(), 'library', full.names = T)
rJava::.jpackage('bartMachine', lib.loc = libname)
rJava::.jpackage('bartMachineJARs', lib.loc = libname)

after setting the memory option. But nevertheless running rJava::.jcall(rJava::.jnew("java/lang/Runtime"), "J", "maxMemory") / 1e9 after it shows me the default amount of memory.

To give more info, this is my workflow:

Is it possible to use bartMachine inside a package without loading and attaching it?

kapelner commented 2 years ago

This is clearly a R-Java-rJava problem. I'm sorry.