update tests

This commit is contained in:
Andy Eschbacher 2016-06-27 09:57:23 -04:00
parent c80975fe46
commit a5e4ae99ce
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
\pset format unaligned
\set ECHO all
\set ECHO none
\i test/fixtures/ml_values.sql
SELECT cdb_crankshaft._cdb_random_seeds(1234);
SELECT prediction from cdb_crankshaft.CDB_CreateAndPredictSegment('select target,x1,x2,x3 from ml_values where class= $$train$$','target','select cartodb_id, target,x1,x2,x3 from ml_values where class=$$test$$') limit 20
SELECT prediction FROM cdb_crankshaft.CDB_CreateAndPredictSegment('SELECT target, x1, x2, x3 FROM ml_values WHERE class = $$train$$','target','SELECT cartodb_id, target, x1, x2, x3 FROM ml_values WHERE class = $$test$$') LIMIT 20;

View File

@ -23,6 +23,11 @@ class SegmentationTest(unittest.TestCase):
else:
return [dict( zip(['x1','x2','x3','target', 'cartodb_id'],[x1,x2,x3,y,cartodb_id]))]
def test_replace_nan_with_mean(self):
test_array = np.array([1.2, np.nan, 3.2, np.nan, np.nan])
def test_create_and_predict_segment(self):
n_samples = 1000