(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."""
        is_fitted = hasattr(self._wrapped_model, "categories_")
        if not is_fitted:
            return _output_transform_schema
        in_names = None
        if "items" in s_X and "items" in s_X["items"]:
            col_schemas = s_X["items"]["items"]
            if isinstance(col_schemas, list):
                desc = [s.get("description", "") for s in col_schemas]
                if "" not in desc and len(desc) == len(set(desc)):
                    in_names = desc
        if in_names is None and hasattr(self, "_X_columns"):
            in_names = self._X_columns
        if in_names is None:
            return _output_transform_schema
        out_names = self._wrapped_model.get_feature_names(in_names)
        result = {
            **s_X,
            "items": {
                **(s_X.get("items", {})),
                "minItems": len(out_names),
                "maxItems": len(out_names),
                "items": [{"description": n, "type": "number"} for n in out_names],
            },
        }
        return result
def transform_schema ( self , s_X ) : is_fitted = hasattr ( self . _wrapped_model , "categories_" ) if not is_fitted : return _output_transform_schema in_names = None if "items" in s_X and "items" in s_X [ "items" ] : col_schemas = s_X [ "items" ] [ "items" ] if isinstance ( col_schemas , list ) : desc = [ s . get ( "description" , "" ) for s in col_schemas ] if "" not in desc and len ( desc ) == len ( set ( desc ) ) : in_names = desc if in_names is None and hasattr ( self , "_X_columns" ) : in_names = self . _X_columns if in_names is None : return _output_transform_schema out_names = self . _wrapped_model . get_feature_names ( in_names ) result = { * * s_X , "items" : { * * ( s_X . get ( "items" , { } ) ) , "minItems" : len ( out_names ) , "maxItems" : len ( out_names ) , "items" : [ { "description" : n , "type" : "number" } for n in out_names ] , } , } return result