-
데이터 정제machine learning 2024. 2. 25. 16:16
- 결측치 확인
- 결측치 제거, 결측치 대체
- 이상치 탐지 및 처리
- 중복 데이터 탐지 및 제거from sklearn.impute import SimpleImputer params = {"strategy" : ["mean", "median", "most_frequent", "constant"], "fill_value" : , #strategy == constant 인 경우에만 사용 (대체할 값) "missing_value" : np.nan(default), # 결측치를 식별하는데 사용할 값 "add_indicator" : [True or False], # True일 때 대체된 결측치의 위치를 나타내는 지표열 생성 "copy" : [True or False], # inplace와 같음 (default = True) "verbose" : [0 or 1] # 0 : 출력메시지 X, 1 : 출력메시지 O} imputer = SimpleImputer(**params) # Imputer 객체 생성 df = imputer.fit_trainsform(df) # 생성한 객체의 적용
'machine learning' 카테고리의 다른 글
가상 데이터의 활용 (0) 2024.02.25 데이터 축소 (0) 2024.02.25 데이터 변환_인코딩 (0) 2024.02.25 데이터 변환_스케일링 (0) 2024.02.25 데이터 전처리 과정 (0) 2024.02.25