{
  "current_parameters": {
    "targetField": [],
    "inputFieldList": [
      "Age",
      "BP"
    ],
    "checkpointInterval": -1,
    "impurity": "entropy",
    "lossType": "logistic",
    "maxBins": 24,
    "maxDepth": 7,
    "maxIter": 101,
    "minInfoGain": 0,
    "minInstancesPerNode": 2,
    "seed": 12345,
    "stepSize": 0,
    "subsamplingRate": 1
  },
  "current_ui_parameters": {
    "uiOnlyField1": "test",
    "uiOnlyField2": [
      "alpha",
      "beta",
      "gamma",
      "delta"
    ],
    "uiOnlyField3": 23
  },
  "parameters": [
    {
      "id": "targetField",
      "type": "string",
      "default": "",
      "role": "column",
      "required": true
    },
    {
      "id": "inputFieldList",
      "type": "array[string]",
      "default": [],
      "role": "column",
      "required": true
    },
    {
      "id": "checkpointInterval",
      "type": "integer",
      "default": -1
    },
    {
      "id": "impurity",
      "enum": [
        "gini",
        "entropy"
      ],
      "default": "gini"
    },
    {
      "id": "lossType",
      "type": "string",
      "default": "logistic"
    },
    {
      "id": "maxBins",
      "type": "integer",
      "default": 32
    },
    {
      "id": "maxDepth",
      "type": "integer",
      "default": 5
    },
    {
      "id": "maxIter",
      "type": "integer",
      "default": 100
    },
    {
      "id": "minInfoGain",
      "type": "double",
      "default": 0
    },
    {
      "id": "minInstancesPerNode",
      "type": "integer",
      "default": 1
    },
    {
      "id": "seed",
      "type": "integer",
      "default": 12345
    },
    {
      "id": "stepSize",
      "type": "double",
      "default": 0
    },
    {
      "id": "subsamplingRate",
      "type": "double",
      "default": 1
    }
  ],
  "uihints": {
    "id": "org.apache.spark.ml.classification.GBTClassifier",
    "icon": "images/modelbuildspark.svg",
    "label": {
      "default": "Gradient Boosted Tree Classifier"
    },
    "description": {
      "default": "Fit a Gradient Boosted Tree Classifier Model"
    },
    "ui_parameters": [
      {
        "id": "uiOnlyField1",
        "type": "string",
        "default": "",
        "required": true
      },
      {
        "id": "uiOnlyField2",
        "type": "array[string]",
        "default": [],
        "required": true
      },
      {
        "id": "uiOnlyField3",
        "type": "integer",
        "default": -1
      }
    ],
    "parameter_info": [
      {
        "parameter_ref": "uiOnlyField1",
        "label": {
          "default": "The first Ui field"
        },
        "description": {
          "default": "Select a Ui field value."
        }
      },
      {
        "parameter_ref": "uiOnlyField2",
        "label": {
          "default": "The second Ui field"
        },
        "description": {
          "default": "Select another Ui field value."
        }
      },
      {
        "parameter_ref": "uiOnlyField3",
        "label": {
          "default": "The third Ui field"
        },
        "description": {
          "default": "Select the last Ui field value."
        }
      },
      {
        "parameter_ref": "targetField",
        "label": {
          "default": "Target column"
        },
        "description": {
          "default": "Select a target column"
        }
      },
      {
        "parameter_ref": "inputFieldList",
        "label": {
          "default": "Input columns"
        },
        "description": {
          "default": "Select one or more input columns"
        }
      },
      {
        "parameter_ref": "checkpointInterval",
        "label": {
          "default": "Checkpoint Interval"
        },
        "description": {
          "default": "Set checkpoint interval (>= 1) or disable checkpoint (-1). Ex) 10 means that the cache will get checkpointed every 10 iterations"
        }
      },
      {
        "parameter_ref": "impurity",
        "label": {
          "default": "Impurity"
        },
        "description": {
          "default": "Criterion used for information gain calculation (case-insensitive). Supported: \"entropy\" and \"gini\""
        }
      },
      {
        "parameter_ref": "lossType",
        "label": {
          "default": "Loss Type"
        },
        "description": {
          "default": "Loss function which GBT tries to minimize"
        }
      },
      {
        "parameter_ref": "maxBins",
        "label": {
          "default": "Maximum number of bins"
        },
        "description": {
          "default": "Maximum number of bins used for discretizing continuous features and for choosing how to split on features at each node. More bins give higher granularity. Must be >= 2 and >= number of categories in any categorical feature"
        }
      },
      {
        "parameter_ref": "maxDepth",
        "label": {
          "default": "Maximum depth of the tree"
        },
        "description": {
          "default": "Maximum depth of the tree (>= 0). Ex) depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes"
        }
      },
      {
        "parameter_ref": "maxIter",
        "label": {
          "default": "Maximum iterations for convergence"
        },
        "description": {
          "default": "Maximum iterations for convergence (>= 0)"
        }
      },
      {
        "parameter_ref": "minInfoGain",
        "label": {
          "default": "Minimum information gain"
        },
        "description": {
          "default": "Minimum information gain for a split to be considered at a tree node"
        }
      },
      {
        "parameter_ref": "minInstancesPerNode",
        "label": {
          "default": "Minimum instances per node"
        },
        "description": {
          "default": "Minimum number of instances each child must have after split. If a split causes the left or right child to have fewer than minInstancesPerNode, the split will be discarded as invalid (>= 1)"
        }
      },
      {
        "parameter_ref": "seed",
        "label": {
          "default": "Seed"
        },
        "description": {
          "default": "Random seed"
        },
        "number_generator": {
          "label": {
            "default": "Generate",
            "resource_key": "numberGenerator"
          },
          "range": {
            "min": 1000000,
            "max": 9999999
          }
        }
      },
      {
        "parameter_ref": "stepSize",
        "label": {
          "default": "Step size"
        },
        "description": {
          "default": "Step size to be used for each iteration of optimization"
        }
      },
      {
        "parameter_ref": "subsamplingRate",
        "label": {
          "default": "Subsampling Rate"
        },
        "description": {
          "default": "Fraction of the training data used for learning each decision tree (> 0 and <= 1)"
        }
      }
    ],
    "group_info": [
      {
        "id": "fields_settings",
        "type": "panels",
        "group_info": [
          {
            "id": "fields",
            "type": "columnSelection",
            "label": {
              "default": "Fields"
            },
            "parameter_refs": [
              "targetField",
              "inputFieldList"
            ]
          }
        ]
      },
      {
        "id": "advancedParams",
        "label": {
          "default": "Advanced Parameters"
        },
        "parameter_refs": [
          "checkpointInterval",
          "impurity",
          "lossType",
          "maxBins",
          "maxDepth",
          "maxIter",
          "minInfoGain",
          "minInstancesPerNode",
          "seed",
          "stepSize",
          "subsamplingRate"
        ]
      },
      {
        "id": "UIonlyParameters",
        "label": {
          "default": "Special Parameters"
        },
        "parameter_refs": [
          "uiOnlyField1",
          "uiOnlyField2",
          "uiOnlyField3"
        ]
      }
    ]
  },
  "conditions": [
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "uiOnlyField1",
          "message": {
            "resource_key": "uiOnlyField1_list_not_empty"
          }
        },
        "evaluate": {
          "condition": {
            "parameter_ref": "uiOnlyField1",
            "op": "isNotEmpty"
          }
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "inputFieldList",
          "message": {
            "resource_key": "input_field_list_not_empty"
          }
        },
        "evaluate": {
          "condition": {
            "parameter_ref": "inputFieldList",
            "op": "isNotEmpty"
          }
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "targetField",
          "message": {
            "resource_key": "target_field_not_empty"
          }
        },
        "evaluate": {
          "condition": {
            "parameter_ref": "targetField",
            "op": "isNotEmpty"
          }
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "checkpointInterval",
          "message": {
            "resource_key": "checkpoint_interval_not_valid"
          }
        },
        "evaluate": {
          "or": [
            {
              "condition": {
                "parameter_ref": "checkpointInterval",
                "op": "greaterThan",
                "value": 1
              }
            },
            {
              "condition": {
                "parameter_ref": "checkpointInterval",
                "op": "equals",
                "value": 1
              }
            },
            {
              "condition": {
                "parameter_ref": "checkpointInterval",
                "op": "equals",
                "value": -1
              }
            }
          ]
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "maxBins",
          "message": {
            "resource_key": "max_bins_not_valid"
          }
        },
        "evaluate": {
          "or": [
            {
              "condition": {
                "parameter_ref": "maxBins",
                "op": "greaterThan",
                "value": 2
              }
            },
            {
              "condition": {
                "parameter_ref": "maxBins",
                "op": "equals",
                "value": 2
              }
            }
          ]
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "maxDepth",
          "message": {
            "resource_key": "max_depth_not_valid"
          }
        },
        "evaluate": {
          "or": [
            {
              "condition": {
                "parameter_ref": "maxDepth",
                "op": "greaterThan",
                "value": 0
              }
            },
            {
              "condition": {
                "parameter_ref": "maxDepth",
                "op": "equals",
                "value": 0
              }
            }
          ]
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "maxIter",
          "message": {
            "resource_key": "max_iter_not_valid"
          }
        },
        "evaluate": {
          "or": [
            {
              "condition": {
                "parameter_ref": "maxIter",
                "op": "greaterThan",
                "value": 0
              }
            },
            {
              "condition": {
                "parameter_ref": "maxIter",
                "op": "equals",
                "value": 0
              }
            }
          ]
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "minInstancesPerNode",
          "message": {
            "resource_key": "min_instances_per_node_not_valid"
          }
        },
        "evaluate": {
          "or": [
            {
              "condition": {
                "parameter_ref": "minInstancesPerNode",
                "op": "greaterThan",
                "value": 1
              }
            },
            {
              "condition": {
                "parameter_ref": "minInstancesPerNode",
                "op": "equals",
                "value": 1
              }
            }
          ]
        }
      }
    },
    {
      "validation": {
        "fail_message": {
          "type": "error",
          "focus_parameter_ref": "subsamplingRate",
          "message": {
            "resource_key": "subsampling_rate_not_valid"
          }
        },
        "evaluate": {
          "and": [
            {
              "condition": {
                "parameter_ref": "subsamplingRate",
                "op": "greaterThan",
                "value": 0
              }
            },
            {
              "or": [
                {
                  "condition": {
                    "parameter_ref": "subsamplingRate",
                    "op": "lessThan",
                    "value": 1
                  }
                },
                {
                  "condition": {
                    "parameter_ref": "subsamplingRate",
                    "op": "equals",
                    "value": 1
                  }
                }
              ]
            }
          ]
        }
      }
    }
  ],
  "dataset_metadata": [
    {
      "id": "schema1",
      "fields": [
        {
          "name": "Age",
          "type": "integer",
          "metadata": {
            "description": "",
            "measure": "range",
            "modeling_role": "input"
          }
        },
        {
          "name": "Sex",
          "type": "string",
          "metadata": {
            "description": "",
            "measure": "discrete",
            "modeling_role": "input"
          }
        },
        {
          "name": "BP",
          "type": "string",
          "metadata": {
            "description": "",
            "measure": "discrete",
            "modeling_role": "input"
          }
        },
        {
          "name": "Cholesterol",
          "type": "string",
          "metadata": {
            "description": "",
            "measure": "discrete",
            "modeling_role": "input"
          }
        },
        {
          "name": "Na",
          "type": "double",
          "metadata": {
            "description": "",
            "measure": "range",
            "modeling_role": "input"
          }
        },
        {
          "name": "K",
          "type": "double",
          "metadata": {
            "description": "",
            "measure": "range",
            "modeling_role": "input"
          }
        },
        {
          "name": "Drug",
          "type": "string",
          "metadata": {
            "description": "",
            "measure": "discrete",
            "modeling_role": "input"
          }
        }
      ]
    }
  ],
  "resources": {
    "org.apache.spark.ml.classification.DecisionTreeClassifier.label": "Random Forest Classifier",
    "org.apache.spark.ml.classification.DecisionTreeClassifier.desc": "Fitted Random Forest Classification Model",
    "inputFieldList.label": "Input columns",
    "inputFieldList.desc": "Select one or more input columns",
    "targetField.label": "Target column",
    "targetField.desc": "Select a target column",
    "checkpointInterval.label": "Checkpoint Interval",
    "checkpointInterval.desc": "Set checkpoint interval (>= 1) or disable checkpoint (-1). Ex) 10 means that the cache will get checkpointed every 10 iterations",
    "impurity.label": "Impurity",
    "impurity.desc": "Criterion used for information gain calculation (case-insensitive). Supported: \"entropy\" and \"gini\"",
    "lossType.label": "Loss Type",
    "lossType.desc": "Loss function which GBT tries to minimize",
    "maxBins.label": "Maximum number of bins",
    "maxBins.desc": "Maximum number of bins used for discretizing continuous features and for choosing how to split on features at each node. More bins give higher granularity. Must be >= 2 and >= number of categories in any categorical feature",
    "maxDepth.label": "Maximum depth of the tree",
    "maxDepth.desc": "Maximum depth of the tree (>= 0). Ex) depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes",
    "maxIter.label": "Maximum iterations for convergence",
    "maxIter.desc": "Maximum iterations for convergence (>= 0)",
    "minInfoGain.label": "Minimum information gain",
    "minInfoGain.desc": "Minimum information gain for a split to be considered at a tree node",
    "minInstancesPerNode.label": "Minimum instances per node",
    "minInstancesPerNode.desc": "Minimum number of instances each child must have after split. If a split causes the left or right child to have fewer than minInstancesPerNode, the split will be discarded as invalid (>= 1)",
    "seed.label": "Seed",
    "seed.desc": "Random seed",
    "stepSize.label": "Step size",
    "stepSize.desc": "Step size to be used for each iteration of optimization",
    "subsamplingRate.label": "Subsampling Rate",
    "subsamplingRate.desc": "Fraction of the training data used for learning each decision tree (> 0 and <= 1)",
    "fields_settings.label": "Fields",
    "uiOnlyField1_list_not_empty": "This field cannot be empty.",
    "input_field_list_not_empty": "Select one or more input columns",
    "target_field_not_empty": "Select a target field",
    "checkpoint_interval_not_valid": "The checkpoint interval value must either be >= 1 or -1 to disable",
    "max_bins_not_valid": "Max bins must be >= 2 and >= number of categories in any categorical feature",
    "max_depth_not_valid": "The max depth parameter must be greater than or equal to zero",
    "max_iter_not_valid": "The max iterations parameter must be greater than or equal to zero",
    "min_instances_per_node_not_valid": "The minimum instances per node value must be >= 1",
    "subsampling_rate_not_valid": "The subsampling rate value must be > 0 and <= 1"
  }
}
