(impl)
return result
Creates combined schemas for a bare operator implementation class.

    Used when there were no explicit combined schemas provided when
    the operator was created. The default schema provides defaults by
    inspecting the signature of the ``__init__`` method, and uses
    'Any' types for the inputs and outputs of other methods.

    Returns
    -------
    JSON Schema
        Combined schema with properties for hyperparams and
        all applicable method inputs and outputs.
Creates combined schemas for a bare operator implementation class.
Creates combined schemas for a bare operator implementation class .
def get_default_schema(impl):
    """Creates combined schemas for a bare operator implementation class.

    Used when there were no explicit combined schemas provided when
    the operator was created. The default schema provides defaults by
    inspecting the signature of the ``__init__`` method, and uses
    'Any' types for the inputs and outputs of other methods.

    Returns
    -------
    JSON Schema
        Combined schema with properties for hyperparams and
        all applicable method inputs and outputs.
    """
    if hasattr(impl, "__init__"):
        hyperparams_schema = _get_args_schema(impl.__init__)
    else:
        hyperparams_schema = {"type": "object", "properties": {}}
    hyperparams_schema["relevantToOptimizer"] = []
    method_schemas: Dict[str, JSON_TYPE] = {
        "hyperparams": {"allOf": [hyperparams_schema]}
    }
    if hasattr(impl, "fit"):
        method_schemas["input_fit"] = _get_args_schema(impl.fit)
    for method_name in ["predict", "predict_proba", "transform"]:
        if hasattr(impl, method_name):
            method_args_schema = _get_args_schema(getattr(impl, method_name))
            method_schemas["input_" + method_name] = method_args_schema
            method_schemas["output_" + method_name] = {"laleType": "Any"}
    tags = {
        "pre": [],
        "op": (["transformer"] if hasattr(impl, "transform") else [])
        + (["estimator"] if hasattr(impl, "predict") else []),
        "post": [],
    }
    result = {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": f"Schema for {type(impl)} auto-generated by lale.type_checking.get_default_schema().",
        "type": "object",
        "tags": tags,
        "properties": method_schemas,
    }
    return result
def get_default_schema ( impl ) : if hasattr ( impl , "__init__" ) : hyperparams_schema = _get_args_schema ( impl . __init__ ) else : hyperparams_schema = { "type" : "object" , "properties" : { } } hyperparams_schema [ "relevantToOptimizer" ] = [ ] method_schemas : Dict [ str , JSON_TYPE ] = { "hyperparams" : { "allOf" : [ hyperparams_schema ] } } if hasattr ( impl , "fit" ) : method_schemas [ "input_fit" ] = _get_args_schema ( impl . fit ) for method_name in [ "predict" , "predict_proba" , "transform" ] : if hasattr ( impl , method_name ) : method_args_schema = _get_args_schema ( getattr ( impl , method_name ) ) method_schemas [ "input_" + method_name ] = method_args_schema method_schemas [ "output_" + method_name ] = { "laleType" : "Any" } tags = { "pre" : [ ] , "op" : ( [ "transformer" ] if hasattr ( impl , "transform" ) else [ ] ) + ( [ "estimator" ] if hasattr ( impl , "predict" ) else [ ] ) , "post" : [ ] , } result = { "$schema" : "http://json-schema.org/draft-04/schema#" , "description" : f"Schema for {type(impl)} auto-generated by lale.type_checking.get_default_schema()." , "type" : "object" , "tags" : tags , "properties" : method_schemas , } return result