Convert h2o model to non-h2o

I know that it is possible to export / import the h2o model that was previously prepared.

My question is: is there a way to convert the h2o model to non-h2o (which only works in regular R)?

I mean, I don’t want to run the h2o environment (JVM), because I know that prediction on a trained model is just matrix multiplication, applying an activation function, etc.

Of course, it would be possible to extract the weight manually, etc., but I want to know if there is a better way to do this.

I do not see any previous SA posts about this issue.

+5
source share
1 answer

No.

Remember that R is just a client making API calls: the algorithms (these matrix multiplications, etc.) are implemented in Java.

What they offer is POJO, which you ask for, but in Java. (POJO stands for Plain Old Java Object.) If you call h2o.download_pojo () on one of your models, you will see that it is quite simple. Is it even possible to write a script to convert it to R code? (Although it would be better if you went into this problem to convert it to C ++ code and then use Rcpp!)

Another option is to export weights and prejudices, in the case of deep learning, to implement your own activation function and use them directly.

But personally, I never found that the Java side is a bottleneck, whether from the point of view of dev ops (ease of installation) or computation (Java code is well optimized).

+4
source

All Articles