Predicting Salary Using Linear Regression Model On Top of Docker Container

Actually Today I am Going to predict The Salary On the Basic of Year of Experience

👉 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 machine learning model which you have created in jupyter notebook

Linear Regression

It is Basic model of Supervised Learning(Regression) . It is Used when we want to predict the value of a variable based on the value of another variable. The variable we want to predict is called the dependent variable

Now we Have to Save Model and Put in Docker Container so we can Create Image and Push It in Docker Hub . So we Can Pull that Image Again And Again So we can use it In future.

Docker Hub : — It is A Centralized Repository where we Keep all the Image so anyone Can Download from there And use it.

Docker Provide us Container Which we Provision the OS within the second

Docker Container :- Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

# Step to save the Model

filename = 'final_model'
final = pickle.dump(model, open(filename, 'wb'))

Now we have to Launch Docker Container first we have to pull the centos image :-

docker pull centos:7

After Launching Docker Container We have to install Python3 and keras library in the Docker container.

yum install python3 -y
pip install --upgrade pip
pip3 install keras
pip3 install sklearn

Now we Have to upload our model into Docker Container from our Base OS

docker cp  model_name container_id:/folder 
docker cp ./final_model 12f5ecf40757:/model

Now we can check the whether our model is working fine of not

Here we get the Desired result




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Make the most of WSL

Text Recognition Workflows | How to Use Clarifai’s Advanced Text Workflow

Using Amazon Lambda function with Amazon Lex to create a chatbot

Bill Division

AAD: What I found new in Associate Android Developer Exam ?

Back-Of-The-Envelope-Calculations : Google’s approach to system designing

There’s Only One Way to Learn to Code

There’s only one way to learn to code graphic.

Script for Disk usage

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


More from Medium

Local and Global variables

A framework for Machine Learning application in Sport scenario

Hybrid Spatial Data Structure based on KD-tree and Quadtree

Engineering Design by Genetic Algorithms and Finite Element Methods