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 provi…


This content originally appeared on DEV Community and was authored by bhat sumair

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


This content originally appeared on DEV Community and was authored by bhat sumair


Print Share Comment Cite Upload Translate Updates
APA

bhat sumair | Sciencx (2021-05-27T05:50:27+00:00) Deploy Machine learning(ML) model in Docker container.. Retrieved from https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/

MLA
" » Deploy Machine learning(ML) model in Docker container.." bhat sumair | Sciencx - Thursday May 27, 2021, https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/
HARVARD
bhat sumair | Sciencx Thursday May 27, 2021 » Deploy Machine learning(ML) model in Docker container.., viewed ,<https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/>
VANCOUVER
bhat sumair | Sciencx - » Deploy Machine learning(ML) model in Docker container.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/
CHICAGO
" » Deploy Machine learning(ML) model in Docker container.." bhat sumair | Sciencx - Accessed . https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/
IEEE
" » Deploy Machine learning(ML) model in Docker container.." bhat sumair | Sciencx [Online]. Available: https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/. [Accessed: ]
rf:citation
» Deploy Machine learning(ML) model in Docker container. | bhat sumair | Sciencx | https://www.scien.cx/2021/05/27/deploy-machine-learningml-model-in-docker-container/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.