(self, s_X)
return result
Used internally by Lale for type-checking downstream operators.
Used internally by Lale for type-checking downstream operators.
Used internally by Lale for type - checking downstream operators .
def transform_schema(self, s_X):
        """Used internally by Lale for type-checking downstream operators."""
        s_X = lale.datasets.data_schemas.to_schema(s_X)
        if self.remainder == "drop" and self.combine == "keep_separate":
            out_names = [pa["feature"] for pa in self.protected_attributes]
            if all([isinstance(n, str) for n in out_names]):
                result = {
                    **s_X,
                    "items": {
                        "type": "array",
                        "minItems": len(out_names),
                        "maxItems": len(out_names),
                        "items": [
                            {"description": n, "enum": [0, 0.5, 1]} for n in out_names
                        ],
                    },
                }
            else:
                result = {
                    **s_X,
                    "items": {
                        "type": "array",
                        "minItems": len(out_names),
                        "maxItems": len(out_names),
                        "items": {"enum": [0, 0.5, 1]},
                    },
                }
        else:
            result = {
                "type": "array",
                "items": {
                    "anyOf": [
                        {"type": "array", "items": {"type": "number"}},
                        {"type": "array", "items": {"type": "string"}},
                    ],
                },
            }
        return result
def transform_schema ( self , s_X ) : s_X = lale . datasets . data_schemas . to_schema ( s_X ) if self . remainder == "drop" and self . combine == "keep_separate" : out_names = [ pa [ "feature" ] for pa in self . protected_attributes ] if all ( [ isinstance ( n , str ) for n in out_names ] ) : result = { * * s_X , "items" : { "type" : "array" , "minItems" : len ( out_names ) , "maxItems" : len ( out_names ) , "items" : [ { "description" : n , "enum" : [ 0 , 0.5 , 1 ] } for n in out_names ] , } , } else : result = { * * s_X , "items" : { "type" : "array" , "minItems" : len ( out_names ) , "maxItems" : len ( out_names ) , "items" : { "enum" : [ 0 , 0.5 , 1 ] } , } , } else : result = { "type" : "array" , "items" : { "anyOf" : [ { "type" : "array" , "items" : { "type" : "number" } } , { "type" : "array" , "items" : { "type" : "string" } } , ] , } , } return result