Question about R, mlflow and models...

I am trying to register a R model using the crate flavor in mlflow, and I have some doubts.

I have been able to log and register the model. I have also tested that I can load the model again and use it for prediction (inputs/outputs are data.frames).

I was thinking... that would mean I should write the inference part in R, wouldn't it?

How could I deploy the model so it can be served as a general web service (REST API), not actually relying on final users to use R?

I'm now quite tired, but the only solution I have found is to maybe use plumbr to expose an API receiving a JSON with all the inputs as simple types, and generating the data.frame inside, as I have always done.

Do you think this can be done directly using a crated function? Has anybody done something similar?

Thanks in advance. I think this is a discussion worth having, as there is a lack of documentation on this topic for us R users. :(

@keyeoh I've looked a lot at MLFlow, and the current support for R doesn't work great for anything beyond a quite simple function.

If what you want is a REST API, have you looked at vetiver?
vetiver.posit.co/

@juliasilge Thanks!

I really like the approach of vetiver and pins but mlflow is the official tool in my company. :-S

Maybe I can push a little bit to improve support for the R ecosystem. :-)

With mlflow, I have been able to serialize a model using create() and to register it. Doubts on serving the model rose as a consequence of the lack of documentation regarding mlflow & R, as you said.

I'll keep working on it. Thanks a lot, Julia! :)

@keyeoh If you are a Databricks customer (I know many folks trying to use MLFlow are) I recommend letting your rep know that you would like to see better support for R models.

Follow

@juliasilge Surprisingly, I'm currently not! :) Mlflow was chosen as a standalone tool, not as part of the Databricks ecosystem.

Maybe I can push and argue that for using vetiver, all I need is for them to let me have some space in S3. But our data crew is now very python-oriented.

In the meantime, as I have been able to log my model , I think I'll try to take this approach as a first MVP. I'll do some research...

Thanks again for your feedback!

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.