from imblearn.over_sampling import SMOTE

smote = SMOTE(random_state=0)
{% if pipeline.sparse_matrix %}
feature_columns = feature_train.columns
feature_train = feature_train.sparse.to_coo()
feature_train, target_train = smote.fit_resample(feature_train, target_train)
feature_train =  pd.DataFrame.sparse.from_spmatrix(feature_train, columns=feature_columns)
{% else %}
feature_train, target_train = smote.fit_resample(feature_train, target_train)
{% endif %}
