Problem: While implementing SMOTE (a type of oversampling) , my dataframe is getting converted to numpy array).
Test_train_split
from sklearn.model_selection import train_test_split
X_train, X_test, y_train_full, y_test_full = train_test_split(X, y, test_size=0.20, random_state=66)
[IN]type(X_train)
[OUT]pandas.core.frame.DataFrame
After SMOTE, datatype of X_train changes from pandas dataframe to numpy array
from imblearn.over_sampling import SMOTE
sm = SMOTE(random_state = 42)
X_train, y_train = sm.fit_sample(X_train, y_train)
[IN]type(X_train)
[OUT]numpy.ndarray
Expected output I want to retain the dataframe structure of X_train and X_test after SMOTE. How to do that?