파이썬 seaborn 선형 예측 그래프

링크 : Seaborn regplot

feature 값에 대한 target의 예측 값을 그래프로 그려 볼 수 있다.

# feature 와 target 을 설정 한후 feature 들의 선형 예측
import seaborn as sns
import matplotlib.pyplot as plt

plt.title('Coef')
sns.regplot(x=feature, y=target, color = 'skyblue', line_kws={"color": "red"});

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/710b0001-f405-4221-8d8f-ad2b200daad7/Untitled.png

train을 통한 예측 범위를 그려볼수 있다.

import seaborn as sns
sns.regplot(x=train['GrLivArea'], y=train['SalePrice']).set_title('Housing Prices');

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5e3c047a-eca1-48e5-aba4-d1a346f9cd35/Untitled.png