text: -- This SQL code was generated by sklearn2sql (development version).
  -- Copyright 2018
  
  -- Model : CaretClassifier_rpart
  -- Dataset : iris_str_tgt
  -- Database : oracle
  
  
  -- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
  
  
  
  -- Model deployment code
  
  WITH "DT_node_lookup" AS 
  (SELECT "ADS"."KEY" AS "KEY", CASE WHEN ("ADS"."Feature_2" < 2.45) THEN 2 ELSE CASE WHEN ("ADS"."Feature_2" < 4.85) THEN 6 ELSE 7 END END AS node_id_2 
  FROM "IRIS_STR_TGT" "ADS"), 
  "DT_node_data" AS 
  (SELECT "Values".nid AS nid, "Values"."P_CLASS_0" AS "P_CLASS_0", "Values"."P_CLASS_1" AS "P_CLASS_1", "Values"."P_CLASS_2" AS "P_CLASS_2", "Values"."D" AS "D", "Values"."DP" AS "DP" 
  FROM (SELECT 2 AS nid, 1.0 AS "P_CLASS_0", 0.0 AS "P_CLASS_1", 0.0 AS "P_CLASS_2", 'CLASS_0' AS "D", 1.0 AS "DP" FROM DUAL UNION ALL SELECT 6 AS nid, 0.0 AS "P_CLASS_0", 0.9487179487179488 AS "P_CLASS_1", 0.05128205128205128 AS "P_CLASS_2", 'CLASS_1' AS "D", 0.9487179487179488 AS "DP" FROM DUAL UNION ALL SELECT 7 AS nid, 0.0 AS "P_CLASS_0", 0.06818181818181819 AS "P_CLASS_1", 0.9318181818181818 AS "P_CLASS_2", 'CLASS_2' AS "D", 0.9318181818181818 AS "DP" FROM DUAL) "Values"), 
  "DT_Output" AS 
  (SELECT "DT_node_lookup"."KEY" AS "KEY", "DT_node_lookup".node_id_2 AS node_id_2, "DT_node_data".nid AS nid, "DT_node_data"."P_CLASS_0" AS "P_CLASS_0", "DT_node_data"."P_CLASS_1" AS "P_CLASS_1", "DT_node_data"."P_CLASS_2" AS "P_CLASS_2", "DT_node_data"."D" AS "D", "DT_node_data"."DP" AS "DP" 
  FROM "DT_node_lookup" LEFT OUTER JOIN "DT_node_data" ON "DT_node_lookup".node_id_2 = "DT_node_data".nid)
   SELECT "DT_Output"."KEY" AS "KEY", CAST(NULL AS BINARY_DOUBLE) AS "Score_CLASS_0", CAST(NULL AS BINARY_DOUBLE) AS "Score_CLASS_1", CAST(NULL AS BINARY_DOUBLE) AS "Score_CLASS_2", "DT_Output"."P_CLASS_0" AS "Proba_CLASS_0", "DT_Output"."P_CLASS_1" AS "Proba_CLASS_1", "DT_Output"."P_CLASS_2" AS "Proba_CLASS_2", CASE WHEN ("DT_Output"."P_CLASS_0" IS NULL OR "DT_Output"."P_CLASS_0" > 0.0) THEN ln("DT_Output"."P_CLASS_0") ELSE -BINARY_DOUBLE_INFINITY END AS "LogProba_CLASS_0", CASE WHEN ("DT_Output"."P_CLASS_1" IS NULL OR "DT_Output"."P_CLASS_1" > 0.0) THEN ln("DT_Output"."P_CLASS_1") ELSE -BINARY_DOUBLE_INFINITY END AS "LogProba_CLASS_1", CASE WHEN ("DT_Output"."P_CLASS_2" IS NULL OR "DT_Output"."P_CLASS_2" > 0.0) THEN ln("DT_Output"."P_CLASS_2") ELSE -BINARY_DOUBLE_INFINITY END AS "LogProba_CLASS_2", "DT_Output"."D" AS "Decision", "DT_Output"."DP" AS "DecisionProba" 
  FROM "DT_Output"