Here is the unittest that is failing:
def test_history(history):
vars_history = vars(history)
test_cases = [
{
"name": "type_check",
"result": type(history),
"expected": tf.keras.callbacks.History,
"error_message": 'history type is incorrect. Please check model.fit().'
},
{
"name": "params_samples_check",
"result": vars_history['params']['samples'],
"expected": 3155,
"error_message": 'Training samples is incorrect. Please check arguments to model.fit().'
},
{
"name": "params_do_validation_check",
"result": vars_history['params']['do_validation'],
"expected": True,
"error_message": 'No validation data is present. Please check arguments to model.fit().'
},
]
test_loop(test_cases)
I am trying to run the following. I have blanked out parts that are user inputs
# history = model.fit(x=#####, y=#####,
# epochs = 40, validation_data=(#####, #####))
The error I get is the following:
params_samples_check: Training samples is incorrect. Please check arguments to model.fit().
Expected: 3155
Result: 3250
Please open utils.py if you want to see the unit test here.
However if get the length of my input variables I am getting an expected length:
length = [len(data) for data in (norm_train_X, train_Y, norm_val_X, val_Y)]
print(length)
>> [3155, 2, 789, 2]
You can see above that norm_train_X has a length of 3155, but the input being provided to the unittest is 3250, so it’s unclear what is happening.
I will note that despite the failing unittest, my values fall within acceptable ranges:
# EXPECTED VALUES
# ~ 0.30 - 0.38
# ~ 0.30 - 0.38
# ~ 0.018 - 0.036
# ~ 0.50 - 0.62
# ~ 0.97 - 1.0
789/789 [==============================] - 0s 22us/sample - loss: 0.3397 - wine_quality_loss: 0.3117 - wine_type_loss: 0.0267 - wine_quality_root_mean_squared_error: 0.5591 - wine_type_accuracy: 0.9949
loss: 0.3396697271006189
wine_quality_loss: 0.3116830885410309
wine_type_loss: 0.026737095788121223
wine_quality_rmse: 0.5590964555740356
wine_type_accuracy: 0.9949302673339844