我有以下代码。我有4个要素数据和一个标签。我想使用特征数据来预测标签。运行代码,在
行给我一个错误classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras import Sequential
#classifier=tf.keras.Sequential()
classifier = Sequential()
classifier.add(Dense(3, kernel_initializer = 'uniform', activation = 'relu', input_shape = (4,)))
classifier.add(Dense(3, kernel_initializer = 'uniform', activation = 'relu'))
classifier.add(Dense(1, kernel_initializer = 'uniform', activation = 'sigmoid'))
classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)
ValueError: Error when checking input: expected dense_10_input to have shape (11,) but got array with shape (83,)