image_output_1.png
from sklearn import linear_model

import matplotlib.pyplot as plt

import pandas

import seaborn as sns

df = pandas.read_csv('../input/mobile-price-classification/train.csv')

corr = df.corr()

x = df[['clock_speed', 'fc', 'px_height', 'px_width', 'three_g', 'four_g', 'ram']]
y = df['price_range']
regr = linear_model.LinearRegression()
regr.fit(x.values, y)

predicted = regr.predict([[2.0, 10, 1500, 1200, 1, 1, 2000]])
print('predicted with 2.0 clock speed, 10 front camera, 1500x1200 px screen , have 3g and 4g and 2000 ram :', predicted)
predicted = regr.predict([[2.0, 10, 1500, 1200, 1, 1, 4080]])
print('predicted with 2.0 clock speed, 10 front camera, 1500x1200 px screen , have 3g and 4g and 4080 ram :', predicted)