Creating Machine Learning Model on Docker Container.

Rishabh
3 min readMay 27, 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 you need to create machine learning model

Let’s start by asking a Important question!!

What is Docker?

According to wikipedia, Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

Docker: Top 7 Benefits of Containerization

⚙Consistent and Isolated Environment
⚙Cost-effectiveness with Fast Deployment
⚙Mobility — Ability to Run Anywhere
⚙Repeatability and Automation
⚙Test, Roll Back and Deploy
⚙Flexibility
⚙Collaboration, Modularity and Scaling

✔Step-1 : Add a Docker repo in “/etc/yum.repos.d/” to install Docker-ce
# vim dockerce.repo
# yum install docker-ce — nobest -y
# systemctl enable docker — now

✔Step-2 : Running the Docker Container using Centos Image

✔Step-3 : Copying my Salary_Data.csv which will be needed to train the Model.
# docker cp Salary_Data.csv mlos1:/
>> Here Salary_Data.csv is my file name which I want to Copy to docker Container
>> “mlos1” is the Container Name
>> Inside Docker we are copying file in ‘/’ Directory

✔Step-4 : Installing Required Software to create a ML model
# yum install python3
# pip3 install pandas
# pip3 install scikit-learn

✔Step-5 : Creating a Basic Linear Regression ML
#yum install vim -y
# vim predict.py

✔Step-6: Running the Final Created Code to predict the Salary as per Years

THANK YOU FOR READING!!

To connect: https://www.linkedin.com/in/rishabh-465a85185/
To Check-out the code: https://github.com/Rishbah-76/Basic_Linear_Regression_model/tree/main

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Rishabh
Rishabh

Written by Rishabh

Student from B.tech 2nd Year, A proud ARTH learner, love new technologies, Curious about many thing, likes to explore places, love eating pizza and much more.

No responses yet

Write a response