Skip to content

Commit c6069bc

Browse files
Add files via upload
1 parent aae1df5 commit c6069bc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ml.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pandas
2+
dataset=pandas.read_csv('/root/Salary_Data.csv')
3+
y=dataset['Salary']
4+
x=dataset['YearsExperience']
5+
from sklearn.linear_model import LinearRegression
6+
x=x.values
7+
x=x.reshape(-1,1)
8+
model=LinearRegression()
9+
model.fit(x,y)
10+
exp=input('\t\t\t\tEnter Value to Predict from DataSet :- ')
11+
print('\t\t\t\tPredicted Value is :- ', end='')
12+
print(model.predict([[float(exp)]]))
13+
print()

0 commit comments

Comments
 (0)