Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #kütüphane tanımlanması
- from sklearn.linear_model import LinearRegression
- multi_linear_reg = LinearRegression()
- x = data.drop(['id','price','zipcode','lat','long','date'],axis=1).values
- y = data['price'].values.reshape(-1,1)
- multi_linear_reg.fit(x,y)
- b0 = multi_linear_reg.intercept_
- b1 = multi_linear_reg.coef_
- #Tahminler
- y_head = multi_linear_reg.predict(x)
- print("B0 :",b0)
- print("B1 :",b1)
- #Tahmin Skoru
- from sklearn.metrics import r2_score
- print("R Square Values :",r2_score(y,y_head))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement