This is an automated email from the ASF dual-hosted git repository.

nkak pushed a commit to branch madlib2-master
in repository https://gitbox.apache.org/repos/asf/madlib.git

commit 769f758e4db0b4e88112e0d976f09194365768ed
Author: Nikhil Kak <[email protected]>
AuthorDate: Thu Feb 22 16:05:32 2024 -0800

    PMML: Improve namespec dev-check tests
    
    JIRA: MADLIB-1517
    
    This commit adds a few more namespec pmml tests
---
 .../postgres/modules/pmml/test/pmml_glm_with_name_spec.sql_in    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/src/ports/postgres/modules/pmml/test/pmml_glm_with_name_spec.sql_in 
b/src/ports/postgres/modules/pmml/test/pmml_glm_with_name_spec.sql_in
index 24c883c6..8b96460f 100644
--- a/src/ports/postgres/modules/pmml/test/pmml_glm_with_name_spec.sql_in
+++ b/src/ports/postgres/modules/pmml/test/pmml_glm_with_name_spec.sql_in
@@ -45,6 +45,11 @@ SELECT test_pmml_output('abalone_test_for_pmml', 
'glm_model', 'glm_predict_binom
 SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','foo1+foo2+foo3+foo4+foo5+foo6+foo7');
 SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','{bar,foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
 SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','{foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
+-- Even if we use explicit "1" in the formula, we will get the correct xml 
although it won't use the formula provided
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','bar ~ 1+foo1+foo2+foo3+foo4+foo5+foo6+foo7');
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','1+foo1+foo2+foo3+foo4+foo5+foo6+foo7');
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','{bar,1,foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict', 'probability_true', 
'','{1,foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
 
 -- Test output category
 DROP TABLE IF EXISTS glm_predict_binomial_logit_out; CREATE TABLE 
glm_predict_binomial_logit_out as SELECT id, glm_predict_binomial(coef, 
ARRAY[1, length, diameter, height, whole, shucked, viscera, shell], 'logit')
@@ -53,6 +58,10 @@ SELECT test_pmml_output('abalone_test_for_pmml', 
'glm_model', 'glm_predict_binom
 SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict_binomial', 
'predicted_rings < 10', '', 'foo1+foo2+foo3+foo4+foo5+foo6+foo7');
 SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict_binomial', 
'predicted_bar', '', '{bar,foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
 SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict_binomial', 
'predicted_rings < 10', '', '{foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
+-- Even if we use explicit "1" in the formula, we will get the correct xml 
although it won't use the formula provided
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict_binomial', 
'predicted_rings < 10', '', 'bar ~ 1+foo1+foo2+foo3+foo4+foo5+foo6+foo7');
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict_binomial', 
'predicted_rings < 10', '', '1+foo1+foo2+foo3+foo4+foo5+foo6+foo7');
+SELECT test_pmml_output('abalone_test_for_pmml', 'glm_model', 
'glm_predict_binomial_logit_out', 'id', 'glm_predict_binomial', 
'predicted_rings < 10', '', '{1,bar,foo1,foo2,foo3,foo4,foo5,foo6,foo7}');
 
 ----------------------- without intercept -------------------------------
 DROP TABLE IF EXISTS glm_model, glm_model_summary;

Reply via email to