Untitled

 avatar
unknown
plain_text
a month ago
467 B
7
Indexable
import numpy as np
from sklearn.linear_model import LinearRegression

X = np.array([
    [1000, 2],
    [1200, 3],
    [1500, 3],
    [1800, 4],
    [5, 4]
])

Y = np.array([200000, 250000, 300000, 350000, 400000])

model = LinearRegression()
model.fit(X, Y)

print("Intercept:", model.intercept_)
print("Coefficients:", model.coef_)

new_house = np.array([[1600, 3]])  
prediction = model.predict(new_house)

print("Prediction:", prediction[0])
Editor is loading...
Leave a Comment