I have a Java app which needs to perform partial least squares regression. It would appear there are no Java implementations of PLSR out there. Weka might have had something like it at some point, but it is no longer in the API. On the other hand, I have found a good R implementation, which has an added bonus to it. It was used by the people whose result I want to replicate, which means there is less chance that things will go wrong because of differences in the way PLSR is implemented.
The question is: is there a good enough (and simple to use) package that enable Java to call R, pass in some parameters to a function and read back the results? My other option is to have Java spawn R in a Process and then monitor it. Data would be read and written to disk. Which of the two would you recommend? Am I missing the obvious third option?
解决方案
I have successfully used two alternatives in the past.
Pros: probably better performance.
Cons: you have to configure some environment variables and libraries, different in Win/UNIX.
Pros: easy to setup, you don't need to initialize R or link against
any R library, can run in a different machine.
Cons: based on TCP/IP (a server is running), no callbacks from R.
Other alternatives I have never used : RCaller