language: cn
model_unique_abbr: random_forest_sagagis
version: 1.0
identification:
  docker_image_name: sagagis:debian-8.5.0
  docker_run_prefix:
  - imagery_vigra
  - 11
  model_name: 随机森林算法（ViGrA）
  semantic: random forest
  description: 基于ViGrA（Vision with Generic Algorithms），收集所有分类投票结果后，将投票次数最多的类别指定为最终的输出
  category_application: 预测型
  category_data:
  - 遥感影像数据
  - 图像数据
  keywords:
  - 监督分类
  - 集成学习
parameter_info:
  parameters:
  - arg_name: TABLE
    param_type: input_data
    name: 输入表格
    description: 用于分类的表格数据，必须包含分类id
    data_type: csv
    data_semantic: Table

  - arg_name: FEATURES
    param_type: param
    name: 要素字段
    description: 表格中的要素字段名，用于进行数据的分类
    data_type: str
    data_semantic: Feature field

  - arg_name: TRAINING
    param_type: param
    name: 训练字段
    description: 该字段用于定义训练数据的所属分类
    is_required: false
    data_type: str
    data_semantic: The class to which the training data belongs

  - arg_name: LABEL_AS_ID
    param_type: param
    name: 使用标签作为标识
    description: 是否使用训练区的标签作为预测结果的分类标识
    is_required: false
    data_type: enum
    data_semantic: Use Label as Identifier
    specification:
      default: "False"
      enum:
      - "True"
      - "False"

  - arg_name: IMPORTANCES
    param_type: output_data
    name: 输出结果
    description: 输出分类结果，不设置将直接保存结果到原表格,文件类型为csv
    data_type: csv
    data_semantic: Output result

  - arg_name: RF_TREE_COUNT
    param_type: param
    name: 树的数量
    description: 创建树的数量，取值范围为(0,),默认取值为32
    is_required: false
    data_type: int
    data_semantic: n_estimators
    specification:
      default: 32
      range:
      - (0,)

  - arg_name: RF_TREE_SAMPLES
    param_type: param
    name: 树的样本
    description: 每棵树的样本分数，取值范围为[0.0,1.0],默认取值1.0
    is_required: false
    data_type: float
    data_semantic: Samples per Tree
    specification:
      default: 1.0
      range:
      - "[0.0,1.0]"

  - arg_name: RF_REPLACE
    param_type: param
    name: 样本替代
    description: 训练样本是否可替代
    is_required: false
    data_type: enum
    data_semantic: Sample with Replacement
    specification:
      default: "True"
      enum:
      - "True"
      - "False"

  - arg_name: RF_SPLIT_MIN_SIZE
    param_type: param
    name: 最小节点数
    description: 分割的最小节点数，取值范围为[1,)，默认取值为1
    is_required: false
    data_type: int
    data_semantic: Minimum Node Split Size
    specification:
      default: 1
      range:
      - "[1,)"

  - arg_name: RF_NODE_FEATURES
    param_type: param
    name: 节点要素
    description: 每个节点的要素，”0“代表”logarithmic“，”1“代表”square root“，”2“代表”all“
    is_required: false
    data_type: enum
    data_semantic: Features per Node
    specification:
      default: 1
      enum:
      - 0
      - 1
      - 2

  - arg_name: RF_STRATIFICATION
    param_type: param
    name: 分层策略
    description: 分层策略，”0“代表”none“，”1“代表”equal“，”2“代表”proportional“
    is_required: false
    data_type: enum
    data_semantic: Stratification
    specification:
      default: 1
      enum:
      - 0
      - 1
      - 2

application:
  domain: 格网数据分类
  objective: 根据先验信息对待预测数据进行分类型预测
  mechanism: 收集所有局决策树分类投票结果后，将投票次数最多的类别指定为最终的输出
operation:
  usage: 该算法须指定输入图像文件、训练区、训练标签字段、预测结果存放字段及输出路径，其他参数均可默认
  exec_example:
  - docker run -v $(pwd):/data sagagis:debian-8.5.0 imagery_vigra 11 [-TABLE <str>] [-FEATURES <str>] [-PREDICTION <str>] [-TRAINING <str>] [-LABEL_AS_ID <str>] [-IMPORTANCES <str>] [-RF_TREE_COUNT <num>] [-RF_TREE_SAMPLES <double>] [-RF_REPLACE <str>] [-RF_SPLIT_MIN_SIZE <num>] [-RF_NODE_FEATURES <str>] [-RF_STRATIFICATION <str>]
  - docker run -v $(pwd):/data sagagis:debian-8.5.0 imagery_vigra 11 -TABLE /data/rf_iris_saga.csv  -FEATURES x1,x2,x3,x4 -PREDICTION RF_class -TRAINING Class -IMPORTANCES /data/rf_result.csv
  license:
  - SAGA-GIS-GNU General Public
technique:
  language:
  - C++
  os:
  - Linux
  - Windows
  dependencies:
  - name: SAGA-GIS
    version: 8.5.0
source:
  maintainer: Shan Huang
  organization: Beijing University of Civil Engineering and Architecture
  contact: huangshan3mt@foxmail.com
  integrated_softwares:
  - name: SAGA-GIS
    version: 8.5.0
    license: GNU General Public
  references:
  - Breiman, L. 2001. Random forests. Machine Learning, 45(1):5–32.
  - https://saga-gis.sourceforge.io/saga_tool_doc/8.1.0/imagery_vigra_11.html
