Code
x, y = load_all_images(
classes=["sunny", "cloudy", "foggy", "rainy", "snowy"], pixels=PIXELS
)
# make them as numpy array
x = np.array(x)
y = np.array(y)
# shuffle and split
x_train, x_test, y_train, y_test = train_test_split(
x, y, train_size=0.8, shuffle=True, random_state=777
)
y_train_labels = y_train.copy()
y_test_labels = y_test.copy()
# convert class vector into binary matrix
y_train = to_categorical(y_test)
y_test = to_categorical(y_train)
x_train.shape, y_train.shape((14431, 40000), (3608, 5))



