Predicting Salary Using Linear Regression Model On Top of Docker Container

Predicting Salary Using Linear Regression Model On Top of Docker Container

👉 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

No alt text provided for this image

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
No alt text provided for this image

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

No alt text provided for this image

THANKS FOR READING...

VINAYAK KUMAR

OPTUM (JENKINS | JAVA | SPRING | SPRING BOOT | KUBERNETES | GIT | HIBERNATE | JDBC | MAVEN | SQL)

3y

Great work sir

To view or add a comment, sign in

More articles by Pranesh Prashar

Insights from the community

Others also viewed

Explore topics