We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aae1df5 commit c6069bcCopy full SHA for c6069bc
ml.py
@@ -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