reductionista commented on a change in pull request #363: Add tests for
madlib_keras_predict
URL: https://github.com/apache/madlib/pull/363#discussion_r272374058
##########
File path: src/ports/postgres/modules/deep_learning/test/madlib_keras.sql_in
##########
@@ -173,3 +172,36 @@ SELECT madlib_keras_predict(
'x',
$$ optimizer=SGD(lr=0.01, decay=1e-6, nesterov=True),
loss='categorical_crossentropy', metrics=['accuracy']$$::text,
'cifar10_predict');
+
+-- Validate that prediction output table exists and has correct schema
+SELECT assert(UPPER(atttypid::regtype::TEXT) = 'INTEGER', 'id column should be
INTEGER type')
+ FROM pg_attribute WHERE attrelid = 'cifar10_predict'::regclass
+ AND attname = 'id';
+
+SELECT assert(UPPER(atttypid::regtype::TEXT) =
+ 'DOUBLE PRECISION', 'prediction column should be DOUBLE PRECISION type')
+ FROM pg_attribute WHERE attrelid = 'cifar10_predict'::regclass
+ AND attname = 'prediction';
+
+-- Validate correct number of rows returned.
+SELECT assert(COUNT(*) = 2, "Output table of madlib_keras_predict should have
two rows") FROM cifar10_predict;
Review comment:
Thanks, this was due to using double quotes instead of single.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services