Deploying a Machine Learning Model in a Docker Container

Summer Program 2021 — #Task1
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 copy/create machine learning model which you have created in jupyter notebook.
We are provided with a dataset which is filled with historical data/ observations.

Step 1: Write a code to train the model and get a prediction
https://github.com/Ravenblaze128/Summerprogram-lw/blob/main/Task1/Salary_LinearRegression.ipynb
Step 2: Check if the Docker is available or not

if unavailable, use
yum install docker-ce
Step 3: Download CentOS latestimage from Docker Hub

Step 4: Create a Container with the help of CentOS image

Step 5:Download Python in the Container

Step 6: Install the Necessary libraries for the Python
pip3 install numpy
pip3 install pandas
pip3 install scikit-learn
Step 7: Copy the ML Model from the host to the container
while at host, use below command twice to copy the model and .csv file, by changing the names.
docker cp <model_name> <container_name>:/<model_name>
Step 8: Create a Model file
log back to the container terminal by using the command
docker attach <ContainerName>
and open a vi editor with .py ext.,

Step 9: Run the Model
Run the model by using the command,
python3 model.py
Type in the Number of years of Experience,
