language: cn
model_unique_abbr: random_forest_probability
version: 1.0

identification:
  docker_image_name: random_forest_probability:1.0.2-sklearn1.0.2
  model_name: 面向土地利用类型扩张的随机森林
  semantic: random forest probability
  category_application: 预测型
  category_data:
    - 点数据分析
  description: 该算法收集所有分类投票结果后，将投票次数最多的类别计算概率进行输出
  keywords:
    - 空间分类
    - 随机森林分类

parameter_info:
  parameters:
    - arg_name: tl
      param_type: input_data
      name: 土地扩张标签
      description: 模型训练所需的标签数据.
      is_required: True
      data_type: tif
      data_semantic: land development label

    - arg_name: asfm
      param_type: input_data
      name: 坡向栅格
      description: 模型训练所需的坡向样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: aspect

    - arg_name: demfm
      param_type: input_data
      name: DEM栅格
      description: 模型训练所需的DEM样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: dem

    - arg_name: popufm
      param_type: input_data
      name: 人口栅格
      description: 模型训练所需的人口样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: population

    - arg_name: railwayfm
      param_type: input_data
      name: 至铁路距离栅格
      description: 模型训练所需的铁路样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: railway

    - arg_name: sfm
      param_type: input_data
      name: 坡度栅格
      description: 模型训练所需的坡度样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: slope

    - arg_name: rfm
      param_type: input_data
      name: 至道路距离栅格
      description: 模型训练所需的道路样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: road

    - arg_name: tfm
      param_type: input_data
      name: 气温栅格
      description: 模型训练所需的气温样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: temperature

    - arg_name: wfm
      param_type: input_data
      name: 至河网距离栅格
      description: 模型训练所需的河网样本，请至少选择一个栅格样本
      is_required: False
      data_type: tif
      data_semantic: d8_distance_to_strm

    - arg_name: op
      param_type: output_data
      name: 输出路径
      description: 预测结果的输出路径
      is_required: True
      data_type: csv
      data_semantic: land development potential

    - arg_name: sr
      param_type: param
      name: 采样率
      description: 驱动因素样本采样率,范围(0,1),建议默认值为0.5
      is_required: True
      data_type: float
      data_semantic: n_estimators
      specification:
        default: 0.5
        range:
        - "(0,1)"

    - arg_name: ne
      param_type: param
      name: 树木数量
      description: 森林中树木的数量,范围是[1,],默认值为100
      is_required: True
      data_type: int
      data_semantic: n_estimators
      specification:
        default: 100
        range:
        - "[1,)"

    - arg_name: c
      param_type: param
      name: 不纯度方法
      description: 不纯度的计算方法
      is_required: True
      data_type: enum
      data_semantic: criterion
      specification:
        default: "gini"
        enum:
        - "entropy"
        - "gini"
        - "poisson"

    - arg_name: md
      param_type: param
      name: 最大深度
      description: 随机森林树的最大深度,范围为[1,],默认值为3
      is_required: True
      data_type: int
      data_semantic: max depth
      specification:
        default: 3
        range:
        - "[1,)"


    - arg_name: nj
      param_type: param
      visible: false
      name: 并行工作数
      description: 为近邻点搜索运行的并行作业数,范围是[-2,],默认值为1
      is_required: True
      data_type: int
      data_semantic: n_jobs
      specification:
        default: -1
        range:
        - "[-2,)"

    - arg_name: mss
      param_type: param
      name: 拆分内节点最少样本数
      description: 拆分内部节点所需的最少样本数,范围是[1,],默认是2
      is_required: True
      data_type: int
      data_semantic: min samples split
      specification:
        default: 2
        range:
        - "[1,)"

    - arg_name: msl
      param_type: param
      name: 叶节点最小样本数
      description: 在叶节点处需要的最小样本数，范围是[1,]，默认值为2
      is_required: True
      data_type: int
      data_semantic: min samples leaf
      specification:
        default: 1
        range:
        - "[1,)"

    - arg_name: mwfl
      param_type: param
      name: 最小加权分数
      description: 一个叶节点上所需的(所有输入样本的)总权重的最小加权分数，范围是[0.0,0.5]，默认为0.0
      is_required: True
      data_type: float
      data_semantic: min weight fraction leaf
      specification:
        default: 0.0
        range:
        - "[0.0,0.5]"


    - arg_name: v
      param_type: param
      name: 详细程度
      description: 在拟合和预测时控制输出日志的详细程度,范围[0,],默认值为0
      is_required: True
      data_type: int
      data_semantic: verbose
      specification:
        default: 0
        range:
        - "[0,)"

    - arg_name: ca
      param_type: param
      name: 复杂度参数
      description: 复杂度参数用于最小代价复杂度剪枝,范围[0.0,],默认值为0.0
      is_required: True
      data_type: float
      data_semantic: ccp_alpha
      specification:
        default: 0.0
        range:
        - "[0.0,)"

application:
  domain: 空间数据分类
  objective: 根据先验信息对带预测数据进行分类型预测
  mechanism: 该算法收集所有决策树分类投票结果后，将投票次数最多的类别计算概率进行输出
operation:
  usage: 须指定至少三个训练样本数据、一个训练标签和一个输出路径，其他参数均可默认
  exec_example:
    - docker run -v $(pwd):/data random_forest_probability:1.0.2-sklearn1.0.2  -asfm  /data/aspect_Priolo.tif  -demfm  /data/dem_priolo.tif  -popufm  /data/popu-Priolo.tif -railwayfm /data/railways_Priolo_distance.tif -sfm /data/slope_priolo.tif -rfm /data/road_Priolo_distance.tif  -tfm  /data/temp_priolo.tif  -wfm  /data/waterways_Priolo_distance.tif  -tl /data/priolo_00-15_landuse_1to2.tif -op /data/out/
  license:
    - BSD-3-Clause
    - PSF-2.0
    - GPL-2.0
technique:
  language:
    - python
  os:
    - Windows
    - Linux
  parallel:
    - multithreading
  hardware:
    - CPU
  dependencies:
    - name: scikit-learn
      version: 1.0.2
    - name: pandas
      version: 1.1.3
    - name: numpy
      version: 1.19.2
source:
  maintainer: Xian Cao
  organization: Beijing University of Civil Engineering and Architecture
  contact: southerndog@foxmail.com
  integrated_softwares:
    - name: scikit-learn
      version: 1.0.2
      license: BSD-3-Clause
  references:
    - Breiman, L. 2001. Random forests. Machine Learning, 45(1):5–32.
    - https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html
