From 8b061bac721f6eeaa112162258eb130c919f79a6 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Mon, 28 Nov 2016 14:33:23 -0500 Subject: [PATCH] adds basic pgsql file --- src/pg/sql/21_gwr.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/pg/sql/21_gwr.sql diff --git a/src/pg/sql/21_gwr.sql b/src/pg/sql/21_gwr.sql new file mode 100644 index 0000000..59d62c1 --- /dev/null +++ b/src/pg/sql/21_gwr.sql @@ -0,0 +1,11 @@ +CREATE OR REPLACE FUNCTION +CDB_GWR(subquery text, dep_var text, ind_vars text[], + fixed boolean default False, kernel text default 'bisquare') +RETURNS table(v1 numeric, v2 numeric, v3 numeric, v4 numeric, v5 numeric, v6 numeric, rowid bigint) +AS $$ + +from crankshaft.regression import gwr + +return gwr(subquery, dep_var, ind_vars, fixed, kernel) + +$$ LANGUAGE plpythonu;