machinelearning model on top of docker

Jun 5, 2021

docker install

configure yum

docker]
baseurl = https://download.docker.com/linux/centos/7/x86_64/stable/
gpgcheck = 0
name = this is my docker

yum install ddocker-ce — nobest -y

pull docker image

docker pull centos:latest

run docker image

docker run -it — name os1 centos:latest

docker attach os1

install python3 and libaries

yum install python3

pip3 install panddas matplotlib sklearn joblib

2.lets create a ml model

import pandas
dataset=pandas.read_csv(‘Salary_Data.csv’)
x=dataset[‘YearsExperience’]
y=dataset[‘Salary’]
x=x.values.reshape(-1,1) #converting into numpy format because we
#need a 2-D data from sklearn.linear_model import LinearReg
from sklearn.linear_model import LinearRegression
model=LinearRegression()
model.fit(x,y)
p=int(input(“enter your experience to predict salary”))
out=model.predict([[p]])
print(out)

lets run the model

--

--

No responses yet