text: -- This SQL code was generated by sklearn2sql (development version).
  -- Copyright 2018
  
  -- Model : KerasRegressor_SimpleRNN
  -- Dataset : diabetes
  -- Database : pgsql
  
  
  -- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
  
  
  
  -- Model deployment code
  
  WITH RECURSIVE keras_input AS 
  (SELECT "ADS"."KEY" AS "KEY", "ADS"."Feature_0" AS "Feature_0", "ADS"."Feature_1" AS "Feature_1", "ADS"."Feature_2" AS "Feature_2", "ADS"."Feature_3" AS "Feature_3", "ADS"."Feature_4" AS "Feature_4", "ADS"."Feature_5" AS "Feature_5", "ADS"."Feature_6" AS "Feature_6", "ADS"."Feature_7" AS "Feature_7", "ADS"."Feature_8" AS "Feature_8", "ADS"."Feature_9" AS "Feature_9" 
  FROM diabetes AS "ADS"), 
  keras_input_1 AS 
  (SELECT keras_input."KEY" AS "KEY", keras_input."Feature_0" AS "Feature_0", keras_input."Feature_1" AS "Feature_1", keras_input."Feature_2" AS "Feature_2", keras_input."Feature_3" AS "Feature_3", keras_input."Feature_4" AS "Feature_4", keras_input."Feature_5" AS "Feature_5", keras_input."Feature_6" AS "Feature_6", keras_input."Feature_7" AS "Feature_7", keras_input."Feature_8" AS "Feature_8", keras_input."Feature_9" AS "Feature_9" 
  FROM keras_input), 
  keras_input_1_rn AS 
  (SELECT row_number() OVER (ORDER BY keras_input_1."KEY" ASC) AS rn, keras_input_1."KEY" AS "KEY", keras_input_1."Feature_0" AS "Feature_0", keras_input_1."Feature_1" AS "Feature_1", keras_input_1."Feature_2" AS "Feature_2", keras_input_1."Feature_3" AS "Feature_3", keras_input_1."Feature_4" AS "Feature_4", keras_input_1."Feature_5" AS "Feature_5", keras_input_1."Feature_6" AS "Feature_6", keras_input_1."Feature_7" AS "Feature_7", keras_input_1."Feature_8" AS "Feature_8", keras_input_1."Feature_9" AS "Feature_9" 
  FROM keras_input_1), 
  input_kernel_bias AS 
  (SELECT keras_input_1_rn.rn AS rn, keras_input_1_rn."KEY" AS "KEY", keras_input_1_rn."Feature_0" AS "Feature_0", keras_input_1_rn."Feature_1" AS "Feature_1", keras_input_1_rn."Feature_2" AS "Feature_2", keras_input_1_rn."Feature_3" AS "Feature_3", keras_input_1_rn."Feature_4" AS "Feature_4", keras_input_1_rn."Feature_5" AS "Feature_5", keras_input_1_rn."Feature_6" AS "Feature_6", keras_input_1_rn."Feature_7" AS "Feature_7", keras_input_1_rn."Feature_8" AS "Feature_8", keras_input_1_rn."Feature_9" AS "Feature_9", 1.8469800829597707 + 0.7828830017104064 * keras_input_1_rn."Feature_0" + -0.25559045156379345 * keras_input_1_rn."Feature_1" + 1.0295340980066239 * keras_input_1_rn."Feature_2" + 0.5266645436146148 * keras_input_1_rn."Feature_3" + -0.04713534413980999 * keras_input_1_rn."Feature_4" + 0.297456138923273 * keras_input_1_rn."Feature_5" + 0.19750510871542493 * keras_input_1_rn."Feature_6" + 0.15018069382237 * keras_input_1_rn."Feature_7" + 1.3073653088825623 * keras_input_1_rn."Feature_8" + 0.6336887949258883 * keras_input_1_rn."Feature_9" AS dot_prod_1, -1.6954897323340379 + -0.7092122806451382 * keras_input_1_rn."Feature_0" + 0.5730416824294156 * keras_input_1_rn."Feature_1" + -0.4424850060015756 * keras_input_1_rn."Feature_2" + -0.7472113781980433 * keras_input_1_rn."Feature_3" + -0.2372391651902106 * keras_input_1_rn."Feature_4" + -0.10948648137479546 * keras_input_1_rn."Feature_5" + 0.5350912990790906 * keras_input_1_rn."Feature_6" + 0.24809431669955628 * keras_input_1_rn."Feature_7" + -1.0712060650154571 * keras_input_1_rn."Feature_8" + -0.9782541610776495 * keras_input_1_rn."Feature_9" AS dot_prod_2 
  FROM keras_input_1_rn), 
  rnn_cte_simple_rnn_1(rn_1, "KEY", "PreviousState_1", "PreviousState_2", output_1, output_2, "State_1", "State_2") AS 
  (SELECT input_kernel_bias.rn AS rn_1, input_kernel_bias."KEY" AS "KEY", CAST(0.0 AS FLOAT) AS "PreviousState_1", CAST(0.0 AS FLOAT) AS "PreviousState_2", input_kernel_bias.dot_prod_1 + 0.0 AS output_1, input_kernel_bias.dot_prod_2 + 0.0 AS output_2, input_kernel_bias.dot_prod_1 + 0.0 AS "State_1", input_kernel_bias.dot_prod_2 + 0.0 AS "State_2" 
  FROM input_kernel_bias 
  WHERE input_kernel_bias.rn = 1 UNION ALL SELECT input_kernel_bias.rn AS rn, input_kernel_bias."KEY" AS "KEY", rnn_cte_simple_rnn_1."State_1" AS "PreviousState_1", rnn_cte_simple_rnn_1."State_2" AS "PreviousState_2", input_kernel_bias.dot_prod_1 + -0.777853910255811 * rnn_cte_simple_rnn_1."State_1" + 0.48355663221402023 * rnn_cte_simple_rnn_1."State_2" AS output_1, input_kernel_bias.dot_prod_2 + 0.31137683873673033 * rnn_cte_simple_rnn_1."State_1" + 0.8529843796416954 * rnn_cte_simple_rnn_1."State_2" AS output_2, input_kernel_bias.dot_prod_1 + -0.777853910255811 * rnn_cte_simple_rnn_1."State_1" + 0.48355663221402023 * rnn_cte_simple_rnn_1."State_2" AS "State_1", input_kernel_bias.dot_prod_2 + 0.31137683873673033 * rnn_cte_simple_rnn_1."State_1" + 0.8529843796416954 * rnn_cte_simple_rnn_1."State_2" AS "State_2" 
  FROM input_kernel_bias, rnn_cte_simple_rnn_1 
  WHERE input_kernel_bias.rn = rnn_cte_simple_rnn_1.rn_1 + 1), 
  simple_rnn_1 AS 
  (SELECT rnn_cte_simple_rnn_1."KEY" AS "KEY", CAST(rnn_cte_simple_rnn_1.output_1 AS FLOAT) AS output_1, CAST(rnn_cte_simple_rnn_1.output_2 AS FLOAT) AS output_2 
  FROM rnn_cte_simple_rnn_1), 
  simple_rnn_1_1 AS 
  (SELECT simple_rnn_1."KEY" AS "KEY", simple_rnn_1.output_1 AS output_1, simple_rnn_1.output_2 AS output_2 
  FROM simple_rnn_1), 
  layer_dense_1 AS 
  (SELECT simple_rnn_1_1."KEY" AS "KEY", 1.7854456864988797 + 1.4393271357569413 * simple_rnn_1_1.output_1 + -0.8643884942142301 * simple_rnn_1_1.output_2 AS output_1 
  FROM simple_rnn_1_1)
   SELECT layer_dense_1."KEY" AS "KEY", layer_dense_1.output_1 AS "Estimator" 
  FROM layer_dense_1