text_plain_output_1.png
from sklearn.linear_model import LinearRegression

import pandas as pd

import pandas as pd
df_2 = pd.read_csv('/kaggle/input/usa-housing/USA_Housing.csv')
X = df_2[['Avg. Area Income']]
y = df_2['Price']
df_2.head

from sklearn.linear_model import LinearRegression
df_2 = LinearRegression()
df_2.fit(X_train, y_train)
predictions = df_2.predict(X_test)

print('coefficient of determination:', df_2.score(X_train, y_train))
print('intercept:', df_2.intercept_)
print('slope:', df_2.coef_)