getting started with neural networks prepares the validation datadata from partition prepares the training datadata from all other partitions for in range( )print('processing fold #'ival_data train_data[ num_val_samples( num_val_samplesval_targets train_targets[ num_val_samples( num_val_samplespartial_train_data np concatenate[train_data[: num_val_samples]train_data[( num_val_samples:]]axis= partial_train_targets np concatenate[train_targets[: num_val_samples]train_targets[( num_val_samples:]]axis= builds the keras model (already compiledtrains the model (in silent modeverbose model build_model(model fit(partial_train_datapartial_train_targetsepochs=num_epochsbatch_size= verbose= val_mseval_mae model evaluate(val_dataval_targetsverbose= all_scores append(val_maeevaluates the model on the validation data running this with num_epochs yields the following resultsall_scores [ np mean(all_scores the different runs do indeed show rather different validation scoresfrom to the average ( is much more reliable metric than any single score--that' the entire point of -fold cross-validation in this caseyou're off by $ , on averagewhich is significant considering that the prices range from $ , to $ , let' try training the network bit longer epochs to keep record of how well the model does at each epochyou'll modify the training loop to save the perepoch validation score log listing saving he validat ion logs at each fold num_epochs prepares the validation dataall_mae_histories [data from partition for in range( )print('processing fold #'ival_data train_data[ num_val_samples( num_val_samplesval_targets train_targets[ num_val_samples( num_val_samplespartial_train_data np concatenate[train_data[: num_val_samples]train_data[( num_val_samples:]]axis= licensed to prepares the training datadata from all other partitions