Skip to content

Instantly share code, notes, and snippets.

# https://imbalanced-learn.readthedocs.io/en/stable/generated/imblearn.over_sampling.SMOTENC.html
# SMOTENC (SMOTE) for Pandas DataFrame
# - this codes uses SMOTENC (imbalanced-learn library) for oversampling imbalanced data
# - it preserves dataframe object, columns names and dtypes
from imblearn.over_sampling import SMOTENC
def col_ins(ds, var):
# column names to indices