mirror of
https://github.com/CartoDB/crankshaft.git
synced 2024-11-01 10:20:48 +08:00
consolidate gwr sql functions
This commit is contained in:
parent
d95ca54cdc
commit
ba54e9b42d
@ -11,3 +11,17 @@ gwr = GWR()
|
||||
return gwr.gwr(subquery, dep_var, ind_vars, bw, fixed, kernel)
|
||||
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
|
||||
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;
|
||||
|
@ -1,11 +0,0 @@
|
||||
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;
|
Loading…
Reference in New Issue
Block a user