# 支持向量机

# 简介

警告

此扩展是实验性的。 此扩展的行为，包括其函数的名称和围绕此扩展的相关文档都可能会在未来的 PHP 版本中发生变化而不另行通知。使用本扩展应自行承担风险。

LibSVM 是 SVM 分类和回归问题的有效解决方案。svm 扩展将其包装在 PHP 接口中，以便在 PHP 脚本中轻松使用。

- 安装/配置
  - 需求
  - 安装
- 示例
- SVM — The SVM class
  - SVM::__construct — Construct a new SVM object
  - SVM::crossvalidate — Test training params on subsets of the training data
  - SVM::getOptions — Return the current training parameters
  - SVM::setOptions — Set training parameters
  - SVM::train — Create a SVMModel based on training data
- SVMModel — The SVMModel class
  - SVMModel::checkProbabilityModel — Returns true if the model has probability information
  - SVMModel::__construct — Construct a new SVMModel
  - SVMModel::getLabels — Get the labels the model was trained on
  - SVMModel::getNrClass — Returns the number of classes the model was trained with
  - SVMModel::getSvmType — Get the SVM type the model was trained with
  - SVMModel::getSvrProbability — Get the sigma value for regression types
  - SVMModel::load — Load a saved SVM Model
  - SVMModel::predict — Predict a value for previously unseen data
  - SVMModel::predict_probability — Return class probabilities for previous unseen data
  - SVMModel::save — Save a model to a file

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open