Тёмный

Deploy R Model as Web Service - 3 EASY Ways 

Sascha Dittmann
Подписаться 3,1 тыс.
Просмотров 13 тыс.
50% 1

Deploy R Model as Web Service - 3 EASY Ways.
In this video we're going to discover 3 easy ways on how to deploy machine learning model in production as REST APIs.
I'm regularly asked by my customers how they can deploy R code in production.
Or more precisely, how to deploy R models in production.
Here's what I cover:
00:00 | Intro
00:42 | Introduction to plumber
01:44 | Training the machine learning model
02:50 | Using plumber to create an API for the model
03:59 | Testing the plumber API
04:25 | Using Docker to host the plumber API
05:38 | Testing the deployed plumber API
06:28 | Using Machine Learning Server to host the model
09:07 | Introduction to the .NET Core app to test the APIs
10:23 | Testing the APIs with the .NET Core app
10:42 | Intro to SQL Server/Azure SQL Database ML Services
12:25 | Training the models and storing them in a SQL table
14:50 | Running predictions in the SQL Database
There are certainly more ways to deploy R model as API, but this should serve as a starting point.
If you know of any additional ways, please let me know in the comments.
I would like to publish another video about this topic.
For cloud computing, I use Microsoft Azure, but all the options I show here also run on-premises as well as with any other cloud provider.
If you wan't to have a look at the final code, please check out my GitHub repository:
github.com/SaschaDittmann/mac...
🔔 Subscribe for more free data analytics videos: ru-vid.com...
And don't forget to click the bell so you don't miss anything.
💪 Share this video with a RU-vidr friend: • Deploy R Model as Web ...
📢 If you enjoyed this video help others enjoy it by adding captions in your native language -
ru-vid.com_vid...
Watch my most recent upload: bit.ly/2OihAlj
• Uploads from Sascha Di...
🚀 Tools and services I use in this video:
R plumber:
www.rplumber.io/
Microsoft Machine Learning Server
www.microsoft.com/sql-server/...
Microsoft SQL Server R Services:
docs.microsoft.com/en-us/sql/...
Azure SQL Database Machine Learning Services with R:
docs.microsoft.com/en-us/azur...
R Studio:
rstudio.com/
Visual Studio Code:
code.visualstudio.com/
Azure Data Studio:
docs.microsoft.com/en-us/sql/...
✅ Recommended playlists:
Data Science
• Data Science
✅ For business inquiries contact me at CloudBlog@gmx.de
✅ Let's connect:
Watch me Live on Twitch: / saschadittmann​
Join our Discord: / discord
Twitter: / saschadittmann
Facebook: / datadrivendev
Instagram: / saschadittmann
LinkedIn: / saschadittmann
GitHub: github.com/SaschaDittmann
DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps support my channel and allows me to continue making awesome videos like this. Thank you for the support!
#rstats #MachineLearning #Operationalization

Опубликовано:

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 51   
@SaschaDittmann
@SaschaDittmann 3 года назад
Hope you enjoy this video! Here's what I cover: 00:00 | Intro 00:42 | Introduction to plumber 01:44 | Training the machine learning model 02:50 | Using plumber to create an API for the model 03:59 | Testing the plumber API 04:25 | Using Docker to host the plumber API 05:38 | Testing the deployed plumber API 06:28 | Using Machine Learning Server to host the model 09:07 | Introduction to the .NET Core app to test the APIs 10:23 | Testing the APIs with the .NET Core app 10:42 | Intro to SQL Server/Azure SQL Database ML Services 12:25 | Training the models and storing them in a SQL table 14:50 | Running predictions in the SQL Database If you wan't to have a look at the final code, please check out my GitHub repository: github.com/SaschaDittmann/machine-learning-in-practice/tree/master/deploy-r-models
@SaschaDittmann
@SaschaDittmann 4 года назад
There are certainly more ways to deploy R-based machine learning models as API. Therefore I would like to publish another video on this topic. What other ways do you know to roll out R scripts as Web Service?
@shivamchowdhary8907
@shivamchowdhary8907 3 года назад
hey... this is amazing thanks for this !!
@SaschaDittmann
@SaschaDittmann 3 года назад
I am glad that you like my videos. Are there any other topics you would like to see on my channel?
@salvadorgutierrez7373
@salvadorgutierrez7373 3 года назад
Awesome! Pointed me in the right direction. Thanks!
@SaschaDittmann
@SaschaDittmann 3 года назад
Thanks! I really appreciate what you think! What else do you think I could cover?
@salvadorgutierrez7373
@salvadorgutierrez7373 3 года назад
@@SaschaDittmann I'll be checking out your other videos, I'm a backend Engineer and completely new to machine learning. I'm looking for a solution to detect anomalies in real time. (Given a data point, compare it with that users historical data) So far I have learned about R and it's popularity, so I'll start with that. My second question that I have been trying to figure out (that you just answered) is how does one get this deployed as a service? Just learned about supervised vs unsupervised (I believe unsupervised would be my first approach) Next on my discovery list: what are the mechanisms for updating the models? This video answered my question perfectly.
@SaschaDittmann
@SaschaDittmann 3 года назад
@@salvadorgutierrez7373 Great! I'm glad that I was able to help you with that! My goal with this channel is to help Data- & Software-Engineers to get started with Big Data & Machine Learning
@ranieribubans1068
@ranieribubans1068 3 года назад
This is the most explanatory video about the subject!!
@SaschaDittmann
@SaschaDittmann 3 года назад
Thanks! I really appreciate what you think! What else do you think I could cover?
@ranieribubans1068
@ranieribubans1068 3 года назад
@@SaschaDittmann I think it would be interesting if you can explain how to build a shiny app that takes data from the API you've deployed
@zegpi1821
@zegpi1821 3 года назад
Hi Sacha, I'm a machine learning engineer from Chile. I came for plumber, but stayed for the rest. I had no clue about all those approaches, so thank you very much.
@SaschaDittmann
@SaschaDittmann 3 года назад
Thanks! I really appreciate what you think! Are you looking for other topic, which I could cover on this channel?
@zegpi1821
@zegpi1821 3 года назад
@@SaschaDittmann Now that you mention it, I would really appreciate a guide/tutorial on making an executable from a shiny app.
@SaschaDittmann
@SaschaDittmann 3 года назад
Great idea! I'll add this to my list and see what I can do.
@The1enzo2
@The1enzo2 3 года назад
this was awesome
@SaschaDittmann
@SaschaDittmann 3 года назад
Thanks! I really appreciate what you think! What else do you think I could cover?
@calebterrelorellana2478
@calebterrelorellana2478 4 года назад
Im analytics consultant from Perú, thanks a lot!!!!!!
@SaschaDittmann
@SaschaDittmann 4 года назад
I am glad that you like this video. Are there any other topics you would like to see on my channel?
@matthewbayly4300
@matthewbayly4300 3 года назад
Hey great video. Perhaps another option (although limited use cases) might be to simply run R scripts as CRON jobs or via Windows Task Scheduler
@SaschaDittmann
@SaschaDittmann 3 года назад
Great idea! Thanks for raising this option!
@salmesfer52
@salmesfer52 4 года назад
Thanks alot
@SaschaDittmann
@SaschaDittmann 4 года назад
You're welcome! I'm glad that you like my video. Are there any other topics you would like to see on my channel?
@salmesfer52
@salmesfer52 4 года назад
@@SaschaDittmanndata preparation tricks with R. 👍
@dyegocoelhodesouza6654
@dyegocoelhodesouza6654 3 года назад
I'm Brazilian, thanks for sharing. R community is small here.
@SaschaDittmann
@SaschaDittmann 3 года назад
True. I plan to share more of those videos soon.
@philipsalvo
@philipsalvo 2 года назад
Hey Sascha - doesn’t your plumber file need to load caret before it can use the predict function?
@industrialEnginnering
@industrialEnginnering 4 года назад
please if you may allow help us with mounting static File Routers, cookies and security issues and surely the part of "02b-deploy-aci.sh" file. it would be great if you explain us req and res values that plumber documentation uses as parameters I really sturggled with those parts
@SaschaDittmann
@SaschaDittmann 4 года назад
I'm sorry, but I don't quite see how I can help you with that. Please drop me an email with more details.
@lexh7714
@lexh7714 4 года назад
any example for deployment in azure or aws with R?
@SaschaDittmann
@SaschaDittmann 4 года назад
Yes, I planned to create a video converting the R SDK for Azure ML Services.
@DanielWeikert
@DanielWeikert 4 года назад
Hi Sascha, thanks a lot for your great presentation yesterday. Very interesting. Could you maybe give me some info on how to get started learning to use Tensorflow/Pytorch on Azure? (or maybe create videos here ;) ) I am not that familiar with how Azure works so far. Thanks and best regards
@SaschaDittmann
@SaschaDittmann 4 года назад
Hi Daniel, I'm glad that you liked my session during the European Data & AI Hub Meetup in Frankfurt! The easiest way for me to start with TensorFlow, PyTorch, etc. were video courses from training providers like Pluralsight (pluralsight.pxf.io/xaxkv), coursera (www.coursera.org/), edX (www.edx.org/) and others. But nowadays, there are plenty of good channels here on youtube too, as well as the official framework docs.
@nathanthompson8652
@nathanthompson8652 Год назад
Hi, why is it @post rather than @get for the manual transmission function using plumber (3mins 25 secs) ? also, do the functions not need to be named? also, how is this actually hosted on the web? that part went really fast so i'm really not sure if this is what i am looking for or not.... is that not the main part?
@christiansetzkorn6241
@christiansetzkorn6241 3 года назад
Thanks. Can someone please be so kind and detail options to secure option 1 (plumber in azure container)?
@SaschaDittmann
@SaschaDittmann 3 года назад
Hey Chris, please checkout these docs for more details: www.rplumber.io/articles/security.html You can also use some Azure Services, e.g. Azure Firewall, etc.
@christiansetzkorn6241
@christiansetzkorn6241 3 года назад
Thanks. We cannot afford prof. RStudio Server to get security. Currently investigating Azure options. Thanks.
@christiansetzkorn6241
@christiansetzkorn6241 3 года назад
@@SaschaDittmann could you please be a bit more specific on: Azure Services, e.g. Azure Firewall? I can easily deploy a docker image in an ACI but this is insecure (i.e. the restful endpoint is accessible via the Internet by anyone).
@korbizac18
@korbizac18 2 года назад
Hey could it be that the code is not working anymore? Because when i set all the declarations and run it the bash window just closes without running more than the questions if nothing is declared
@NunoNogueira
@NunoNogueira 3 года назад
If these are the easy ways, I'm scared to death! I've built a simple recommender system in R and need to deploy it as an API in my Linux server. It all works very well on a local machine, but I can't find out how to build an API. I thought I'd just have to upload the script somewhere into the server, but by your explanation, it's necessary Azure, Docker, SQL Server, Plumber, etc. Where should I start!? Thanks for any help!
@SaschaDittmann
@SaschaDittmann 3 года назад
Hi Nuno! In that case, all you need is a framework like plumber. The other options don't really apply to what you want to do.
@NunoNogueira
@NunoNogueira 3 года назад
@@SaschaDittmann thank you so much for your help, I'll do some research around Plumber.
@SaschaDittmann
@SaschaDittmann 3 года назад
@@NunoNogueira You‘re welcome! If you have any questions, just let me know.
@harishnagpal21
@harishnagpal21 3 года назад
Hi Sascha, when I run your code, I get below error. I tried to google it, but could not find any info. > pr$run(port=8000) Error: 'is_present' is not an exported object from 'namespace:lifecycle'
@SaschaDittmann
@SaschaDittmann 3 года назад
Are you running my sample code or are you trying to host you own model?
@harishnagpal21
@harishnagpal21 3 года назад
Thanks. I updated lifecycle and it worked.
@mitrabhanuroutkali
@mitrabhanuroutkali 4 года назад
I don't understand the 13th line cat swagger........where does json come from?
@SaschaDittmann
@SaschaDittmann 3 года назад
Hi Mitrabhanu, the content of the swagger file is generated by plumber in line 8, converted to JSON in line 12 and written to disk in line 13 using the filename 'plumber-swagger.json' I hope that helps to explain the code.
@dinasamir2778
@dinasamir2778 3 года назад
Can we use Google cloud to deploy the model?
@SaschaDittmann
@SaschaDittmann 3 года назад
I never tried it, but this should also work with GCP, e.g. Cloud Run, GKE, etc.
Далее
🎙ПЕСНИ ВЖИВУЮ от КВАШЕНОЙ🌇
3:16:26
Best exercises to lose weight ! 😱
00:19
Просмотров 14 млн
R vs Python
7:07
Просмотров 313 тыс.
Deploy a model for LEGO sets with Docker
27:28
Просмотров 4,2 тыс.
20 R Packages You Should Know
30:42
Просмотров 39 тыс.
Building and Deploying robust APIs in R using Plumber
49:25