A Machine Learning Model inside the Container

docker --version
This command gives information about our docker version
systemctl start docker
docker pull centos
docker run -it --name centos
yum install python3
pip3 install numpy
pip3 install pandas
pip3 install scikit-learn
docker cp Salary_Data.csv mlmod:/root/project
import pandas as pd 
import numpy as np
dataframe= pd.read_csv('Salary_Data.csv')
x = dataframe['YearsExperience'].values.reshape(30,1)
y = dataframe['Salary']
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(x,y)
import joblib
joblib.dump(model,'Salary_model.pkl')
import joblib
model=joblib.load('Salary_model.pkl')
num=float(input("years of experience:"))
predict=model.predict([[num]])
print(predict)
Our model is predicting

--

--

--

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

Recommended from Medium

ML PAPER: NEURAL STYLE TRANSFER — TL;DR

From Impossible to Irreplaceable: BERT in NLP

Google’s End-to-End ML Platform

A Handwritten Introduction to Linear and Non-Linear Least-Square Regression, ft.

Object Recognition using CNN model

Recommendation System

Extracting Features from an Intermediate Layer of a Pretrained ResNet Model in PyTorch (Hard Way)

どんな麺ですか?Training a Convolutional Neural Net (CNN) to recognise Japanese noodles

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
Aaryan

Aaryan

More from Medium

Predicting Job-Switching Behaviour by Employees through Random Forest Model

LeetCode 206. Reverse a Linked List

Think 3 cup trick

FORECASTING THE ELECTRICITY DEMAND USING MACHINE LEARNING ALGORITHMS.

How to Merge Cells and Extract Text in Excel