How to split test and train data keeping equal proportions ...
https://discuss.pytorch.org/t/how-to-split-test-and-train-data-keeping-equal...12.07.2018 · This would split the dataset before using any of the PyTorch classes. You would get different splits and create different Dataset classes:. X = np.random.randn(1000, 2) y = np.random.randint(0, 10, size=1000) X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.1, stratify=y) np.unique(y_train, return_counts=True) np.unique(y_val, …