Skip to content

Instantly share code, notes, and snippets.

@nithyadurai87
Created September 24, 2018 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nithyadurai87/d94507f9052a6120dce5f20e31806cea to your computer and use it in GitHub Desktop.
Save nithyadurai87/d94507f9052a6120dce5f20e31806cea to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
x = [[6], [8], [10], [14], [18]]
y = [[7], [9], [13], [17.5], [18]]
model = LinearRegression()
model.fit(x,y)
plt.figure()
plt.title('Pizza price statistics')
plt.xlabel('Diameter (inches)')
plt.ylabel('Price (dollars)')
plt.plot(x,y,'.')
plt.plot(x,model.predict(x),'--')
plt.axis([0,25,0,25])
plt.grid(True)
plt.show()
print ("Predicted price = ",model.predict([[21]]))
@ShanBharath
Copy link

Hi Mam, I'm using pycharm. For me, I'm not getting the prediction price. Could you please help me.

@ShanBharath
Copy link

I'm getting the prediction price. Thank you

@k7ganesh
Copy link

k7ganesh commented Jul 8, 2020

Dear Madam,
I personally thank you for your effort to write a book for machine learning in Tamil.
I am new to this field. I tried to learn this application for geospatial application.
your book helps me to understand machine learning concepts
Once again I Thanks for your effort.

@crthilahar
Copy link

Dear Mam, Your work is marvelous to our future young generation. Hats off to Tamil Kaniyam and Team.
Keep it up. I will support always to kaniyam. Nantri.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment