Libsvm的说明——方法

本文详细介绍了Libsvm中的一系列工具函数,包括svm_train()、svm_predict()、svm_read_problem()、svm_load_model()和svm_save_model()等。svm_train()提供了多种调用方式以适应不同参数的训练需求;svm_predict()用于预测测试数据;svm_read_problem()和svm_load_model()分别用于读取和保存模型;evaluations()评估预测结果;csr_find_scale_param()和csr_scale()则针对csr格式数据进行缩放处理。文章还提及了该接口的作者以及引用Libsvm的相关信息。
摘要由CSDN通过智能技术生成

Utility Functions

To use utility functions, type:

>>> from svmutil import *

The above command loads:
svm_train() : train an SVM model
svm_predict() : predict testing data
svm_read_problem() : read the data from a LIBSVM-format file.
svm_load_model() : load a LIBSVM model.
svm_save_model() : save model to a file.
evaluations() : evaluate prediction results.
csr_find_scale_param() : find scaling parameter for data in csr format(查找csr格式数据的缩放参数).
csr_scale() : apply data scaling to data in csr format(对csr格式的数据应用数据缩放).

第一个function

  • Function: svm_train

There are three ways to call svm_train()

>>> model = svm_train(y, x [, 'training_options'])
>>> model = svm_train(prob [, 'training_options'])
>>> model = svm_train(prob, param)
y: a list/tuple/ndarray of l training labels (type must be int/double).
x: 1. a list/tuple of l training instances. Feature vector of each training instance is a list/tuple or dictionary.
   2. an l * n numpy ndarray or scipy spmatrix (n: number of features).
training_options: a string in the same form as that
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值