What is the easiest way to deploy a machine learning model developed in R for production?

# Deployment of machine learning model developed in R for production

**dhillon_81**#2

i think it depends what you wanna achieve out of it, e.g if it is regression, you just need weights to predict. if it is complex algorithm, you can use POJO, which can easily be extracted using h2o package for almost all algorithm.

Additionally you can also make use of shiny.

**Lesaffrea**#3

Hi @Arihant

it really depends of your productive environment, for example if you have to run it on regular basis with new data coming from let say one SQL Data base, you first build a layer which does the query to the sql and prepare one data frame or data table then load your model that you save as one RDS and call your model.

You can build one more complicated layer with reporting of the results for example or pushing back to the DB (of BI )

Hope this help

Best regards

Alain

**Arihant**#4

Thanks . How about deploying Random Forest , SVM , Xgboost model developed in R in Production . Which cloud to use and on that also how deployment happens ?

**Arihant**#5

Thanks . How about deploying Random Forest , SVM , Xgboost model developed in R in Production ?

**deepak0singh**#6

@Lesaffrea that is really a nice explanation.

But what if i just have the R script of the MOdel and i want deploy it to the live scenario .

Where in the volume flow in and my model makes prediction with the volume .

Any suggestion on this will be really very helpful…

Thanks …

Easiest way is to deploy your production model using “PLUMBER”, a library that has been written specifically for R.

For more details, refer to this link.

Peace!

**cof**#10

There is now another very interesting alternative converting your model to SQL with this new package. By converting it to SQL makes it fully compatible with many backend production solutions.

https://cloud.r-project.org/web/packages/tidypredict/vignettes/randomForest.html

Regards,

Carlos.