Salary Prediction Model Under Docker Us Machine Learning

Salary Prediction Model Under Docker Us Machine Learning

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

---------------------------------------------------------------------------------------------------------------

First of all you need to install docker inside the Linux Operating System, in my case i'm using RedHat Enterprise 8 based on Linux Kernel. Follow the steps below to install Docker inside RHEL8 -

[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost ~]# vim docker_ce.repo        

Now you need to write the repo configuration for yum to install the docker-ce.

[root@localhost ~]# yum repolist
[root@localhost ~]# yum install docker-ce --nobest -y
[root@localhost ~]# systemctl start docker
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld        


No alt text provided for this image

Systemctl command will start the docker and stop the firewalld temporary. setenforce 0 will disable the SELinux so that container have proper connectivity with the internet.

[root@localhost ~]# docker pull centos:latest
        

It will pull the latest image of centOS from the dockerhub.com, here centos is image name and latest is tag of image.

[root@localhost ~]# docker run -it --name task1 centos:latest        
No alt text provided for this image

It will launch the docker container name as task1 from centos image which i have pulled earlier. -it will help in getting the interactive terminal of docker container.

No alt text provided for this image

It will install the python version 3 inside the container so that we can work on machine learning using python. It will also install pip3 to download python modules.


[root@645938c93574 /]# pip3 install pandas        


No alt text provided for this image
[root@645938c93574 /]# pip3 install joblib
[root@645938c93574 /]# pip3 install sklearn
        
No alt text provided for this image

Now all the required modules are installed in the docker container that is required by the ml for salary prediction model.

Now make a file task1.py


No alt text provided for this image

Here pandas module help in loading the data-set use by the machine learning model for prediction. Linear Regression is used to predict the salary based on the experience of the Employee.

Joblib help in saving the model created by through machine learning. It will save the model in hard disk so next time we have to just load the model for any prediction. Save this file and run the below command.

It will run the file using the python and create the model and save in the same folder.

It will create the app of salary predictor for the company manager so that he can decide the salary based on the Experience of Employee.

No alt text provided for this image

As you can see when you run this app it will ask for the Employee Experience.


To view or add a comment, sign in

More articles by RISHAV KUMAR ROY

  • Importance of JavaScript in Industry!

    What is JavaScript, its features, frameworks, applications & industry usecases. ◆ What is JavaScript ? JavaScript is a…

  • CONFUSION MATRIX IN CYBER CRIME..!!

    WHAT IS CYBER CRIME ? Cybercrime is vastly growing in the world of tech today. Criminals of the World Wide.

  • GUI based Application inside DOCKER Container!!

    Task Description 📄 :- 📌 GUI container on the Docker 🔅 Launch a container on docker in GUI mode 🔅 Run any GUI…

  • Launch an EC2 Instances

    Using all the below steps to launch an instances and attach an EBS Volume :- 1. Create a key pair 2.

  • Industry Use Cases of Neural Networks

    What is Neural Networks? Neural networks, also known as artificial neural networks (ANNs) or simulated neural networks…

  • DOCKER INTEGRATION WITH ANSIBLE

    What is Ansible ? Ansible is an open-source software provisioning, configuration management, and application-deployment…

  • Benefits which MNC's are getting from AI/ML.

    Artificial intelligence (AI) is a wide-ranging tool that enables people to rethink how we integrate information…

  • Docker+HTTPD+Python

    This Blog is about: Installing and Setting up Docker Running a Docker Container with Exposed Port Setting up httpd…

  • Expanding and reducing the capacity of Static Partitions

    What is a static partition? Static(Fixed) Partitioning: ->According to geek for geeks This is the oldest and simplest…

  • Automating LVM Partition using Python-Script

    Automation include higher production rates and increased productivity, more efficient use of materials, better product…

Explore content categories