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
step 2:
check status of docker
#systemctl status docker
if services are not enabled run
#systemctl start docker
step 3:
download the latest centos image from docker hub
#docker pull centos:latest
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.
STEP 5:
Installing python3 on centos container
Step 6:
Now installing all required packages
#pip3 install numpy
#pip3 install pandas
#pip3 install sklearn
step 7:
copying dataset from base os to centos container
#docker cp /root/salary.csv MyOs:/ML
Step 8:
Code to run for ML model
Final Step:
#python3 model.py
Here is the complete output of our ML model
THANK YOU
This content originally appeared on DEV Community and was authored by bhat sumair
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.