add bw flag that accepts user input

This commit is contained in:
Taylor Oshan
2016-11-29 13:44:36 -07:00
parent 22ce970062
commit 413e6aa5c7
2 changed files with 11 additions and 7 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
CREATE OR REPLACE FUNCTION
CDB_GWR(subquery text, dep_var text, ind_vars text[],
fixed boolean default False, kernel text default 'bisquare')
bw numeric default null, fixed boolean default False, kernel text default 'bisquare')
RETURNS table(coeffs JSON, stand_errs JSON, t_vals JSON, predicted numeric, residuals numeric, r_squared numeric, rowid bigint, bandwidth numeric)
AS $$
from crankshaft.regression import gwr_cs
return gwr_cs.gwr(subquery, dep_var, ind_vars, fixed, kernel)
return gwr_cs.gwr(subquery, dep_var, ind_vars, bw, fixed, kernel)
$$ LANGUAGE plpythonu;