I have a data set named df_noyau_yes
and I want to apply a ShuffleSplit to split it into train and test sets to train an autoencoder.
The problem is that this functions returns indices of the shuffled data, I tried to extract the data of these indices to feed them to the autoencoder but it dosen't work, it shows me an error KeyError 223
Here is the code:
rs = ShuffleSplit(n_splits=2, test_size=.25, random_state=0)
rs.get_n_splits(df_noyau_yes)
for train_index, test_index in rs.split(df_noyau_yes):
print("TRAIN:", train_index, "TEST:", test_index)
#X_train, X_test = df_noyau_yes[train_index], df_noyau_yes[test_index]
x_train=[]
for x in train_index:
x_train = np.append(x_train, df_noyau_yes[x])
print(x_train)
print("training set",x_train)
Is there any solution for that ??