gpt4 book ai didi

matlab - 如何在 Matlab 中将 svmtrain() 与自定义内核一起使用?

转载 作者:行者123 更新时间:2023-11-30 09:57:41 27 4
gpt4 key购买 nike

svmtain() 是 MATLAB 中用于 SVM 学习的函数。帮助文档在这里:

http://www.mathworks.com/help/bioinfo/ref/svmtrain.html

如何将它与自定义内核一起使用?在帮助文档中,它说:

<小时/>

@kfun — Function handle to a kernel function. A kernel function must be of the form

 function K = kfun(U, V)

The returned value, K, is a matrix of size M-by-N, where U and V have M and N rows respectively.

<小时/>

它没有提及 U 和 V 是什么以及 M 和 N 的含义。我只是不知道如何以正确的格式使用它。谁能告诉我U和V是什么,M和N是什么意思?例如,训练数据是5维向量,核函数是向量的长度之和。如何编写核函数?

谢谢!

最佳答案

只是猜测:

根据:http://www.tech.dmu.ac.uk/~hseker/Statistics%20in%20Genetics/Statistical%20Learning%20and%20Visualization%20in%20MATLAB.doc 、U、V 应该只是功能处方 K 中的参数,例如如果您的内核是 tanh,那么:

function K = kfun(U,V,P1,P2)
K = tanh(U*V');

P1、P2 用于各自内核的一些附加功能。但正如我在评论中所写,您需要成为优秀的数学家才能获得比已定义的内核获得的更好的结果。

关于matlab - 如何在 Matlab 中将 svmtrain() 与自定义内核一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14004517/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com