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;