Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 27, 2021 05:50 am GMT

Deploy Machine learning(ML) model in Docker container.

First we will understand what is machine learning(ML) and Docker.
Machine learning:- Machine learning is an application/program or subset of AI that allows machines to learn from data without being programmed explicitly.
Docker:-It is a tool that provides platform to create, run and deploy the applications by using containers. Docker is a bit like a virtual machine rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they're running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.
Here are the complete steps:-
Step 1:
Install docker
#yum install docker-ce --nobest
if you have already installed check for query
#rpm -q docker-ce
Alt Text
step 2:
check status of docker
#systemctl status docker
if services are not enabled run
#systemctl start docker
Alt Text
step 3:
download the latest centos image from docker hub
#docker pull centos:latest
Alt Text
step 4:
deploy a latest centos new container
#docker run -it --name MyOs centos:latest
by passing -it arguments provides terminal and we can interact with it.
Alt Text
STEP 5:
Installing python3 on centos container
Alt Text
Step 6:
Now installing all required packages
#pip3 install numpy
#pip3 install pandas
#pip3 install sklearn
Alt Text
step 7:
copying dataset from base os to centos container
#docker cp /root/salary.csv MyOs:/ML
Alt Text
Step 8:
Code to run for ML model
Alt Text
Final Step:
#python3 model.py
Here is the complete output of our ML model
Alt Text
THANK YOU


Original Link: https://dev.to/bhatsumair/deploy-machine-learning-ml-model-in-docker-container-3d8m

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To