svm理论与实验之21: 自定义核函数的使用
来源:互联网 发布:2014年网络作家排行榜 编辑:程序博客网 时间:2024/06/05 09:02
徐海蛟博士
真实场景下,数据的特征可能比较复杂,系统提供的4种核函数或许达不到最佳效果,那么就需要自定义核函数了。当然,有很多大牛干这个事情,我们可以拿来使用,通过自定义核方式。
如何用?这时候不再把训练与测试数据文件作为输入参数了,而是使用核矩阵作为输入参数。
Assume there are L training instances x1, ..., xL . ... L行训练样本
Let K(x, y) be the kernel value of two instances x 与 y. The input formats are:
New training instance for xi:
<label> 0:i 1:K(xi,x1) ... L:K(xi,xL)
New testing instance for any x:
<label> 0:? 1:K(x,x1) ... L:K(x,xL)
That is, in the training file the first column must be the "ID" of xi. In testing, ? can be any value.
All kernel values including ZEROs must be explicitly provided. Any permutation or random subsets of the training/testing files are also valid (see examples below).
Note: the format is slightly different from the precomputed kernel
package released in libsvmtools earlier.
例子:
Assume the original training data has 3个four-feature instances, testing data has one instance:
15 1:1 2:1 3:1 4:1
45 2:3 4:3
25 3:1
-----------------------------------
15 1:1 3:1
若使用线性核, we have the following new training/testing sets:
15 0:1 1:4 2:6 3:1
45 0:2 1:6 2:18 3:0
25 0:3 1:1 2:0 3:1
-------------------------------------
15 0:? 1:2 2:0 3:1
? can be any value.
Any subset of the above training file is also valid. 例如,
25 0:3 1:1 2:0 3:1
45 0:2 1:6 2:18 3:0
意味着核矩阵是:
[K(2,2) K(2,3)] = [18 0]
[K(3,2) K(3,3)] = [0 1]
- svm理论与实验之21: 自定义核函数的使用
- svm理论与实验之22: 自定义核函数在Matlab平台上的使用
- svm理论与实验之7: 核函数
- svm理论与实验之4 — 问题的描述
- 徐海蛟:svm理论与实验之1
- svm理论与实验之1
- svm理论与实验之10: SVM多类分类
- svm理论与实验之11:svm开发工具包LibSVM
- svm理论与实验之19: libsvm多类实验
- svm理论与实验之2: 线性分类器
- svm理论与实验之3: 线性分类器(续集)
- svm理论与实验之8:松弛变量
- svm理论与实验之9:惩罚因子C
- svm理论与实验之12: Hello World
- svm理论与实验之13: libsvm库函数说明
- svm理论与实验之18: libsvm自动参数选择
- svm理论与实验之2:线性分类器
- svm理论与实验之6: 线性分类器的求解(续集) — 问题的转化
- sdut2072 删数问题
- X策略笔试总结
- jsp学习笔记_编译指令
- 移动手机消息推送机制
- Download Composer
- svm理论与实验之21: 自定义核函数的使用
- Set与List之间转化
- No result defined for action and result input
- 利用python实现新浪微博爬虫 .
- Java中访问权限修饰符public protected private, 缺省默认权限的用法总结
- 3 分钟搞定 Android Push
- pl/sql 条件分支的使用实例
- Mac环境下svn的使用
- Lync 2010升级到2013 之卸载Lync 2010 边缘服务器