text: -- This SQL code was generated by sklearn2sql (development version).
  -- Copyright 2018
  
  -- Model : CaretClassifier_svmRadial
  -- Dataset : iris_str_tgt
  -- Database : teradata
  
  
  -- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
  
  
  
  -- Model deployment code
  
  WITH kernel_input_with_scaling AS 
  (SELECT "ADS"."KEY" AS "KEY", (CAST("ADS"."Feature_0" AS DOUBLE PRECISION) - 5.8475) / 0.8305068311812105 AS "Feature_0", (CAST("ADS"."Feature_1" AS DOUBLE PRECISION) - 3.040833333333333) / 0.4410636176856331 AS "Feature_1", (CAST("ADS"."Feature_2" AS DOUBLE PRECISION) - 3.8441666666666667) / 1.7181578875675667 AS "Feature_2", (CAST("ADS"."Feature_3" AS DOUBLE PRECISION) - 1.245833333333333) / 0.7517929083403303 AS "Feature_3" 
  FROM iris_str_tgt AS "ADS"), 
  dummy_cte AS 
  (SELECT CAST(0.0 AS DOUBLE PRECISION) AS "X"), 
  "SV_data_CLASS_0" AS 
  (SELECT "Values".sv_idx AS sv_idx, "Values".dual_coeff AS dual_coeff, "Values".sv_0 AS sv_0, "Values".sv_1 AS sv_1, "Values".sv_2 AS sv_2, "Values".sv_3 AS sv_3 
  FROM (SELECT 0 AS sv_idx, CAST(-0.141466421131295 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.502094809052576 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(-1.422550677299469 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 1 AS sv_idx, CAST(-0.355658930204455 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.020461202943533 AS DOUBLE PRECISION) AS sv_0, CAST(1.041044076761589 AS DOUBLE PRECISION) AS sv_1, CAST(-1.306146939641142 AS DOUBLE PRECISION) AS sv_2, CAST(-0.859057495978627 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 2 AS sv_idx, CAST(0.42157034123486 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.146890024547156 AS DOUBLE PRECISION) AS sv_0, CAST(-0.54602856294755 AS DOUBLE PRECISION) AS sv_1, CAST(0.556312862892087 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749736 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 3 AS sv_idx, CAST(-0.008399572915178 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.538827596834491 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(-1.364348808470305 AS DOUBLE PRECISION) AS sv_2, CAST(-1.125088204410718 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 4 AS sv_idx, CAST(-0.005690865852704 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.900052801416273 AS DOUBLE PRECISION) AS sv_0, CAST(0.587594751130406 AS DOUBLE PRECISION) AS sv_1, CAST(-1.247945070811978 AS DOUBLE PRECISION) AS sv_2, CAST(-0.992072850194672 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 5 AS sv_idx, CAST(0.346429673250518 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.900052801416273 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(-0.491320776032854 AS DOUBLE PRECISION) AS sv_2, CAST(-0.1939807248984 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 6 AS sv_idx, CAST(0.245943191905218 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.057193990725449 AS DOUBLE PRECISION) AS sv_0, CAST(-0.77275322576314 AS DOUBLE PRECISION) AS sv_1, CAST(0.148899781087943 AS DOUBLE PRECISION) AS sv_2, CAST(-0.326996079114445 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 7 AS sv_idx, CAST(0.579970585305809 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.387706827601678 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(0.498110994062923 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749736 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 8 AS sv_idx, CAST(-0.451501466611235 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.177602392252709 AS DOUBLE PRECISION) AS sv_0, CAST(1.721218065208362 AS DOUBLE PRECISION) AS sv_1, CAST(-1.247945070811978 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 9 AS sv_idx, CAST(0.127133018081395 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.779644399889012 AS DOUBLE PRECISION) AS sv_0, CAST(-0.77275322576314 AS DOUBLE PRECISION) AS sv_1, CAST(0.032496043429616 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749736 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 10 AS sv_idx, CAST(0.694118495374433 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.424439615383594 AS DOUBLE PRECISION) AS sv_0, CAST(-1.906376539841096 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 11 AS sv_idx, CAST(0.250945240383461 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.140869604470794 AS DOUBLE PRECISION) AS sv_0, CAST(-1.452927214209914 AS DOUBLE PRECISION) AS sv_1, CAST(-0.316715169545364 AS DOUBLE PRECISION) AS sv_2, CAST(-0.326996079114445 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 12 AS sv_idx, CAST(-0.467479112224069 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.779644399889012 AS DOUBLE PRECISION) AS sv_0, CAST(2.401392053655136 AS DOUBLE PRECISION) AS sv_1, CAST(-1.364348808470305 AS DOUBLE PRECISION) AS sv_2, CAST(-1.524134267058854 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 13 AS sv_idx, CAST(0.108157987290325 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.063214410801812 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(0.556312862892087 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 14 AS sv_idx, CAST(0.574682676686362 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.471096046181828 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 15 AS sv_idx, CAST(0.12467776106128 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(0.61451473172125 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 16 AS sv_idx, CAST(0.711636327652255 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.020461202943533 AS DOUBLE PRECISION) AS sv_0, CAST(-2.359825865472279 AS DOUBLE PRECISION) AS sv_1, CAST(-0.200311431887037 AS DOUBLE PRECISION) AS sv_2, CAST(-0.326996079114445 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 17 AS sv_idx, CAST(-0.332714071331963 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.261278005998055 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(-1.422550677299469 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 18 AS sv_idx, CAST(0.471485263409178 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.538827596834491 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 19 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.622503210579836 AS DOUBLE PRECISION) AS sv_0, CAST(-1.679651877025506 AS DOUBLE PRECISION) AS sv_1, CAST(-1.480752546128632 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 20 AS sv_idx, CAST(0.056412109862546 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.026481623019896 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.672716600550414 AS DOUBLE PRECISION) AS sv_2, CAST(0.604111400397873 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 21 AS sv_idx, CAST(0.119367326411366 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.177602392252709 AS DOUBLE PRECISION) AS sv_0, CAST(-0.999477888578731 AS DOUBLE PRECISION) AS sv_1, CAST(-0.200311431887037 AS DOUBLE PRECISION) AS sv_2, CAST(-0.326996079114445 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 22 AS sv_idx, CAST(-0.824777959687648 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.177602392252709 AS DOUBLE PRECISION) AS sv_0, CAST(3.081566042101912 AS DOUBLE PRECISION) AS sv_1, CAST(-1.364348808470305 AS DOUBLE PRECISION) AS sv_2, CAST(-1.125088204410718 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 23 AS sv_idx, CAST(-0.366190533016291 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.538827596834491 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(-1.247945070811978 AS DOUBLE PRECISION) AS sv_2, CAST(-1.391118912842808 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 24 AS sv_idx, CAST(-0.201779024253415 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.140869604470794 AS DOUBLE PRECISION) AS sv_0, CAST(1.26776873957718 AS DOUBLE PRECISION) AS sv_1, CAST(-1.422550677299469 AS DOUBLE PRECISION) AS sv_2, CAST(-1.524134267058854 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 25 AS sv_idx, CAST(-0.676872040680752 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.863320013634358 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(-1.597156283786959 AS DOUBLE PRECISION) AS sv_2, CAST(-1.524134267058854 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte) AS "Values"), 
  "kernel_dp_CLASS_0" AS 
  (SELECT t."KEY" AS "KEY", t.dot_product AS dot_product 
  FROM (SELECT full_join_data_sv."KEY" AS "KEY", sum(CAST(full_join_data_sv.dot_prod1 AS DOUBLE PRECISION)) + CAST(0.075174877650959 AS DOUBLE PRECISION) AS dot_product 
  FROM (SELECT kernel_input_with_scaling."KEY" AS "KEY", "SV_data_CLASS_0".dual_coeff * exp(least(CAST(100.0 AS DOUBLE PRECISION), greatest(-CAST(100.0 AS DOUBLE PRECISION), CAST(-1.0 AS DOUBLE PRECISION) * (power(kernel_input_with_scaling."Feature_0" - "SV_data_CLASS_0".sv_0, 2) + power(kernel_input_with_scaling."Feature_1" - "SV_data_CLASS_0".sv_1, 2) + power(kernel_input_with_scaling."Feature_2" - "SV_data_CLASS_0".sv_2, 2) + power(kernel_input_with_scaling."Feature_3" - "SV_data_CLASS_0".sv_3, 2))))) AS dot_prod1 
  FROM kernel_input_with_scaling, "SV_data_CLASS_0") AS full_join_data_sv GROUP BY full_join_data_sv."KEY") AS t), 
  "OVR_Score_CLASS_0" AS 
  (SELECT "kernel_dp_CLASS_0"."KEY" AS "KEY_CLASS_0", CAST(1.0 AS DOUBLE PRECISION) / (CAST(1.0 AS DOUBLE PRECISION) + exp(least(CAST(100.0 AS DOUBLE PRECISION), greatest(-CAST(100.0 AS DOUBLE PRECISION), -(-("kernel_dp_CLASS_0".dot_product * CAST(-3.840864932129172 AS DOUBLE PRECISION) + CAST(0.124421932386753 AS DOUBLE PRECISION))))))) AS "Proba_CLASS_0", CAST(NULL AS DOUBLE PRECISION) AS "Score_CLASS_0" 
  FROM "kernel_dp_CLASS_0"), 
  "SV_data_CLASS_1" AS 
  (SELECT "Values".sv_idx AS sv_idx, "Values".dual_coeff AS dual_coeff, "Values".sv_0 AS sv_0, "Values".sv_1 AS sv_1, "Values".sv_2 AS sv_2, "Values".sv_3 AS sv_3 
  FROM (SELECT 0 AS sv_idx, CAST(0.285623361144802 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(0.587594751130406 AS DOUBLE PRECISION) AS sv_1, CAST(1.254735288842048 AS DOUBLE PRECISION) AS sv_2, CAST(1.668234234126236 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 1 AS sv_idx, CAST(0.640912769560537 AS DOUBLE PRECISION) AS dual_coeff, CAST(2.471382441347024 AS DOUBLE PRECISION) AS sv_0, CAST(1.721218065208362 AS DOUBLE PRECISION) AS sv_1, CAST(1.487542764158701 AS DOUBLE PRECISION) AS sv_2, CAST(1.003157463046009 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 2 AS sv_idx, CAST(-0.167237916984746 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.502094809052576 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(-1.422550677299469 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 3 AS sv_idx, CAST(-0.410174684309367 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.020461202943533 AS DOUBLE PRECISION) AS sv_0, CAST(1.041044076761589 AS DOUBLE PRECISION) AS sv_1, CAST(-1.306146939641142 AS DOUBLE PRECISION) AS sv_2, CAST(-0.859057495978627 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 4 AS sv_idx, CAST(0.301659593422774 AS DOUBLE PRECISION) AS dual_coeff, CAST(2.230565638292502 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(1.312937157671211 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694145 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 5 AS sv_idx, CAST(-0.004059310645841 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.538827596834491 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(-1.364348808470305 AS DOUBLE PRECISION) AS sv_2, CAST(-1.125088204410718 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 6 AS sv_idx, CAST(0.619185346572964 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.140869604470794 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.604111400397873 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 7 AS sv_idx, CAST(0.169106674563638 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.267298426074418 AS DOUBLE PRECISION) AS sv_0, CAST(0.134145425499225 AS DOUBLE PRECISION) AS sv_1, CAST(0.730918469379577 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694145 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 8 AS sv_idx, CAST(0.579137600442015 AS DOUBLE PRECISION) AS dual_coeff, CAST(2.230565638292502 AS DOUBLE PRECISION) AS sv_0, CAST(-0.999477888578731 AS DOUBLE PRECISION) AS sv_1, CAST(1.778552108304518 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694145 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 9 AS sv_idx, CAST(0.355217691274838 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.026481623019896 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(1.138331551183721 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 10 AS sv_idx, CAST(-0.516536263145191 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.177602392252709 AS DOUBLE PRECISION) AS sv_0, CAST(1.721218065208362 AS DOUBLE PRECISION) AS sv_1, CAST(-1.247945070811978 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 11 AS sv_idx, CAST(0.029929750643237 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.177602392252709 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(0.672716600550414 AS DOUBLE PRECISION) AS sv_2, CAST(1.003157463046009 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 12 AS sv_idx, CAST(0.013779726888359 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.628523630656199 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(1.254735288842048 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 13 AS sv_idx, CAST(0.272682763776372 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.556312862892087 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 14 AS sv_idx, CAST(-0.537369126601406 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.779644399889012 AS DOUBLE PRECISION) AS sv_0, CAST(2.401392053655136 AS DOUBLE PRECISION) AS sv_1, CAST(-1.364348808470305 AS DOUBLE PRECISION) AS sv_2, CAST(-1.524134267058854 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 15 AS sv_idx, CAST(0.154078021985622 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.304031213856332 AS DOUBLE PRECISION) AS sv_0, CAST(-0.999477888578731 AS DOUBLE PRECISION) AS sv_1, CAST(1.021927813525394 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749736 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 16 AS sv_idx, CAST(0.251094239081339 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.29801079377997 AS DOUBLE PRECISION) AS sv_0, CAST(-0.54602856294755 AS DOUBLE PRECISION) AS sv_1, CAST(0.61451473172125 AS DOUBLE PRECISION) AS sv_2, CAST(1.003157463046009 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 17 AS sv_idx, CAST(0.314871058675897 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.424439615383594 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(0.905524075867067 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694145 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 18 AS sv_idx, CAST(0.053420995208247 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-0.54602856294755 AS DOUBLE PRECISION) AS sv_1, CAST(0.730918469379577 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 19 AS sv_idx, CAST(0.423803885904757 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.628523630656199 AS DOUBLE PRECISION) AS sv_0, CAST(1.26776873957718 AS DOUBLE PRECISION) AS sv_1, CAST(1.312937157671211 AS DOUBLE PRECISION) AS sv_2, CAST(1.668234234126236 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 20 AS sv_idx, CAST(0.407407569755063 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.628523630656199 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(1.138331551183721 AS DOUBLE PRECISION) AS sv_2, CAST(0.471096046181828 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 21 AS sv_idx, CAST(0.525047972981961 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(-1.906376539841096 AS DOUBLE PRECISION) AS sv_1, CAST(0.672716600550414 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 22 AS sv_idx, CAST(-0.354132009208771 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.261278005998055 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(-1.422550677299469 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 23 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.622503210579836 AS DOUBLE PRECISION) AS sv_0, CAST(-1.679651877025506 AS DOUBLE PRECISION) AS sv_1, CAST(-1.480752546128632 AS DOUBLE PRECISION) AS sv_2, CAST(-1.258103558626763 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 24 AS sv_idx, CAST(-0.947337339632878 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.177602392252709 AS DOUBLE PRECISION) AS sv_0, CAST(3.081566042101912 AS DOUBLE PRECISION) AS sv_1, CAST(-1.364348808470305 AS DOUBLE PRECISION) AS sv_2, CAST(-1.125088204410718 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 25 AS sv_idx, CAST(-0.430093940990855 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.538827596834491 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(-1.247945070811978 AS DOUBLE PRECISION) AS sv_2, CAST(-1.391118912842808 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 26 AS sv_idx, CAST(-0.230135929907472 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.140869604470794 AS DOUBLE PRECISION) AS sv_0, CAST(1.26776873957718 AS DOUBLE PRECISION) AS sv_1, CAST(-1.422550677299469 AS DOUBLE PRECISION) AS sv_2, CAST(-1.524134267058854 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 27 AS sv_idx, CAST(-0.799882500455895 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.863320013634358 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(-1.597156283786959 AS DOUBLE PRECISION) AS sv_2, CAST(-1.524134267058854 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte) AS "Values"), 
  "kernel_dp_CLASS_1" AS 
  (SELECT t_1."KEY" AS "KEY", t_1.dot_product AS dot_product 
  FROM (SELECT full_join_data_sv_1."KEY" AS "KEY", sum(CAST(full_join_data_sv_1.dot_prod1 AS DOUBLE PRECISION)) + CAST(0.23457835361865 AS DOUBLE PRECISION) AS dot_product 
  FROM (SELECT kernel_input_with_scaling."KEY" AS "KEY", "SV_data_CLASS_1".dual_coeff * exp(least(CAST(100.0 AS DOUBLE PRECISION), greatest(-CAST(100.0 AS DOUBLE PRECISION), CAST(-1.0 AS DOUBLE PRECISION) * (power(kernel_input_with_scaling."Feature_0" - "SV_data_CLASS_1".sv_0, 2) + power(kernel_input_with_scaling."Feature_1" - "SV_data_CLASS_1".sv_1, 2) + power(kernel_input_with_scaling."Feature_2" - "SV_data_CLASS_1".sv_2, 2) + power(kernel_input_with_scaling."Feature_3" - "SV_data_CLASS_1".sv_3, 2))))) AS dot_prod1 
  FROM kernel_input_with_scaling, "SV_data_CLASS_1") AS full_join_data_sv_1 GROUP BY full_join_data_sv_1."KEY") AS t_1), 
  "OVR_Score_CLASS_1" AS 
  (SELECT "kernel_dp_CLASS_1"."KEY" AS "KEY_CLASS_1", CAST(1.0 AS DOUBLE PRECISION) / (CAST(1.0 AS DOUBLE PRECISION) + exp(least(CAST(100.0 AS DOUBLE PRECISION), greatest(-CAST(100.0 AS DOUBLE PRECISION), -(-("kernel_dp_CLASS_1".dot_product * CAST(-4.069859748248007 AS DOUBLE PRECISION) + CAST(0.404218276361327 AS DOUBLE PRECISION))))))) AS "Proba_CLASS_1", CAST(NULL AS DOUBLE PRECISION) AS "Score_CLASS_1" 
  FROM "kernel_dp_CLASS_1"), 
  "SV_data_CLASS_2" AS 
  (SELECT "Values".sv_idx AS sv_idx, "Values".dual_coeff AS dual_coeff, "Values".sv_0 AS sv_0, "Values".sv_1 AS sv_1, "Values".sv_2 AS sv_2, "Values".sv_3 AS sv_3 
  FROM (SELECT 0 AS sv_idx, CAST(0.695241917939624 AS DOUBLE PRECISION) AS dual_coeff, CAST(2.471382441347024 AS DOUBLE PRECISION) AS sv_0, CAST(1.721218065208362 AS DOUBLE PRECISION) AS sv_1, CAST(1.487542764158701 AS DOUBLE PRECISION) AS sv_2, CAST(1.003157463046009 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 1 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(-0.319303900131958 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 2 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.146890024547156 AS DOUBLE PRECISION) AS sv_0, CAST(-0.54602856294755 AS DOUBLE PRECISION) AS sv_1, CAST(0.556312862892087 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749737 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 3 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.304031213856332 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.61451473172125 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 4 AS sv_idx, CAST(0.198366211367568 AS DOUBLE PRECISION) AS dual_coeff, CAST(2.230565638292502 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(1.312937157671211 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694146 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 5 AS sv_idx, CAST(-0.120618032177333 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.29801079377997 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 6 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(0.587594751130406 AS DOUBLE PRECISION) AS sv_1, CAST(0.498110994062923 AS DOUBLE PRECISION) AS sv_2, CAST(0.471096046181828 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 7 AS sv_idx, CAST(-0.009619942213291 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.900052801416273 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(-0.491320776032854 AS DOUBLE PRECISION) AS sv_2, CAST(-0.193980724898399 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 8 AS sv_idx, CAST(-0.055650058851263 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.387706827601678 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(0.498110994062923 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749737 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 9 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.140869604470794 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.604111400397873 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 10 AS sv_idx, CAST(-0.396578656474325 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.418419195307231 AS DOUBLE PRECISION) AS sv_0, CAST(-1.679651877025506 AS DOUBLE PRECISION) AS sv_1, CAST(0.09069791225878 AS DOUBLE PRECISION) AS sv_2, CAST(0.072049983533691 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 11 AS sv_idx, CAST(0.650698020523969 AS DOUBLE PRECISION) AS dual_coeff, CAST(2.230565638292502 AS DOUBLE PRECISION) AS sv_0, CAST(-0.999477888578731 AS DOUBLE PRECISION) AS sv_1, CAST(1.778552108304518 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694146 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 12 AS sv_idx, CAST(0.306891029933913 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.026481623019896 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(1.138331551183721 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 13 AS sv_idx, CAST(-0.067138395917138 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.418419195307231 AS DOUBLE PRECISION) AS sv_0, CAST(-0.999477888578731 AS DOUBLE PRECISION) AS sv_1, CAST(0.323505387575433 AS DOUBLE PRECISION) AS sv_2, CAST(-0.060965370682354 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 14 AS sv_idx, CAST(-0.734664246383603 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.779644399889012 AS DOUBLE PRECISION) AS sv_0, CAST(-0.77275322576314 AS DOUBLE PRECISION) AS sv_1, CAST(0.032496043429616 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749737 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 15 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.785664819965375 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(0.730918469379577 AS DOUBLE PRECISION) AS sv_2, CAST(1.003157463046009 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 16 AS sv_idx, CAST(-0.658960961171626 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-1.679651877025506 AS DOUBLE PRECISION) AS sv_1, CAST(0.323505387575433 AS DOUBLE PRECISION) AS sv_2, CAST(0.072049983533691 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 17 AS sv_idx, CAST(0.527138816855794 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-0.77275322576314 AS DOUBLE PRECISION) AS sv_1, CAST(0.61451473172125 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 18 AS sv_idx, CAST(0.398454101726499 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.628523630656199 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(1.254735288842048 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 19 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.063214410801812 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.730918469379577 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 20 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.424439615383594 AS DOUBLE PRECISION) AS sv_0, CAST(-1.906376539841096 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 21 AS sv_idx, CAST(-0.523415129548255 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.140869604470794 AS DOUBLE PRECISION) AS sv_0, CAST(-1.452927214209914 AS DOUBLE PRECISION) AS sv_1, CAST(-0.316715169545364 AS DOUBLE PRECISION) AS sv_2, CAST(-0.326996079114445 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 22 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.556312862892087 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 23 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.304031213856332 AS DOUBLE PRECISION) AS sv_0, CAST(-0.999477888578731 AS DOUBLE PRECISION) AS sv_1, CAST(1.021927813525394 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749737 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 24 AS sv_idx, CAST(0.500098076262139 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.424439615383594 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(0.905524075867067 AS DOUBLE PRECISION) AS sv_2, CAST(1.402203525694146 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 25 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-0.54602856294755 AS DOUBLE PRECISION) AS sv_1, CAST(0.730918469379577 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 26 AS sv_idx, CAST(0.159465377957555 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.785664819965375 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.96372594469623 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 27 AS sv_idx, CAST(0.433375673010485 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.628523630656199 AS DOUBLE PRECISION) AS sv_0, CAST(1.26776873957718 AS DOUBLE PRECISION) AS sv_1, CAST(1.312937157671211 AS DOUBLE PRECISION) AS sv_2, CAST(1.668234234126236 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 28 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.628523630656199 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(1.138331551183721 AS DOUBLE PRECISION) AS sv_2, CAST(0.471096046181828 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 29 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.063214410801812 AS DOUBLE PRECISION) AS sv_0, CAST(0.360870088314816 AS DOUBLE PRECISION) AS sv_1, CAST(0.556312862892087 AS DOUBLE PRECISION) AS sv_2, CAST(0.737126754613918 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 30 AS sv_idx, CAST(-0.295765727579428 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(0.814319413945998 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.471096046181828 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 31 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(0.61451473172125 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 32 AS sv_idx, CAST(-0.811402350050051 AS DOUBLE PRECISION) AS dual_coeff, CAST(-1.020461202943533 AS DOUBLE PRECISION) AS sv_0, CAST(-2.359825865472279 AS DOUBLE PRECISION) AS sv_1, CAST(-0.200311431887037 AS DOUBLE PRECISION) AS sv_2, CAST(-0.326996079114445 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 33 AS sv_idx, CAST(1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.183622812329072 AS DOUBLE PRECISION) AS sv_0, CAST(-1.906376539841096 AS DOUBLE PRECISION) AS sv_1, CAST(0.672716600550414 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 34 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.304031213856332 AS DOUBLE PRECISION) AS sv_0, CAST(-0.319303900131958 AS DOUBLE PRECISION) AS sv_1, CAST(0.498110994062923 AS DOUBLE PRECISION) AS sv_2, CAST(0.205065337749737 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 35 AS sv_idx, CAST(-0.753263049266303 AS DOUBLE PRECISION) AS dual_coeff, CAST(-0.538827596834491 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.381707256404597 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 36 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.026481623019896 AS DOUBLE PRECISION) AS sv_0, CAST(-0.092579237316367 AS DOUBLE PRECISION) AS sv_1, CAST(0.672716600550414 AS DOUBLE PRECISION) AS sv_2, CAST(0.604111400397873 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 37 AS sv_idx, CAST(-0.128009464222156 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.304031213856332 AS DOUBLE PRECISION) AS sv_0, CAST(-0.54602856294755 AS DOUBLE PRECISION) AS sv_1, CAST(0.498110994062923 AS DOUBLE PRECISION) AS sv_2, CAST(-0.060965370682354 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 38 AS sv_idx, CAST(0.685356788277227 AS DOUBLE PRECISION) AS dual_coeff, CAST(0.544848016910854 AS DOUBLE PRECISION) AS sv_0, CAST(-1.226202551394323 AS DOUBLE PRECISION) AS sv_1, CAST(0.672716600550414 AS DOUBLE PRECISION) AS sv_2, CAST(0.870142108829964 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte UNION ALL SELECT 39 AS sv_idx, CAST(-1.0 AS DOUBLE PRECISION) AS dual_coeff, CAST(1.267298426074418 AS DOUBLE PRECISION) AS sv_0, CAST(0.134145425499225 AS DOUBLE PRECISION) AS sv_1, CAST(0.61451473172125 AS DOUBLE PRECISION) AS sv_2, CAST(0.338080691965782 AS DOUBLE PRECISION) AS sv_3 
  FROM dummy_cte) AS "Values"), 
  "kernel_dp_CLASS_2" AS 
  (SELECT t_2."KEY" AS "KEY", t_2.dot_product AS dot_product 
  FROM (SELECT full_join_data_sv_2."KEY" AS "KEY", sum(CAST(full_join_data_sv_2.dot_prod1 AS DOUBLE PRECISION)) + CAST(0.154010516024696 AS DOUBLE PRECISION) AS dot_product 
  FROM (SELECT kernel_input_with_scaling."KEY" AS "KEY", "SV_data_CLASS_2".dual_coeff * exp(least(CAST(100.0 AS DOUBLE PRECISION), greatest(-CAST(100.0 AS DOUBLE PRECISION), CAST(-1.0 AS DOUBLE PRECISION) * (power(kernel_input_with_scaling."Feature_0" - "SV_data_CLASS_2".sv_0, 2) + power(kernel_input_with_scaling."Feature_1" - "SV_data_CLASS_2".sv_1, 2) + power(kernel_input_with_scaling."Feature_2" - "SV_data_CLASS_2".sv_2, 2) + power(kernel_input_with_scaling."Feature_3" - "SV_data_CLASS_2".sv_3, 2))))) AS dot_prod1 
  FROM kernel_input_with_scaling, "SV_data_CLASS_2") AS full_join_data_sv_2 GROUP BY full_join_data_sv_2."KEY") AS t_2), 
  "OVR_Score_CLASS_2" AS 
  (SELECT "kernel_dp_CLASS_2"."KEY" AS "KEY_CLASS_2", CAST(1.0 AS DOUBLE PRECISION) / (CAST(1.0 AS DOUBLE PRECISION) + exp(least(CAST(100.0 AS DOUBLE PRECISION), greatest(-CAST(100.0 AS DOUBLE PRECISION), -(-("kernel_dp_CLASS_2".dot_product * CAST(-3.097200306485895 AS DOUBLE PRECISION) + CAST(-0.216851645049771 AS DOUBLE PRECISION))))))) AS "Proba_CLASS_2", CAST(NULL AS DOUBLE PRECISION) AS "Score_CLASS_2" 
  FROM "kernel_dp_CLASS_2"), 
  "OVR_Join_CTE" AS 
  (SELECT "OVR_Score_CLASS_0"."KEY_CLASS_0" AS "KEY_CLASS_0", "OVR_Score_CLASS_0"."Proba_CLASS_0" AS "Proba_CLASS_0", "OVR_Score_CLASS_0"."Score_CLASS_0" AS "Score_CLASS_0", "OVR_Score_CLASS_1"."KEY_CLASS_1" AS "KEY_CLASS_1", "OVR_Score_CLASS_1"."Proba_CLASS_1" AS "Proba_CLASS_1", "OVR_Score_CLASS_1"."Score_CLASS_1" AS "Score_CLASS_1", "OVR_Score_CLASS_2"."KEY_CLASS_2" AS "KEY_CLASS_2", "OVR_Score_CLASS_2"."Proba_CLASS_2" AS "Proba_CLASS_2", "OVR_Score_CLASS_2"."Score_CLASS_2" AS "Score_CLASS_2" 
  FROM "OVR_Score_CLASS_0" LEFT OUTER JOIN "OVR_Score_CLASS_1" ON "OVR_Score_CLASS_0"."KEY_CLASS_0" = "OVR_Score_CLASS_1"."KEY_CLASS_1" LEFT OUTER JOIN "OVR_Score_CLASS_2" ON "OVR_Score_CLASS_2"."KEY_CLASS_2" = "OVR_Score_CLASS_1"."KEY_CLASS_1"), 
  orig_cte AS 
  (SELECT "OVR_Join_CTE"."KEY_CLASS_0" AS "KEY", "OVR_Join_CTE"."Score_CLASS_0" AS "Score_CLASS_0", "OVR_Join_CTE"."Score_CLASS_1" AS "Score_CLASS_1", "OVR_Join_CTE"."Score_CLASS_2" AS "Score_CLASS_2", "OVR_Join_CTE"."Proba_CLASS_0" / ("OVR_Join_CTE"."Proba_CLASS_0" + "OVR_Join_CTE"."Proba_CLASS_1" + "OVR_Join_CTE"."Proba_CLASS_2") AS "Proba_CLASS_0", "OVR_Join_CTE"."Proba_CLASS_1" / ("OVR_Join_CTE"."Proba_CLASS_0" + "OVR_Join_CTE"."Proba_CLASS_1" + "OVR_Join_CTE"."Proba_CLASS_2") AS "Proba_CLASS_1", "OVR_Join_CTE"."Proba_CLASS_2" / ("OVR_Join_CTE"."Proba_CLASS_0" + "OVR_Join_CTE"."Proba_CLASS_1" + "OVR_Join_CTE"."Proba_CLASS_2") AS "Proba_CLASS_2", CAST(NULL AS DOUBLE PRECISION) AS "LogProba_CLASS_0", CAST(NULL AS DOUBLE PRECISION) AS "LogProba_CLASS_1", CAST(NULL AS DOUBLE PRECISION) AS "LogProba_CLASS_2", CAST(NULL AS BIGINT) AS "Decision", CAST(NULL AS DOUBLE PRECISION) AS "DecisionProba" 
  FROM "OVR_Join_CTE"), 
  score_class_union AS 
  (SELECT scu."KEY_u" AS "KEY_u", scu."class" AS "class", scu."LogProba" AS "LogProba", scu."Proba" AS "Proba", scu."Score" AS "Score" 
  FROM (SELECT orig_cte."KEY" AS "KEY_u", 'CLASS_0' AS "class", orig_cte."LogProba_CLASS_0" AS "LogProba", orig_cte."Proba_CLASS_0" AS "Proba", orig_cte."Score_CLASS_0" AS "Score" 
  FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", 'CLASS_1' AS "class", orig_cte."LogProba_CLASS_1" AS "LogProba", orig_cte."Proba_CLASS_1" AS "Proba", orig_cte."Score_CLASS_1" AS "Score" 
  FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", 'CLASS_2' AS "class", orig_cte."LogProba_CLASS_2" AS "LogProba", orig_cte."Proba_CLASS_2" AS "Proba", orig_cte."Score_CLASS_2" AS "Score" 
  FROM orig_cte) AS scu), 
  score_max AS 
  (SELECT orig_cte."KEY" AS "KEY", orig_cte."Score_CLASS_0" AS "Score_CLASS_0", orig_cte."Score_CLASS_1" AS "Score_CLASS_1", orig_cte."Score_CLASS_2" AS "Score_CLASS_2", orig_cte."Proba_CLASS_0" AS "Proba_CLASS_0", orig_cte."Proba_CLASS_1" AS "Proba_CLASS_1", orig_cte."Proba_CLASS_2" AS "Proba_CLASS_2", orig_cte."LogProba_CLASS_0" AS "LogProba_CLASS_0", orig_cte."LogProba_CLASS_1" AS "LogProba_CLASS_1", orig_cte."LogProba_CLASS_2" AS "LogProba_CLASS_2", orig_cte."Decision" AS "Decision", orig_cte."DecisionProba" AS "DecisionProba", max_select."KEY_m" AS "KEY_m", max_select."max_Score" AS "max_Score" 
  FROM orig_cte LEFT OUTER JOIN (SELECT score_class_union."KEY_u" AS "KEY_m", max(score_class_union."Score") AS "max_Score" 
  FROM score_class_union GROUP BY score_class_union."KEY_u") AS max_select ON orig_cte."KEY" = max_select."KEY_m"), 
  union_with_max AS 
  (SELECT score_class_union."KEY_u" AS "KEY_u", score_class_union."class" AS "class", score_class_union."LogProba" AS "LogProba", score_class_union."Proba" AS "Proba", score_class_union."Score" AS "Score", score_max."KEY" AS "KEY", score_max."Score_CLASS_0" AS "Score_CLASS_0", score_max."Score_CLASS_1" AS "Score_CLASS_1", score_max."Score_CLASS_2" AS "Score_CLASS_2", score_max."Proba_CLASS_0" AS "Proba_CLASS_0", score_max."Proba_CLASS_1" AS "Proba_CLASS_1", score_max."Proba_CLASS_2" AS "Proba_CLASS_2", score_max."LogProba_CLASS_0" AS "LogProba_CLASS_0", score_max."LogProba_CLASS_1" AS "LogProba_CLASS_1", score_max."LogProba_CLASS_2" AS "LogProba_CLASS_2", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Score" AS "max_Score" 
  FROM score_class_union LEFT OUTER JOIN score_max ON score_class_union."KEY_u" = score_max."KEY"), 
  arg_max_cte AS 
  (SELECT score_max."KEY" AS "KEY", score_max."Score_CLASS_0" AS "Score_CLASS_0", score_max."Score_CLASS_1" AS "Score_CLASS_1", score_max."Score_CLASS_2" AS "Score_CLASS_2", score_max."Proba_CLASS_0" AS "Proba_CLASS_0", score_max."Proba_CLASS_1" AS "Proba_CLASS_1", score_max."Proba_CLASS_2" AS "Proba_CLASS_2", score_max."LogProba_CLASS_0" AS "LogProba_CLASS_0", score_max."LogProba_CLASS_1" AS "LogProba_CLASS_1", score_max."LogProba_CLASS_2" AS "LogProba_CLASS_2", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Score" AS "max_Score", "arg_max_t_Score"."KEY_Score" AS "KEY_Score", "arg_max_t_Score"."arg_max_Score" AS "arg_max_Score" 
  FROM score_max LEFT OUTER JOIN (SELECT union_with_max."KEY" AS "KEY_Score", max(union_with_max."class") AS "arg_max_Score" 
  FROM union_with_max 
  WHERE union_with_max."max_Score" <= union_with_max."Score" GROUP BY union_with_max."KEY") AS "arg_max_t_Score" ON score_max."KEY" = "arg_max_t_Score"."KEY_Score")
   SELECT arg_max_cte."KEY" AS "KEY", arg_max_cte."Score_CLASS_0" AS "Score_CLASS_0", arg_max_cte."Score_CLASS_1" AS "Score_CLASS_1", arg_max_cte."Score_CLASS_2" AS "Score_CLASS_2", arg_max_cte."Proba_CLASS_0" AS "Proba_CLASS_0", arg_max_cte."Proba_CLASS_1" AS "Proba_CLASS_1", arg_max_cte."Proba_CLASS_2" AS "Proba_CLASS_2", CASE WHEN (arg_max_cte."Proba_CLASS_0" IS NULL OR arg_max_cte."Proba_CLASS_0" > CAST(0.0 AS DOUBLE PRECISION)) THEN ln(arg_max_cte."Proba_CLASS_0") ELSE -1.79769313486231e+308 END AS "LogProba_CLASS_0", CASE WHEN (arg_max_cte."Proba_CLASS_1" IS NULL OR arg_max_cte."Proba_CLASS_1" > CAST(0.0 AS DOUBLE PRECISION)) THEN ln(arg_max_cte."Proba_CLASS_1") ELSE -1.79769313486231e+308 END AS "LogProba_CLASS_1", CASE WHEN (arg_max_cte."Proba_CLASS_2" IS NULL OR arg_max_cte."Proba_CLASS_2" > CAST(0.0 AS DOUBLE PRECISION)) THEN ln(arg_max_cte."Proba_CLASS_2") ELSE -1.79769313486231e+308 END AS "LogProba_CLASS_2", arg_max_cte."arg_max_Score" AS "Decision", CASE WHEN (arg_max_cte."arg_max_Score" = 'CLASS_0') THEN arg_max_cte."Proba_CLASS_0" WHEN (arg_max_cte."arg_max_Score" = 'CLASS_1') THEN arg_max_cte."Proba_CLASS_1" WHEN (arg_max_cte."arg_max_Score" = 'CLASS_2') THEN arg_max_cte."Proba_CLASS_2" END AS "DecisionProba" 
  FROM arg_max_cte