keras_tuner の tuner.search() を使用して CNN のハイパーパラメータを調整しようとしています。これには、トレーニング データと検証データの機能とラベルを提供する必要があります。
tuner.search(x_train, y_train, epochs=10, validation_data=(x_val, y_val))
best_model = tuner.get_best_models()[0]
これは、機能とラベルに分割したいものです
train_data = tf.keras.preprocessing.image_dataset_from_directory(
data_path,
validation_split=0.3,
subset="training",
seed=1,
image_size=(img_height, img_width),
batch_size=batch_size)
これを行うためにsklearnのtrain_test_splitを使用することを検討しましたが、方法がわかりません。どんな助けでも大歓迎です。