language: cn
model_unique_abbr: svm_sagagis
version: 1.0
identification:
  docker_image_name: sagagis-base:alpine-8.1.0
  docker_run_prefix:
  - imagery_svm
  - 0
  model_name: 支持向量机（栅格-SAGAGRID）
  semantic: support vector machine
  description: 一类对数据进行二元分类的含核函数的广义线性分类器，其决策边界是对学习样本求解的最大分类超平面，通过多类泛化推广为多类分类器。
  category_application: 预测型
  category_data:
  - 遥感影像数据
  - 图像数据
  keywords:
  - 监督学习
  - 广义线性分类器
parameter_info:
  parameters:
  - arg_name: GRIDS
    param_type: input_data
    name: 空间网格数据
    description: 待分类的空间网格数据
    data_type: tif
    data_semantic: Spatial grid data

  - arg_name: CLASSES
    param_type: output_data
    name: 分类结果
    description: 分类结果文件，文件类型为tif
    data_type: tif
    data_semantic: Classification

  - arg_name: SCALING
    param_type: param
    name: 特征缩放
    description: ‘0’代表不缩进行特征缩放，‘1’代表进行归一化处理，‘2’代表进行标准化处理
    is_required: false
    data_type: enum
    data_semantic: Feature scaling
    specification:
      default: 2
      enum:
      - 0
      - 1
      - 2

  - arg_name: MESSAGE
    param_type: param
    name: 是否启用详细输出
    description: 是否启用信息的详细输出
    is_required: false
    data_type: enum
    data_semantic: Verbose Messages
    specification:
      default: "False"
      enum:
      - "True"
      - "False"

  - arg_name: MODEL_SRC
    param_type: param
    name: 模型来源
    description: ’0‘代表从训练区创建模型，’1‘代表从文件读取模型
    is_required: false
    data_type: enum
    data_semantic: Model Source
    specification:
      default: 0
      enum:
      - 0
      - 1

  - arg_name: MODEL_LOAD
    param_type: param
    name: 模型路径
    description: 读取模型路径；当模型来源选择从文件读取模型时启用该选项
    is_required: false
    data_type: str
    data_semantic: Restore Model from File
    param_switches:
    - switch_arg_name: MODEL_SRC
      switch_arg_value_regex: 1
      switch_arg_value_examples: [1]

  - arg_name: ROI
    param_type: input_data
    name: 训练区
    description: 用于训练模型的训练数据
    data_type: shp
    data_semantic: Training Areas

  - arg_name: ROI_ID
    param_type: param
    name: 训练区分类标签
    description: 用于训练模型的训练数据的分类标签
    is_required: false
    data_type: str
    data_semantic: Class Identifier

  - arg_name: MODEL_SAVE
    param_type: output_data
    name: 模型存储路径
    description: 训练完成后输出模型的路径
    is_required: false
    data_type: csv
    data_semantic: Store Model to File
    param_switches:
    - switch_arg_name: MODEL_SRC
      switch_arg_value_regex: 1
      switch_arg_value_examples: [1]

  - arg_name: SVM_TYPE
    param_type: param
    name: 支持向量机类型
    description: 支持向量机的类型，’0‘代表C-SVC，’1‘代表nu-SVC，’2‘代表one-ClassSVM，’3‘代表epsilon-SVR，’4‘代表nu-SVR
    is_required: false
    data_type: enum
    data_semantic: Support Vector Machine Type
    specification:
      default: 0
      enum:
      - 0
      - 1
      - 2
      - 3
      - 4

  - arg_name: KERNEL_TYPE
    param_type: param
    name: 内核类型
    description: 指定算法中使用的内核类型，’0‘代表linear类型内核，’1‘代表polynomial类型内核，’2‘代表radial basis类型内核，’3‘代表sigmoid类型内核
    is_required: false
    data_type: enum
    data_semantic: Kernel Type
    specification:
      default: 2
      enum:
      - 0
      - 1
      - 2
      - 3

  - arg_name: DEGREE
    param_type: param
    name: 核函数的次数
    description: 多项式核函数的次数，当内核类型选择“polynomial”类型时生效，建议值范围[1,4]，默认为3
    is_required: false
    data_type: int
    data_semantic: Kegree In Kernel Function
    specification:
      default: 3

  - arg_name: GAMMA
    param_type: param
    name: 核函数系数
    description: 核函数中的系数，当内核类型不为“linear”时生效，默认值为0.0
    is_required: false
    data_type: float
    data_semantic: Gamma In Kernel Function
    specification:
      default: 0.0

  - arg_name: COEF0
    param_type: param
    name: 核函数独立项
    description: 核函数中的独立项，当内核类型为“polynomial”、“sigmoid”时生效，默认值为0.0
    is_required: false
    data_type: float
    data_semantic: Coef0 In Kernel Function
    specification:
      default: 0.0

  - arg_name: COST
    param_type: param
    name: 代价参数
    description: C-SVC，epsilon-SVR，和 nu-SVR类型支持向量机的代价参数，默认值为1.0
    is_required: false
    data_type: float
    data_semantic: Cost parameter
    specification:
      default: 1.0

  - arg_name: NU
    param_type: param
    name: NU参数
    description: nu-SVC，one-class SVM，和 nu-SVR类型支持向量机的nu参数，默认值为0.5
    is_required: false
    data_type: float
    data_semantic: Parameter NU
    specification:
      default: 0.5

  - arg_name: EPS_SVR
    param_type: param
    name: Epsilon参数
    description: epsilon in loss function of epsilon-SVR类型支持向量机的损失函数Epsilon参数，默认值为0.1
    is_required: false
    data_type: float
    data_semantic: SVR Epsilon
    specification:
      default: 0.1

  - arg_name: CACHE_SIZE
    param_type: param
    name: 缓存大小
    description: 指定内核缓存的大小（以MB为单位），建议值范围[1.0,200.0]，默认值为100.0
    is_required: false
    data_type: float
    data_semantic: Cache Size
    specification:
      default: 100.0

  - arg_name: EPS
    param_type: param
    name: 残差收敛容差
    description: 残差收敛容差，默认值为0.001
    data_type: float
    data_semantic: tolerance of termination criterion
    specification:
      default: 0.001

  - arg_name: SHRINKING
    param_type: param
    name: 启发式
    description: 是否使用缩小启发式
    is_required: false
    data_type: enum
    data_semantic: Shrinking Heuristics
    specification:
      default: "False"
      enum:
      - "True"
      - "False"

  - arg_name: PROBABILITY
    param_type: param
    name: 概率估计
    description: 是否启用概率估计
    is_required: false
    data_type: enum
    data_semantic: Probability Estimates
    specification:
      default: "False"
      enum:
      - "True"
      - "False"

  - arg_name: CROSSVAL
    param_type: param
    name: 交叉验证
    description: 交叉验证，取值范围为[1,]，默认值为1
    is_required: false
    data_type: int
    data_semantic: Cross Validation
    specification:
      default: 1
      range:
      - "[1,]"
  groups:
  - group_id: modelfrom
    group_name: 模型来源
    group_param_arg_names:
    - MODEL_SRC
    - MODEL_LOAD
    - MODEL_SAVE
application:
  domain: 格网数据分类
  objective: 根据先验信息对待预测数据进行分类型预测
  mechanism: 求解能够正确划分训练数据集并且在特征空间中几何间隔最大的分离超平面
operation:
  usage: 该算法需要需要输入网格数据与训练区图形文件以完成图像网格的要素分类
  exec_example:
  - docker run -v $(pwd):/data:/data sagagis-base:alpine-8.1.0 imagery_svm 0 [-GRIDS <str>] [-CLASSES <str>] [-CLASSES_LUT <str>] [-SCALING <str>] [-MESSAGE <str>] [-MODEL_SRC <str>] [-MODEL_LOAD <str>] [-ROI <str>] [-ROI_ID <str>] [-MODEL_SAVE <str>] [-SVM_TYPE <str>] [-KERNEL_TYPE <str>] [-DEGREE <num>] [-GAMMA <double>] [-COEF0 <double>] [-COST <double>] [-NU <double>] [-EPS_SVR <double>] [-CACHE_SIZE <double>] [-EPS <double>] [-SHRINKING <str>] [-PROBABILITY <str>] [-CROSSVAL <num>]
  license:
  - SAGA-GIS-GNU General Public
technique:
  language:
  - Python
  os:
  - Linux
  - Windows
  dependencies:
  - name: SAGA-GIS
    version: 8.1.0
source:
  maintainer: Shan Huang
  organization: Beijing University of Civil Engineering and Architecture
  contact: huangshan3mt@foxmail.com
  integrated_softwares:
  - name: SAGA-GIS
    version: 8.1.0
    license: GNU General Public
  references:
  - Cortes, C., Vapnik, V. 1995. Support-vector networks. Machine learning, 20(3):273–297
  - https://saga-gis.sourceforge.io/saga_tool_doc/8.1.0/imagery_opencv_7.html
