์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- c++
- react
- ์ ํ๋์ํ
- ๋ฐ์ดํฐ๋ถ์
- AI
- ์๋ฒ ๋ฉ
- ๋ค์ดํฐ๋ธ
- nlp
- ๊ฒฐ์ ํธ๋ฆฌ
- Titanic
- ๋ฐฑ์ค
- ๋์
- ์๋๋ก์ด๋์คํ๋์ค
- native
- ๋ฐ์ดํฐ์๊ฐํ
- Kaggle
- ํ์ดํ๋
- ๊นํ
- Git
- ๋ฐ์ดํฐ
- ๋ถ์
- linearalgebra
- ๋จธ์ ๋ฌ๋
- ํ๊ตญ์ด์๋ฒ ๋ฉ
- ๋ฆฌ์กํธ
- cs231n
- ์ํ์ฝ๋ฉ
- ์ธํ๋ฐ
- ์๊ณ ๋ฆฌ์ฆ
- ๋ฅ๋ฌ๋
- Today
- Total
yeon's ๐ฉ๐ป๐ป
[kaggle] ํ์ดํ๋(titanic) | 8. EDA - Fare ๋ณธ๋ฌธ
[kaggle] ํ์ดํ๋(titanic) | 8. EDA - Fare
yeon42 2021. 8. 7. 17:042. 8 Fare
: ํ์น์๊ธ
* Skewness(์๋)
- ์๋ฃ์ ๋ถํฌ๋ชจ์์ด ํ๊ท ์ ์ค์ฌ์ผ๋ก ํ ์ชฝ์ผ๋ก ์น์ฐ์ณ์ ธ ์๋ ๊ฒฝํฅ์ ๋ํ๋ด๋ ์ฒ๋
- ์๋ฃ์ ๋ถํฌ๊ฐ ๋์นญ์ธ์ง ์๋์ง๋ฅผ ์ธก์ ํด์ฃผ๋ ๊ฐ
- distribution์ด ์ผ๋ง๋ ์ ๋ ธ๋ (๋น๋์นญ์ด๋)
- skew = 0 : ์ ๊ท๋ถํฌ
- skew > 0 : ์ข์ธก์ผ๋ก ์น์ฐ์นจ
- skew < 0 : ์ฐ์ธก์ผ๋ก ์น์ฐ์นจ
fig, ax = plt.subplots(1, 1, figsize=(8, 8))
g = sns.distplot(df_train['Fare'], color='b', label='Skewness: {:.2f}'.format(df_train['Fare'].skew()), ax=ax)
g = g.legend(loc='best')
- ๊ทธ๋ํ๊ฐ ํ ์ชฝ์ผ๋ก ๋๋ฌด ์น์ฐ์ณ์ก๋ค. -> ์ด๋๋ก ๋ชจ๋ธ์ ๋ฃ์ด์ค๋ค๋ฉด ์์นซ ๋ชจ๋ธ์ด ์๋ชป ํ์ตํ ์ ์๋ค.
- outlier์ ์ํฅ์ ์ค์ด๊ธฐ ์ํด Fare์ log๋ฅผ ์ทจํ์
df_train['Fare'] = df_train['Fare'].map(lambda i: np.log(i) if i>0 else 0)
fig, ax = plt.subplots(1, 1, figsize=(8, 8))
g = sns.distplot(df_train['Fare'], color='b', lable='Skewness: {:.2f}'.format(df_train['Fare'].skew()), ax=ax)
g = g.legend(loc='best')
- log๋ฅผ ์ทจํ๋ ๋น๋์นญ์ฑ(skewness)์ด ์ค์ด๋ค์๋ค.
-> Feature Engineering : ๋ชจ๋ธ์ ์ฑ๋ฅ์ ๋์ด๊ธฐ ์ํด feature๋ค์ ์์๋ก ์กฐ์ํ๋ ๊ฒ!!
'Computer ๐ป > ๋ฐ์ดํฐ ๋ถ์' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[kaggle] ํ์ดํ๋(titanic) | 10. Feature Engineering - Embarked Feature (0) | 2021.08.07 |
---|---|
[kaggle] ํ์ดํ๋(titanic) | 9. Feature Engineering - Fill Null in Age (0) | 2021.08.07 |
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] *์์ฝ (0) | 2021.08.07 |
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] Folium | MarkerCluster (0) | 2021.08.05 |
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] countplot, scatterplot, jointplot (0) | 2021.08.05 |