from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score
data = {
    'Area': [1200, 1500, 1700, 1000, 2000, 1300, 1800, 1100, 1600, 1400],
    'Bedrooms': [2, 3, 3, 2, 4, 2, 3, 2, 3, 2],
    'Age': [8, 6, 4, 10, 3, 7, 5, 9, 6, 7],
    'Distance': [6, 5, 3, 8, 2, 6, 4, 7, 5, 6],
    'Price': [50, 65, 80, 45, 95, 55, 85, 48, 70, 60]
}
df = pd.DataFrame(data)
X = df[['Area', 'Bedrooms', 'Age', 'Distance']]
y = df['Price']
model = LinearRegression()
model.fit(X, y)
y_pred = model.predict(X)
mse = mean_squared_error(y, y_pred)
r2 = r2_score(y, y_pred)
print("Mean Squared Error:", round(mse, 2))
print("R² Score:", round(r2, 2))
print("\nModel Coefficients:", model.coef_)
print("Intercept:", model.intercept_)
test_data = pd.D

