๐งโ๏ธ ๋น ๋ฐ์ดํฐ์ ๊ฒฝ์ฐ feature ์๊ฐ ๋๋ฌด ๋ง์์ ๋ฐ์ดํฐ๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฐ ๋ณต์กํ๋ค. ๋ฐ๋ผ์ ์ฐ๋ฆฌ๋ ์ ์ ํ๊ฒ ์ค์ feature๋ง ์ ํํ๊ฑฐ๋, ๊ธฐ์กด feature๋ค์ ์ฌ์กฐํฉํ ์ผ๋ถ feature๋ง ์ ํํ ์ ์๋ค.
๐งโ๏ธ for dimensionality reduction.. → ๋ชจ๋ธ ๋ณต์ก์ฑ ๊ฐ์, ๊ณผ์ ํฉ ํ์ ๋ฐฉ์ง, ์ผ๋ฐํ ์ฑ๋ฅ ํฅ์, ๋ชจ๋ธ computation ํจ๋ฅ ํฅ์์ ์ํด ๊ธฐ์กด feature๋ฅผ ์ด์ฉํด selection & extraction์ ์งํํ๋ค
๐งโ๏ธ ๋ฐ์ธ๋ฅผ ๊ณต๋ถํ๋ค๋ฉด ๋ฐ๋์! ๊ฑฐ์ณ๊ฐ์ผ ํ , ํ์ตํด์ผ ํ ๋ ๊ฐ์ง technique
- feature extraction(ํ๋จ ์ข) & feature selection(ํ๋จ ์ฐ) -
๐งโ๏ธ feature extraction์ ๊ธฐ์กด์ feature๋ค์ ํ ๋๋ก ์ต๋ํ ์ค์ํ ์ ๋ณด๋ง ์์ง๋ฐฐ๊ธฐ๋ก ๋ชจ์ ์๋ก์ด feature๋ค์ ๋ง๋๋ ๊ฒ์ด๊ณ , feature selection์ ๊ธฐ์กด feature๋ค ์ผ๋ถ๋ง ๊ทธ๋๋ก ์ ํํ๋ค.
'while the original features are maintained in the case of feature selection algorithms, the feature extraction algorithms transform the data onto a new feature space.'
๐งโ๏ธ feature selection - ์ ํ๋ feature ํด์์ด ์ฝ๋ค & ํ์ง๋ง feature ๊ฐ์ ์ฐ๊ด์ฑ์ด ๊ณ ๋ ค๋์ง ์์ ์ฑ๋ก feature ์ผ๋ถ๋ฅผ selectํ์์ผ๋ฏ๋ก ์ด๋ฅผ ๊ผญ ์๊ณ ์์ด์ผ ํจ
๐งโ๏ธ feature extraction - feature ๊ฐ์ ์ฐ๊ด์ฑ์ ๊ณ ๋ คํ ์ฑ๋ก feature ์๋ฅผ ์ค์ผ ์ ์๋ค. ํ์ง๋ง ์๋กญ๊ฒ ๋ง๋ feature๋ค์ด๋ฏ๋ก feature ํด์์ด ์ด๋ ต๋ค๋ ๋จ์ ์ด ์กด์ฌ
๐งโ๏ธ ์ฌ์ฉ case๊ฐ ๋ค๋ฆ!
(1) feature selection์ ๋ชจ๋ธ์ ์ค๋ช ํ๋ ๊ฒ ์ค์ํ ๋ ์ฃผ๋ก ์ฐ์ด๊ณ (๊ธฐ์กด feature ์ผ๋ถ๋ฅผ ๊ทธ๋๋ก ๋ณด์กดํ๊ธฐ ๋๋ฌธ์)
(2) feature extraction์ ๋ชจ๋ธ์ ์์ธก์ฑ๋ฅ์ ๋์ผ ๋ ์ฃผ๋ก ์ฐ์ธ๋ค(์ง์ ์ฌ๋ฌ feature๋ฅผ ์ฌ์กฐํฉํด์ ์ฑ๋ฅ์ ๋์ด๋ ๊ฒ ๊ด๊ฑด์ด๊ธฐ ๋๋ฌธ).
1. feature selection
โ ๊ท์ ํ - regularization - L1 norm์ ํตํด์ (LASSO) ์ผ๋ถ feature๋ง ์ ํํ ์ ์๋ค
โก ๊ณง ๋ฐฐ์ธ estimator - randomforestclassifier๋ฅผ ์ด์ฉํด feature_importances_ ์์ฑ์ ๊ธฐ์ค์ผ๋ก feature ์ ํ๋ ๊ฐ๋ฅํ๋ค
โข greedy search ์๊ณ ๋ฆฌ์ฆ ์ฌ์ฉ (genetic algorithm ๋ฑ๋ฑ)
โฃ sklearn์ feature_selection module - selectKBest ์ฌ์ฉ
feature selection (1) - selectKBest (+jointplot)
๐คณ ์์ ํฌ์คํ ์์ 'ํน์ฑ๊ณตํ(feature engineering)'์ด ๋ฌด์์ธ์ง์ ๋ํด ๊ฐ๋ตํ๊ฒ ๊ฐ๋ ํ์ต์ ํ์๋ค. FE - Feature Engineering 1. Concepts * In real world, data is really messy - we need to clean the d..
sh-avid-learner.tistory.com
โ ๋ ์์ธํ feature selection์ ์๋ scikit-learn docu ํํ์ด์ง๋ฅผ ํตํด ๋ณผ ์ ์๋ค! (๊ณง ์ ๋ฆฌํด์ ํฌ์คํ ์์ )
https://scikit-learn.org/stable/modules/feature_selection.html#univariate-feature-selection
2. feature extraction
๐ ์ผ๋จ feature extraction์ ๋ชฉํ๋ ์ต๋ํ ์ ๋ณด๋ฅผ ์์ง ์๋ ์ ์์ data๋ฅผ ์ต๋ํ ์์ถํ๋ ๊ฒ์ด๋ค.
โ PCA - Principal Component Analysis - eigenvector๋ฅผ ์ด์ฉํด ์ฌ๋ฌ ์ฃผ์ถ์ ์ฐพ๊ณ ์ฃผ์ถ ๊ธฐ๋ฐ feature๋ฅผ extractํ๋ ๊ณผ์ (๊ณง ๋ฐฐ์!)
โก auto-encoder
๐ ๊ทธ๋ ๋ค๋ฉด feature engineering๊ณผ feature extraction๊ณผ์ ์ฐจ์ด์ ์?
FE - Feature Engineering
1. Concepts * In real world, data is really messy - we need to clean the data * FE = a process of extracting useful features from raw data using math, statistics and domain knowledge - ์ฆ, ๋๋ฉ..
sh-avid-learner.tistory.com
→ ๊ธฐ์กด raw data ์๋ data๋ฅผ ์ฌ์ฉํ ์ ์๋ ๊ฐ ์๋ ๊ฐ์ ์ฐจ์ด์ด๋ค! FE์ ๊ฒฝ์ฐ ์๋ ์ฌ์ฉํ ์ ์๋ feature๋ค์ ๊ฐ์ง๊ณ ์ง์ ์ฌ์กฐํฉํด ์๋ก์ด feature๋ฅผ ๋ง๋๋ ๊ณผ์ ์ด๊ณ , feature extraction์ ๊ธฐ์กด raw data๋ ์ฌ์ฉํ ์ ์๊ณ , ํด๋น data์์ ๋ฐ๋์ ์ ์ฉํ ์ ๋ณด๋ง์ ๋ฝ์ ์ฌ์กฐํฉํด ์๋ก์ด data๋ฅผ ๊ฐ์ง๊ณ ์งํํด์ผ๋ง ํ๋ ๊ณผ์ ์ผ ๋ feature extraction์ด๋ผ๊ณ ํ๋ค
* ๊ฐ๋ ์์ง ์๋ฃ!
3. feature selection vs. feature extraction ์ ๋ฆฌ
feature selection | feature extraction | |
์ค๋ช | ์๋ ํน์ฑ๋ค ์ค ์ผ๋ถ๋ง ์ ํ | ์๋ ํน์ฑ๋ค์ ์ ๋ณด๋ฅผ ํ์ฉ - ์๋ก์ด ํน์ฑ ์์ฑ |
์๋ก์ด ํน์ฑ ์์ฑ ์ฌ๋ถ |
x | O |
๋จ์ | ์ ํ๋์ง ์์ ํน์ฑ๋ค์ ๋ถ์์์ ์ฌ์ฉ x | ์๋กญ๊ฒ ๋ง๋ feature ํด์์ ์ด๋ ค์ |
* ์ธ๋ฌ ์ถ์ฒ) https://www.vectorstock.com/royalty-free-vector/extracting-data-color-icon-vector-29110777
* ์ถ์ฒ1) https://vitalflux.com/machine-learning-feature-selection-feature-extraction/
'Machine Learning > Fundamentals' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
PCA(w/code) (0) | 2022.05.31 |
---|---|
PCA(concepts) (0) | 2022.05.30 |
feature selection (1) - selectKBest (+jointplot) (0) | 2022.04.20 |
Ordinal Encoding (0) | 2022.04.20 |
train vs. validation vs. test set (0) | 2022.04.18 |
๋๊ธ