From f2bb0b496bc9f86d2d09db583cb4677d73d94a50 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Mon, 26 Sep 2016 16:51:22 -0400 Subject: [PATCH] small fixes --- src/pg/sql/18_outliers.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pg/sql/18_outliers.sql b/src/pg/sql/18_outliers.sql index 48588ce..7d4b3b2 100644 --- a/src/pg/sql/18_outliers.sql +++ b/src/pg/sql/18_outliers.sql @@ -1,5 +1,8 @@ + +-- Find outliers using a static threshold +-- CREATE OR REPLACE FUNCTION CDB_StaticOutlier(attr numeric, threshold numeric) -RETURNS numeric +RETURNS boolean AS $$ BEGIN @@ -8,6 +11,7 @@ BEGIN END; $$ LANGUAGE plpgsql; +-- Find outliers by a percentage above the threshold CREATE OR REPLACE FUNCTION CDB_PercentOutlier(attr numeric[], outlier_fraction numeric, ids int[]) RETURNS TABLE(outlier boolean, rowid int) @@ -29,6 +33,8 @@ BEGIN END; $$ LANGUAGE plpgsql; +-- Find outliers above a given number of standard deviations from the mean + CREATE OR REPLACE FUNCTION CDB_StdDevOutlier(attrs numeric[], num_deviations numeric, ids int[]) RETURNS TABLE(outlier boolean, rowid int) AS $$