Training a ML model inside Docker Container.
Abhinav Singh
Associate Data Engineer at Onix | 3×GCP Certified | 1× AWS Certified | 1× Azure Certified
!! ?????????? ?????????????????????? !!
?? This article is based on TASK-01 of Machine Learning program running under Linux World MLOps Summer Internship 2021 ??
Task Description :-
?? Pull the Docker container image of CentOS image from DockerHub and create a new container
?? Install the Python software on the top of docker container
?? In Container copy the date-set file from host to docker container.
?? Install required libraries required to load ML model
?? Create and Run the python code for prediction.
=================================================================
STEP : 1
- Installing Docker on RHEL8
??Install docker using “yum install docker-ce” . To check detail about this step check the google Doc link given below:
- Checking status of docker whether it is running or not:-
??“systemctl status docker” command shows the status of docker.
- Pull the Docker container image of CentOS image from DockerHub and create a new container
??“docker pull centos:8” is used for pulling image.
??“docker run -it __name CONTAINERNAME centos:latest” for launching container.
STEP : 2
- Install the Python software on the top of docker container
??python can be installed using “yum install python3” command.
STEP : 3
- Copying the data set (.csv file) from local host to docker container using which we train our ML model.
??“docker cp <src> <container_name>:<dest>” is used for copying from local host to container.
STEP : 4
- Install required libraries required to load ML model :-
??All required libraries can be installed from the following command: pip3 install <name of library>
STEP : 5
- Finally create python code for prediction.
??Below is the python code for our ML model :-
??The Output of our Machine Learning Model :
Getting above output is the main task of our ML model. (Y=c+wX)
I hope this article helps you in learning something new . I tried my level best to justify each and every point of task .
Thanks For your time for reading ??