adding function to predict the importance of different features to a dataset.
This commit is contained in:
@@ -13,6 +13,18 @@ AS $$
|
||||
return segmentation.create_segment(segment_name,table_name,column_name,geoid_column,census_table,'random_forest')
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
CREATE OR REPLACE FUNCTION
|
||||
cdb_correlated_variables(
|
||||
query text,
|
||||
geoid_column text DEFAULT 'geoid',
|
||||
census_table text DEFAULT 'ml_learning_block_groups_clipped'
|
||||
)
|
||||
RETURNS TABLE(feature text, importance NUMERIC, std NUMERIC)
|
||||
AS $$
|
||||
from crankshaft.segmentation import correlated_variables
|
||||
return correlated_variables(query,geoid_column,census_table)
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
CREATE OR REPLACE FUNCTION
|
||||
cdb_predict_segment (
|
||||
segment_name TEXT,
|
||||
|
||||
Reference in New Issue
Block a user