CartoDB / crankshaft

CARTO Spatial Analysis extension for PostgreSQL
BSD 3-Clause "New" or "Revised" License
54 stars 20 forks source link

Refactors segmentation to add analysis provider support #171

Closed mehak-sachdeva closed 6 years ago

mehak-sachdeva commented 7 years ago

@stuartlynn, @andy-esch
Refactored the segmentation function to have data provider framework. Tested with a basic dataset and the model works fine. Testing it with more complex datasets and updating the test_segmentation.py subsequently.

mehak-sachdeva commented 7 years ago

@andy-esch : Tried mitigating the tests but it is still failing with a 'fetch' AttributeError. Could you please look into it to see what is going on and how best to proceed? Thank you! @stuartlynn : for visibility

stuartlynn commented 6 years ago

@andy-esch If it's easy to do we should change the name of this analysis to Random Forest Regressor as I think it more accurately describes the analysis that's being run here.

andy-esch commented 6 years ago

We can create some new functions that alias the originals pretty easily:

CREATE OR REPLACE FUNCTION CDB_RandomForestRegressor(...) RETURNS ... AS $$
BEGIN
RETURNS QUERY SELECT * FROM CDB_CreateAndPredictSegment(...);
END;
$$ LANGUAGE plpgsql;