Created
March 9, 2021 09:19
-
-
Save nduprincekc/ed70854c4eb10e1ba532b256b0153dbd to your computer and use it in GitHub Desktop.
How to predict iphone price
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas | |
| from sklearn.linear_model import LinearRegression | |
| user = input('enter the price of iphone you want to know the predicted price: ') | |
| data = pandas.read_csv('iphone_price.csv') | |
| model = LinearRegression() | |
| ode = LinearRegression() | |
| ode.fit(data[['version']], data[['price']]) | |
| print(ode.predict([[user]])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version | price | |
|---|---|---|
| 1 | 499 | |
| 2 | 599 | |
| 3 | 599 | |
| 4 | 649 | |
| 5 | 649 | |
| 6 | 749 | |
| 7 | 769 | |
| 8 | 799 | |
| 9 | 949 | |
| 10 | 999 | |
| 11 | 1249 | |
| 12 | 1399 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to predict iphone price