# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Models.OvaModelCombiner
"""


from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist


def models_ovamodelcombiner(
        training_data,
        predictor_model=None,
        model_array=None,
        use_probabilities=True,
        feature_column='Features',
        label_column='Label',
        weight_column=None,
        normalize_features='Auto',
        caching='Auto',
        **params):
    """
    **Description**
        Combines a sequence of PredictorModels into a single model

    :param model_array: Input models (inputs).
    :param training_data: The data to be used for training (inputs).
    :param use_probabilities: Use probabilities from learners instead
        of raw values. (inputs).
    :param feature_column: Column to use for features (inputs).
    :param label_column: Column to use for labels (inputs).
    :param weight_column: Column to use for example weight (inputs).
    :param normalize_features: Normalize option for the feature
        column (inputs).
    :param caching: Whether learner should cache input training data
        (inputs).
    :param predictor_model: Predictor model (outputs).
    """

    entrypoint_name = 'Models.OvaModelCombiner'
    inputs = {}
    outputs = {}

    if model_array is not None:
        inputs['ModelArray'] = try_set(
            obj=model_array,
            none_acceptable=True,
            is_of_type=list)
    if training_data is not None:
        inputs['TrainingData'] = try_set(
            obj=training_data,
            none_acceptable=False,
            is_of_type=str)
    if use_probabilities is not None:
        inputs['UseProbabilities'] = try_set(
            obj=use_probabilities,
            none_acceptable=True,
            is_of_type=bool)
    if feature_column is not None:
        inputs['FeatureColumn'] = try_set(
            obj=feature_column,
            none_acceptable=True,
            is_of_type=str,
            is_column=True)
    if label_column is not None:
        inputs['LabelColumn'] = try_set(
            obj=label_column,
            none_acceptable=True,
            is_of_type=str,
            is_column=True)
    if weight_column is not None:
        inputs['WeightColumn'] = try_set(
            obj=weight_column,
            none_acceptable=True,
            is_of_type=str,
            is_column=True)
    if normalize_features is not None:
        inputs['NormalizeFeatures'] = try_set(
            obj=normalize_features,
            none_acceptable=True,
            is_of_type=str,
            values=[
                'No',
                'Warn',
                'Auto',
                'Yes'])
    if caching is not None:
        inputs['Caching'] = try_set(
            obj=caching,
            none_acceptable=True,
            is_of_type=str,
            values=[
                'Auto',
                'Memory',
                'Disk',
                'None'])
    if predictor_model is not None:
        outputs['PredictorModel'] = try_set(
            obj=predictor_model, none_acceptable=False, is_of_type=str)

    input_variables = {
        x for x in unlist(inputs.values())
        if isinstance(x, str) and x.startswith("$")}
    output_variables = {
        x for x in unlist(outputs.values())
        if isinstance(x, str) and x.startswith("$")}

    entrypoint = EntryPoint(
        name=entrypoint_name, inputs=inputs, outputs=outputs,
        input_variables=input_variables,
        output_variables=output_variables)
    return entrypoint

# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Models.OvaModelCombiner
"""


from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist


def models_ovamodelcombiner(
        training_data,
        predictor_model=None,
        model_array=None,
        use_probabilities=True,
        feature_column='Features',
        label_column='Label',
        weight_column=None,
        normalize_features='Auto',
        caching='Auto',
        **params):
    """
    **Description**
        Combines a sequence of PredictorModels into a single model

    :param model_array: Input models (inputs).
    :param training_data: The data to be used for training (inputs).
    :param use_probabilities: Use probabilities from learners instead
        of raw values. (inputs).
    :param feature_column: Column to use for features (inputs).
    :param label_column: Column to use for labels (inputs).
    :param weight_column: Column to use for example weight (inputs).
    :param normalize_features: Normalize option for the feature
        column (inputs).
    :param caching: Whether learner should cache input training data
        (inputs).
    :param predictor_model: Predictor model (outputs).
    """

    entrypoint_name = 'Models.OvaModelCombiner'
    inputs = {}
    outputs = {}

    if model_array is not None:
        inputs['ModelArray'] = try_set(
            obj=model_array,
            none_acceptable=True,
            is_of_type=list)
    if training_data is not None:
        inputs['TrainingData'] = try_set(
            obj=training_data,
            none_acceptable=False,
            is_of_type=str)
    if use_probabilities is not None:
        inputs['UseProbabilities'] = try_set(
            obj=use_probabilities,
            none_acceptable=True,
            is_of_type=bool)
    if feature_column is not None:
        inputs['FeatureColumn'] = try_set(
            obj=feature_column,
            none_acceptable=True,
            is_of_type=str,
            is_column=True)
    if label_column is not None:
        inputs['LabelColumn'] = try_set(
            obj=label_column,
            none_acceptable=True,
            is_of_type=str,
            is_column=True)
    if weight_column is not None:
        inputs['WeightColumn'] = try_set(
            obj=weight_column,
            none_acceptable=True,
            is_of_type=str,
            is_column=True)
    if normalize_features is not None:
        inputs['NormalizeFeatures'] = try_set(
            obj=normalize_features,
            none_acceptable=True,
            is_of_type=str,
            values=[
                'No',
                'Warn',
                'Auto',
                'Yes'])
    if caching is not None:
        inputs['Caching'] = try_set(
            obj=caching,
            none_acceptable=True,
            is_of_type=str,
            values=[
                'Auto',
                'Memory',
                'Disk',
                'None'])
    if predictor_model is not None:
        outputs['PredictorModel'] = try_set(
            obj=predictor_model, none_acceptable=False, is_of_type=str)

    input_variables = {
        x for x in unlist(inputs.values())
        if isinstance(x, str) and x.startswith("$")}
    output_variables = {
        x for x in unlist(outputs.values())
        if isinstance(x, str) and x.startswith("$")}

    entrypoint = EntryPoint(
        name=entrypoint_name, inputs=inputs, outputs=outputs,
        input_variables=input_variables,
        output_variables=output_variables)
    return entrypoint

# - Generated by tools/entrypoint_compiler.py: do not edit by hand Models.OvaModelCombiner **Description**         Combines a sequence of PredictorModels into a single model      :param model_array: Input models (inputs).     :param training_data: The data to be used for training (inputs).     :param use_probabilities: Use probabilities from learners instead         of raw values. (inputs).     :param feature_column: Column to use for features (inputs).     :param label_column: Column to use for labels (inputs).     :param weight_column: Column to use for example weight (inputs).     :param normalize_features: Normalize option for the feature         column (inputs).     :param caching: Whether learner should cache input training data         (inputs).     :param predictor_model: Predictor model (outputs).