如何在DNN(深度神经网路)模型设定开发集(development set)?

你好,小弟打算使用一个数据集建立一个DNN模型,在训练集(Training Set)和测试集(Test Set)都很顺利做到,然后我在设定的时候遇上一个问题,在开发集(development set)的部分不知道要怎么设定才行……
以下是我的程式码:

import pandas as pd
import numpy as np

from sklearn import datasets, preprocessing
from sklearn.model_selection import train_test_split

from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.optimizers import SGD, Adam

iris = datasets.load_iris()
df = pd.DataFrame(iris['data'], columns=iris['feature_names'])

labels = np.array(df['sepal length (cm)'])
features = df.drop('sepal length (cm)', axis=1)

trainX, testX, trainY, testY = train_test_split(features, labels, test_size=0.1, random_state=42)
trainY = trainY.reshape(-1,1)
testY = testY.reshape(-1,1)

model = Sequential()
model.add(Dense(64, input_dim=3, activation='relu'))

model.add(Dense(1))

model.compile(loss='mse', optimizer=SGD(lr=0.1), metrics=['mse','mape'])

import time
tStart = time.time()#計時開始

print("Starting training ")

dnn = model.fit(trainX, trainY,epochs=20, batch_size=30)

想请问 trainX, testX, trainY, testY = train_test_split(features, labels, test_size=0.1, random_state=42)是在这里设定吗?还是要在其他地方设定才行?

希望大家能帮到我,谢谢大家~~

讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!