Esempio n. 1
0
 def test_override_bool_param_ll(self):
     init = self.ll_pca.hyperparam_schema('whiten')
     expected = {'default': True, 'type': 'boolean'}
     foo = self.ll_pca.customize_schema(whiten=schemas.Bool(default=True))
     self.assertEqual(foo.hyperparam_schema('whiten'), expected)
     helpers.validate_is_schema(foo._schemas)
     self.assertEqual(self.ll_pca.hyperparam_schema('whiten'), init)
     self.assertRaises(Exception, self.ll_pca.customize_schema, whitenX={})
Esempio n. 2
0
 def test_override_bool_param_ll(self):
     init = self.ll_pca.hyperparam_schema("whiten")
     expected = {"default": True, "type": "boolean"}
     foo = self.ll_pca.customize_schema(whiten=schemas.Bool(default=True))
     self.assertEqual(foo.hyperparam_schema("whiten"), expected)
     lale.type_checking.validate_is_schema(foo._schemas)
     self.assertEqual(self.ll_pca.hyperparam_schema("whiten"), init)
     self.assertRaises(Exception, self.ll_pca.customize_schema, whitenX={})
Esempio n. 3
0
 def test_override_bool_param_sk(self):
     with EnableSchemaValidation():
         init = self.sk_pca.hyperparam_schema("whiten")
         expected = {"default": True, "type": "boolean", "description": "override"}
         foo = self.sk_pca.customize_schema(
             whiten=schemas.Bool(default=True, desc="override")
         )
         self.assertEqual(foo.hyperparam_schema("whiten"), expected)
         lale.type_checking.validate_is_schema(foo._schemas)
         self.assertEqual(self.sk_pca.hyperparam_schema("whiten"), init)
         self.assertRaises(Exception, self.sk_pca.customize_schema, whitenX=42)
Esempio n. 4
0
 def test_override_bool_param_sk(self):
     init = self.sk_pca.hyperparam_schema('whiten')
     expected = {'default': True,
                 'type': 'boolean',
                 'description': 'override'}
     foo = self.sk_pca.customize_schema(
         whiten=schemas.Bool(default=True, desc='override'))
     self.assertEqual(foo.hyperparam_schema('whiten'), expected)
     lale.type_checking.validate_is_schema(foo._schemas)
     self.assertEqual(self.sk_pca.hyperparam_schema('whiten'), init)
     self.assertRaises(Exception, self.sk_pca.customize_schema, whitenX={})