Ash*_*age 1 python artificial-intelligence neural-network scikit-learn data-science
classifier.add(Dense(6, kernel_initializer = 'uniform', activation = 'relu', input_dim = 11))
classifier.add(Dense(6,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)
classifier.fit(X_train, y_train, batch_size = 10, nb_epoch = 100)
Run Code Online (Sandbox Code Playgroud)
如果我运行这个,它会说:
fit() got an unexpected keyword argument 'nb_epoch'
Run Code Online (Sandbox Code Playgroud)
我nb_epochs也尝试过epoch。它仍然给出错误。我尝试了纪元,它给出了一个新的错误:
ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 11 but received input with shape (None, 1)
Run Code Online (Sandbox Code Playgroud)
我正在编写的是预测价格的人工神经网络代码。如果你能帮助我,我将不胜感激。
| 归档时间: |
|
| 查看次数: |
12573 次 |
| 最近记录: |