text: -- This SQL code was generated by sklearn2sql (development version).
  -- Copyright 2018
  
  -- Model : KerasRegressor_SimpleRNN
  -- Dataset : RandomReg_10
  -- Database : mysql
  
  
  -- 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 `RandomReg_10` 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`, 0.04211666129067525 + 0.7502473761442655 * keras_input_1_rn.`Feature_0` + 0.058359321572432295 * keras_input_1_rn.`Feature_1` + 0.9106053778585984 * keras_input_1_rn.`Feature_2` + 0.33091753431593984 * keras_input_1_rn.`Feature_3` + -0.01751573928094969 * keras_input_1_rn.`Feature_4` + 0.3858097765750751 * keras_input_1_rn.`Feature_5` + 0.8541186418527016 * keras_input_1_rn.`Feature_6` + -0.10507320030957049 * keras_input_1_rn.`Feature_7` + 1.1054184620319343 * keras_input_1_rn.`Feature_8` + 0.4056287281195767 * keras_input_1_rn.`Feature_9` AS dot_prod_1, -0.04118678612757394 + -0.6901624832889157 * keras_input_1_rn.`Feature_0` + 0.258846395658421 * keras_input_1_rn.`Feature_1` + -0.3598999581720874 * keras_input_1_rn.`Feature_2` + -0.5826225116423182 * keras_input_1_rn.`Feature_3` + -0.2839636399176356 * keras_input_1_rn.`Feature_4` + -0.21363683409409787 * keras_input_1_rn.`Feature_5` + -0.08130308086964591 * keras_input_1_rn.`Feature_6` + 0.466934753789473 * keras_input_1_rn.`Feature_7` + -0.9135314850837563 * keras_input_1_rn.`Feature_8` + -0.7792501745983982 * 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 DOUBLE) AS `PreviousState_1`, CAST(0.0 AS DOUBLE) 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.7982475361145277 * rnn_cte_simple_rnn_1.`State_1` + 0.41639079514601957 * rnn_cte_simple_rnn_1.`State_2` AS output_1, input_kernel_bias.dot_prod_2 + 0.3288776320169942 * rnn_cte_simple_rnn_1.`State_1` + 0.916237007988889 * rnn_cte_simple_rnn_1.`State_2` AS output_2, input_kernel_bias.dot_prod_1 + -0.7982475361145277 * rnn_cte_simple_rnn_1.`State_1` + 0.41639079514601957 * rnn_cte_simple_rnn_1.`State_2` AS `State_1`, input_kernel_bias.dot_prod_2 + 0.3288776320169942 * rnn_cte_simple_rnn_1.`State_1` + 0.916237007988889 * 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 DOUBLE) AS output_1, CAST(rnn_cte_simple_rnn_1.output_2 AS DOUBLE) 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`, 0.04144625557266666 + 1.4186631788703201 * simple_rnn_1_1.output_1 + -0.9299099450598407 * 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