mirror of
https://github.com/CartoDB/crankshaft.git
synced 2024-11-01 10:20:48 +08:00
predict -> class framework
This commit is contained in:
parent
92fc25f6b5
commit
e2cf12aaba
@ -1,7 +1,10 @@
|
||||
CREATE OR REPLACE FUNCTION
|
||||
CDB_GWR(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, predicted numeric, residuals numeric, r_squared numeric, bandwidth numeric, rowid bigint)
|
||||
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,
|
||||
bandwidth numeric, rowid bigint)
|
||||
AS $$
|
||||
|
||||
from crankshaft.regression import GWR
|
||||
@ -17,11 +20,13 @@ 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)
|
||||
RETURNS table(coeffs JSON, stand_errs JSON, t_vals JSON,
|
||||
r_squared numeric, predicted numeric, rowid bigint)
|
||||
AS $$
|
||||
|
||||
from crankshaft.regression import gwr_cs
|
||||
from crankshaft.regression import GWR
|
||||
gwr = GWR()
|
||||
|
||||
return gwr_cs.gwr_predict(subquery, dep_var, ind_vars, bw, fixed, kernel)
|
||||
return gwr.gwr_predict(subquery, dep_var, ind_vars, bw, fixed, kernel)
|
||||
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
Loading…
Reference in New Issue
Block a user