Training with cross-validation
Time to train your model with the best parameters found: 0.001 for the learning rate, 50 epochs, a 128 batch_size and relu activations.
The create_model() function from the previous exercise is ready for you to use. X and y are loaded as features and labels. 
Use the best values found for your model when creating your KerasClassifier object so that they are used when performing cross_validation.
End this chapter by training an awesome tuned model on the breast cancer dataset!
Diese Übung ist Teil des Kurses
Introduction to Deep Learning with Keras
Anleitung zur Übung
- Import 
KerasClassifierfromtensorflow.kerasscikit_learn wrappers. - Create a 
KerasClassifierobject providing the best parameters found. - Pass your 
model, features and labels tocross_val_scoreto perform cross-validation with 3 folds. 
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Import KerasClassifier from tensorflow.keras wrappers
from tensorflow.keras.wrappers.____ import ____
# Create a KerasClassifier
model = ____(build_fn = create_model(learning_rate = ____, activation = ____), epochs = ____, 
             batch_size = ____, verbose = 0)
# Calculate the accuracy score for each fold
kfolds = cross_val_score(____, ____, ____, cv = ____)
# Print the mean accuracy
print('The mean accuracy was:', kfolds.mean())
# Print the accuracy standard deviation
print('With a standard deviation of:', kfolds.std())