text_plain_output_1.png
from sklearn.linear_model import LinearRegression

import matplotlib.pyplot as plt

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

train_df = pd.read_csv('/kaggle/input/1056lab-house-price-prediction/train.csv', index_col=0)
train_df

test_df = pd.read_csv('/kaggle/input/1056lab-house-price-prediction/test.csv')
test_df

import matplotlib.pyplot as plt
import seaborn as sns
cor = train_df.corr()

slct_train_df = train_df[['date', 'bathrooms', 'sqft_living', 'view', 'grade', 'sqft_above', 'sqft_living15']]
slct_train_df

slct_test_df = test_df[['date', 'bathrooms', 'sqft_living', 'view', 'grade', 'sqft_above', 'sqft_living15']]
slct_test_df

X = slct_train_df.to_numpy()
X

y = train_df['price'].to_numpy()
log1p_y = np.log1p(y)
log1p_y

from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X, log1p_y)

X_test = slct_test_df.to_numpy()
X_test

log1p_p = model.predict(X_test)
log1p_p