text: -- This SQL code was generated by sklearn2sql (development version).
  -- Copyright 2018
  
  -- Model : CaretRegressor_earth
  -- Dataset : freidman3
  -- Database : monetdb
  
  
  -- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
  
  
  
  -- Model deployment code
  
  WITH earth_input AS 
  (SELECT "ADS"."KEY" AS "KEY", CAST("ADS"."Feature_0" AS DOUBLE) AS "Feature_0", CAST("ADS"."Feature_1" AS DOUBLE) AS "Feature_1", CAST("ADS"."Feature_2" AS DOUBLE) AS "Feature_2", CAST("ADS"."Feature_3" AS DOUBLE) AS "Feature_3" 
  FROM freidman3 AS "ADS"), 
  earth_model_cte AS 
  (SELECT earth_input."KEY" AS "KEY", 5.867737858236528 * CASE WHEN (earth_input."Feature_2" - 0.2652322291034745 <= 0) THEN 0 ELSE earth_input."Feature_2" - 0.2652322291034745 END + -7.075692863940879 * CASE WHEN (0.2652322291034745 - earth_input."Feature_2" <= 0) THEN 0 ELSE 0.2652322291034745 - earth_input."Feature_2" END + -0.0002235368692976543 * CASE WHEN (1631.018157352114 - earth_input."Feature_1" <= 0) THEN 0 ELSE 1631.018157352114 - earth_input."Feature_1" END + 0.007404389317700331 * CASE WHEN (earth_input."Feature_0" - 39.224203713738255 <= 0) THEN 0 ELSE earth_input."Feature_0" - 39.224203713738255 END + -5.6604444760618975 * CASE WHEN (earth_input."Feature_2" - 0.1044772945574536 <= 0) THEN 0 ELSE earth_input."Feature_2" - 0.1044772945574536 END + -0.00924093692601828 * CASE WHEN (earth_input."Feature_0" - 15.86010468726484 <= 0) THEN 0 ELSE earth_input."Feature_0" - 15.86010468726484 END + 2.6173183123110806 AS "Estimator" 
  FROM earth_input)
   SELECT earth_model_cte."KEY" AS "KEY", earth_model_cte."Estimator" AS "Estimator" 
  FROM earth_model_cte