๋ถ์์๊ฐํ ๋ํ ์ฝ๋ ๊ณต์ ๊ฒ์๋ฌผ์
๋ด์ฉ ํ์ธ ํ
์ข์์(ํฌํ) ๊ฐ๋ฅํฉ๋๋ค.
ย
EDA + Pycaret ํ์ฉํ๊ธฐ ๐๐ป๐๐ป (0.29974) (์์ )
์ฑ๋ฅ์ ์์ง ๋ง์ด ๋ถ์กฑํ์ง๋ง pycaret์ ํ์ฉํ ์ฝ๋๋ฅผ ๊ณต์ ํ๋ คํฉ๋๋ค.
์๋ชป๋ ๋ถ๋ถ์ด ์์ ์ ์์ต๋๋ค. ๋๊ธ ๋จ๊ฒจ์ฃผ์ธ์ ๐๐
์๋
ํ์ธ์! ๋๊ธ ๊ฐ์ฌ๋๋ฆฝ๋๋ค :)
title ์ปฌ๋ผ์ label encoding์ ์ฌ์ฉํ๊ธฐ์๋ title ๊ฐ๋ค์ ์์์ ๋ํ ์ ๋ณด๊ฐ ์๋๋ฏํ์ฌ
title ๊ฐ๋ค์ ์ปฌ๋ผ์ ๋ชฉ๋กํํ์ฌ 0,1 ์ด์ง๊ฐ์ผ๋ก ํํํ๋ one-hot encoding์ ์ฌ์ฉํ์ต๋๋ค.
pycaret์ด๋ ์ํซ ์ธ์ฝ๋์ handle_unknown ๊ธฐ๋ฅ ์ฒ์ ์์๋ค์! ์ข์์ ๋ณด ๊ฐ์ฌํฉ๋๋ค
์ ๋ pandas์ get_dummies ํจ์๋ง ์ฌ์ฉํด์ค๋ค๊ฐ train๊ณผ test ๋ฐ์ดํฐ์ ์ปฌ๋ผ์ด ๋ถ์ผ์นํ ๊ฒฝ์ฐ์
์ฌ์ดํท๋ฐ one-hot encoder์ handle_unknown ๊ธฐ๋ฅ์ด ์ ์ฉํ๋ค๋๊ฑธ ์ด๋ฒ์ ์ฒ์ ์๊ฒ ๋์ต๋๋ค :)
๋๊ธ ๊ฐ์ฌํฉ๋๋ค ๐๐
pycaret์ ์ฝ๋ฉ์์ ํ์ฉํด ๋ณด๊ณ ์ ํ๋๋ฐ ์์ ๊ฐ์ด ์ค์นํ๋ฉด ์๋ฌ๊ฐ ๋ฐ์ํ๋ค์..
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
xarray-einstats 0.2.2 requires numpy>=1.21, but you have numpy 1.19.5 which is incompatible.
tensorflow 2.8.2+zzzcolab20220527125636 requires numpy>=1.20, but you have numpy 1.19.5 which is incompatible.
google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible.
datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
ํด๊ฒฐํ ๋ฐฉ๋ฒ์ด ์์๊น์ ?
์ ๊ฐ ์ด์ชฝ ๋ด์ฉ์ ์ ํํ ์์ง ๋ชปํด์ ๐๐
์๋ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ์๋ฉด ์ข์๊ฒ ๊ฐ์ต๋๋ค
https://github.com/apple/turicreate/issues/3383
๋ช ์ ๊ฐ๋ฅด์นจ์ ๋ฐ์์ต๋๋ค. ์ด๋ฐ ๊ฒ๋ ์๋ ์ค์ ๋ชฐ๋๋ค์.
์์๋ธ์ฒ๋ผ ์ฌ๋ฌ ๋ชจ๋ธ์ ์กฐํฉํ๋ ๊ฒ์ด ์๋ค๋ ๊ด์ฌ์๊ฒ ๋ด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
์ข์ ์ ๋ณด ๊ฐ์ฌํฉ๋๋ค.
๋์์ด ๋ผ์ ๋คํ์ ๋๋ค ใ ใ ๋๊ธ ๊ฐ์ฌํฉ๋๋ค :)
์ด๊ฑฐ engine_fix๋ถ๋ถ์์ ๋ง์ง๋ง ์กฐ๊ฑด์ด ๋งจ ์๋ก ์ฌ๋ผ๊ฐ์ผํ ๊ฑฐ ๊ฐ์์ ๋ง์ง๋ง ์กฐ๊ฑด ๋๋ฌธ์ ์ ๋ถ 2๋ก ๋ค์ด๊ฐ๋๊ฑฐ ๊ฐ์์
def engine_fix(df):
df.loc[~df['engine'].isin(["8-cylinder(V8)" , "4-cylinder(H4)" , "6-cylinder(I6)" , "6-cylinder(V6)" , "4-cylinder(I4)" , "5-cylinder(I5)" , "3-cylinder(I3)" , "2-cylinder(I2)"]), 'engine'] = 2
df.loc[(df['engine'] == "8-cylinder(V8)"), 'engine'] = 4
df.loc[(df['engine'] == "4-cylinder(H4)"), 'engine'] = 3
df.loc[(df['engine'].isin(["6-cylinder(I6)" , "6-cylinder(V6)" , "4-cylinder(I4)"])), 'engine'] = 2
df.loc[(df['engine'].isin(["5-cylinder(I5)", "3-cylinder(I3)", "2-cylinder(I2)"])), 'engine'] = 1
์ด๋ฐ์์ผ๋ก ์์ ํด์ ์ฌ์ฉํ์ต๋๋ค
๋ฐฉ๊ธ ์๋ชป๋๊ฑฐ ํ์ธํด์ ์๋ก ์์ ํ์ต๋๋ค
๊ผผ๊ผผํ๊ฒ ์ฝ์ด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค ใ
ใ
ํน์ ํจํค์ง ์ธ์คํจ ๋คํ๊ณ ์ฝ๋ ํ๋์ฉ ๋๋ ค๋ดค๋๋ฐ logs.log๋ผ๋ ํ์ผ์ ๋ก๊ทธ๊ธฐ๋ก์ด ์๋์ผ๋ก ์ ์ฅ๋๋๋ฐ ํน์ ์ด๋ป๊ฒ ๊ธฐ๋ก๋๊ณ ์๋์ง ์์๋์??
์ ๋ ๊ทธ๋ฐ ํ์ผ์ด ๋ฐ๋ก ์์ฑ๋์ง๋ ์๋๋ฐ.. ํน์ ์ฝ๋ฉํ๊ฒฝ์ด์๋ฉด ์ด๋์ ํ์ธ๊ฐ๋ฅํ๊ฑด์ง ์์์์๊น์?
์ฝ๋ฉ์ ์๋๊ตฌ vscode ์ฌ์ฉํ์ฉ๋๋ค.. warning.filterwarnings(action="ignore") ์ด ์ฝ๋๊ฐ ๋๋ฉด์ ๋ก๊ทธํ์ผ์ด ์์ฑ๋๊ณ ์๋๊ธฐ๋ก๋๋๊ฑฐ ๊ฐ์๋ฐ
๊ฒ์์ํด๋ ์ด๋ป๊ฒ ์๋๋๊ณ ์๋์ง ์ฐพ๊ธฐ๊ฐ ํ๋๋ค์ ใ
๋ฐ์ด์ฝ(์ฃผ) | ๋ํ ๊น๊ตญ์ง | 699-81-01021
ํต์ ํ๋งค์
์ ๊ณ ๋ฒํธ: ์ 2021-์์ธ์๋ฑํฌ-1704ํธ
์์ธํน๋ณ์ ์๋ฑํฌ๊ตฌ ์ํ๋ก 3 ์ต์ค์ฝ๋ฒค์ฒํ์ 901ํธ
์ด๋ฉ์ผ dacon@dacon.io | ์ ํ๋ฒํธ: 070-4102-0545
Copyright โ DACON Inc. All rights reserved
์ฝ๋ ๊ณต์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค^^ ๋ง์ ๋์์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๊ณต๋ถ ํ๋๋ฐ ํ๊ฐ์ง ์ง๋ฌธ์ด ์์ด ๋ฌธ์ ๋๋ฆฝ๋๋ค.
์ํซ ์ธ์ฝ๋ฉ์ ํ๋๋ฐ ํ์ดํ ๊ฐ์ ์ด๋ก ๋๋ฆฐ ์ด์ ๊ฐ ๋ฌด์์ธ์ง ๊ถ๊ธํฉ๋๋ค.!!