def testOutlierScrubber3b(self): outlierScrubber = OutlierScrubber(all_z=1) outlierScrubber.scrub(self.data_model) self.assertEqual(len(self.data_model.get_dataframe()), 5)
def setOutlierScrubber1(self): with self.assertRaises(AssertionError): outlier_scrubber = OutlierScrubber(col_z={'num_1': 2, 'cat_1': 3}) outlier_scrubber.scrub(self.data_model)
def testOutlierScrubber2(self): outlierScrubber = OutlierScrubber(col_z={'num_1': 2, 'num_2': 3}) outlierScrubber.scrub(self.data_model) self.assertEqual(len(self.data_model.get_dataframe()), 9)
def testOutlierValidate(self): scrubber = OutlierScrubber(col_z={'num_1': 2, 'num_2': 3}) scrubber.validate(self.data_model)
def testOutlierValidateFalse(self): scrubber = OutlierScrubber(col_z={'num_1': 2, 'num_3': 3}) with self.assertRaises(AssertionError): scrubber.validate(self.data_model)
def testOutlierValidateMetaData(self): scrubber = OutlierScrubber(col_z={'num_1': 2, 'num_2': 3}) scrubber.validate_metadata(self.data_model.metadata)
def testOutlierValidateMetaDataFalse(self): scrubber = OutlierScrubber(col_z={'num_1': 2, 'num_3': 3}) with self.assertRaises(RuntimeError): scrubber.validate_metadata(self.data_model.metadata)
def testOutlierScrubberConfig(self): scrubber = OutlierScrubber(col_z={'num_1': 2, 'num_2': 3}) config = scrubber.scrubber_config_list self.assertEqual(config['num_1'], MetaData.NUMERICAL_DATA_TYPE) self.assertEqual(config['num_2'], MetaData.NUMERICAL_DATA_TYPE)
def testOutlierScrubberCreate4(self): with self.assertRaises(AssertionError): OutlierScrubber()
def testOutlierScrubberCreate3(self): with self.assertRaises(AssertionError): OutlierScrubber(col_z={'num_1': 2, 'num_2': 3}, all_z=2)
def testOutlierScrubberCreate2(self): OutlierScrubber(all_z=2)
def testOutlierScrubberCreate1(self): OutlierScrubber(col_z={'num_1': 2, 'num_2': 3})