카테고리 없음

[DataSicience]SMOTE-NC

ML.chang 2019. 8. 22. 14:32

Synthetic Minority Over-sampling Technique for Nominal and Continuous (SMOTE-NC).

https://imbalanced-learn.readthedocs.io/en/stable/generated/imblearn.over_sampling.SMOTENC.html

 

imblearn.over_sampling.SMOTENC — imbalanced-learn 0.5.0 documentation

Parameters: categorical_features : ndarray, shape (n_cat_features,) or (n_features,) Specified which features are categorical. Can either be: array of indices specifying the categorical features; mask array of shape (n_features, ) and bool dtype for which

imbalanced-learn.readthedocs.io

 

 

smote-nc

 

#sm = SMOTE(random_state=42)
cf = np.arange(0,2047)
sm = SMOTENC(random_state=42, categorical_features = cf)
#X_train, Y_train = sm.fit_sample(X_train, Y_train)

 

Parameters:

categorical_features:ndarray, shape (n_cat_features,) or (n_features,)

Specified which features are categorical. Can either be:

  • array of indices specifying the categorical features;
  • mask array of shape (n_features, ) and bool dtype for which True indicates the categorical features.

범주 형 특징을 지정하는 인덱스의 배열.