상세 컨텐츠

본문 제목

Imputing missing data

데이터 과학

by Taeyoon.Kim.DS 2023. 11. 2. 20:02

본문

Feature engineering often grapples with the problem of missing data. A straightforward approach to handle this is mean replacement, where missing values in a column are replaced by the mean value of that column. However, it's important to note that this approach can be problematic if there are outliers or if the data is categorical. In such cases, using the median or the most frequent value might be better. Another concern is that mean replacement does not account for correlations between features, leading to potentially illogical imputations. While dropping rows with missing data can be a quick solution, it poses the risk of introducing bias, especially if the absence of data has a specific pattern. Instead of dropping data, imputation through machine learning techniques like K Nearest Neighbors (KNN) for numerical data and Deep Learning for categorical data can be beneficial. Advanced methods, such as Multiple Imputation by Chained Equations (MICE), have become state-of-the-art techniques for handling missing data. Lastly, the most effective strategy to counteract data deficiencies is to acquire more quality data to enhance model accuracy.

 

1. Mean Replacement

Median may be a better choice than mean whenoutliers are present.
* Generally pretty terrible, only works on column level, misses correlations between features.
* Can't use on categorical features
* Not very accurate

 

2. Dropping

It's never going to be the right answer for the "best" approach. Almost anything is better. Can you substitute another similar field perhaps?

 

3. Machine Learning

* KNN - Assumes numerical data, not categorical. 

* Deep Learning - Build a ML model to impute data for your ML model. Works well for categorical data really well, but it is complicated.

* Regression - Linear or Non-linear relationships between the missing feature and other features. Most advanced technique: Multiple Imputation by Chained Equations.

 

4. Just get more data

 

피처 엔지니어링은 종종 누락된 데이터 문제에 직면하게 됩니다. 이 문제를 처리하는 간단한 방법은 평균 교체로, 열의 누락된 값은 해당 열의 평균 값으로 대체됩니다. 그러나 이 접근법은 이상치 또는 데이터가 범주 형일 경우 문제가 될 수 있습니다. 이러한 경우 중앙값 또는 가장 빈번한 값을 사용하는 것이 더 좋을 수 있습니다. 또한 평균 대체는 특징 간의 상관 관계를 고려하지 않기 때문에 잠재적으로 논리적이지 않은 대체를 할 수 있습니다. 누락된 데이터가 있는 행을 삭제하는 것은 빠른 해결책이 될 수 있지만 데이터 부재가 특정 패턴을 가지고 있는 경우 편향을 도입하는 위험이 있습니다.

 

데이터를 삭제하는 대신 숫자 데이터에 대한 K 최근접 이웃 (KNN) 및 범주 형 데이터에 대한 딥 러닝과 같은 기계 학습 기술을 통한 대체가 유익 할 수 있습니다. 연쇄 방정식에 의한 다중 대체 (MICE)와 같은 고급 방법은 누락된 데이터를 처리하기 위한 최첨단 기술이되었습니다. 마지막으로 데이터 결핍을 대처하는 가장 효과적인 전략은 모델의 정확도를 향상시키기 위해 더 많은 품질 데이터를 획득하는 것입니다.

 

사기 데이터 같은 경우에는 실제 사기 케이스가 전반적인 케이스보다 적어서, 0.01퍼센트 같은 경우 가 있는데, 정확도만 신경쓰면 엄청 좋은 것 처럼 보일 수 있지만 실제로는 좋은 결과를 못낸다.

 

대부분에서는 neural network 문제에서 발생한다.

1. 오버샘플링

작은 데이터 케이스를 복사붙여넣기한다. 생각보다 잘 작동.

2. 언더샘플링

데이터를 제거하는 방법은 이상적이지 않다.

3. SMOTE

Generates new samples and undersamples majority class

4. Adjusting Threshold

ML usually gives you a probability so you can decide the threshold.

관련글 더보기