Scikit-learn์ Iris dataset๊ณผ RandomForestClassifier๋ฅผ ์ฌ์ฉํด ๊ตฌํํ ๋ชจ๋ธ์ ๋๋ค.
- feature(๋ถ๋ฅ ๊ธฐ์ค): ๊ฝ๋ฐ์นจ(sepal) ๊ธธ์ด, ๊ฝ๋ฐ์นจ ๋์ด, ๊ฝ์(petal) ๊ธธ์ด, ๊ฝ์ ๋์ด
- targets(๋ถ๋ฅ๋๋ ๊ฒฐ๊ณผ): setosa=0, versicolor=1, virginica=2
- ์ด 150๊ฐ ๋ฐ์ดํฐ
code ํด๋์ ์๋ ๊ฐ ํ์ผ๋ค์ ๋ํ ์ค๋ช ์ ์๋์ ๊ฐ์ต๋๋ค.
- Simple RF model: ์ ์ฒด ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํด์ ๋ง๋ model์ ๋ํด sample_data๋ฅผ ์ฌ์ฉํด์ Iris specied ์์ธก์ ํ๋ค.
- Advanced RF model: train : test = 7 : 3์ผ๋ก ๋ง๋ ๋ฐ์ดํฐ๋ก ํ์ตํ modeld์ ์ฌ์ฉํด predict species from sample_data๋ฅผ ํ๋ค.
- FeatureControlled RF model-threshold: 2๋ฒ์ ์ฝ๋์์ ๋ฐ์ ์ํจ ์ฝ๋๋ก threshold ์ด์์ ์ค์๋ ๊ฐ์ ๊ฐ์ง๋ feature๋ง์ ์ฌ์ฉํ์ฌ model์ ๋ง๋ ๋ค.
- FeatureControlled RF model-topSelect: 3๋ฒ๊ณผ ๋น์ทํ์ง๋ง feature์ ์ค์๋๋ฅผ ๊ตฌํ ํ ์์ ๋ช๊ฐ๋ง ์ฌ์ฉํ์ฌ model์ ๋ง๋๋ ์ฐจ์ด๊ฐ ์๋ค.
๋ชจ๋ ์ฝ๋๋ python IDLE๋ฅผ ํตํด ์คํํ๊ฑฐ๋ cmd๋ก >python fileName.py์ด๋ฐ์์ผ๋ก ์คํํ๋ฉด ๋๋ค.
cf. Window cmd์์ ๋์ด์ฐ๊ธฐ๊ฐ ์๋ ํ์ผ๋ช
์ >python "file name.py"์ด๋ ๊ฒ ์ฐ๋ฉด ๋๋ค.
- Simple RF model

- Advanced RF model

- FeatureControlled RF model-threshold

- FeatureControlled RF model-topSelect

Random Forest model์ด๋ ์ฝ๋์ ๋ํ ๋ ์์ธํ ์ค๋ช ์ด ํ์ํ๋ค๋ฉด Here๋ฅผ ์ฐธ๊ณ ํ๋ฉด ๋ฉ๋๋ค.
