add crankshaft gwr_prediction infrastructure

This commit is contained in:
Taylor Oshan
2016-12-17 18:25:38 -07:00
parent 8fcb6a6553
commit 39c2e01827
3 changed files with 131 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
CREATE OR REPLACE FUNCTION
CDB_GWR_PREDICT(subquery text, dep_var text, ind_vars text[],
bw numeric default null, fixed boolean default False, kernel text default 'bisquare')
RETURNS table(coeffs JSON, stand_errs JSON, t_vals JSON, r_squared numeric, predicted numeric, rowid bigint)
AS $$
from crankshaft.regression import gwr_cs
return gwr_cs.gwr_predict(subquery, dep_var, ind_vars, bw, fixed, kernel)
$$ LANGUAGE plpythonu;