MACHINE LEARNING ON DOCKER CONTAINER

Pranita Gughane
3 min readMay 28, 2021

--

What is Machine Learning?

Machine Learning is the science of getting computers to learn and act like humans do, and improve their learning over time in autonomous fashion, by feeding them data and information in the form of observations and real-world interactions.

In simple words, machine learning is the concept of making your machine learning so that it can predict the desired targeted values. To make this happen a machine is trained by creating models and adding experience to it with the help of the dataset.

What is Docker?

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.

Lets start with the task:

  1. Installing docker
Install Docker

Checking status of docker whether it is running or not

“systemctl status docker” command shows the status of docker

Docker service is Running

2. Pulling Docker Image

Pull the Docker container image of CentOS image from DockerHub and create a new container

“docker pull centos:latest” is used for pulling image

“docker run -it __name CONTAINERNAME centos:latest” for launching container.

Commands to pull and create a docker container

3. Install the Python software on the top of docker container

python can be installed using “yum install python3” command

Install python3 inside the container

All required libraries can be installed from the following command:

pip3 install <name of library>

Install python libraries using pip
Install git to clone the repository

4. Clone Git repository

Clone the git repository which contains the dataset and the machine-learning code. ( git URL mentioned at the end of the article)

Clone the repository using git-clone
After cloning the git repository

Running python code for prediction.

Python Code

--

--

Pranita Gughane
Pranita Gughane

Written by Pranita Gughane

"DevOps engineer by day, pipeline enthusiast by night. Ensuring your code deploys smoothly while I’m up at 2 AM wondering if I’ll ever get a full night’s sleep"

No responses yet