gpt4 book ai didi

python - Libsvm:工具/easy.py

转载 作者:行者123 更新时间:2023-11-30 23:38:26 25 4
gpt4 key购买 nike

脚本tools/easy.py仅使用rbf内核。如何更改此脚本以使用其他内核(特别是线性内核)执行实验?

谢谢

最佳答案

您需要将您想要的 svm_type 选项传递给 svm-train [options]training_set_file [model_file]。来自源代码中的README文件:

options:
-s svm_type : set type of SVM (default 0)
0 -- C-SVC
1 -- nu-SVC
2 -- one-class SVM
3 -- epsilon-SVR
4 -- nu-SVR
-t kernel_type : set type of kernel function (default 2)
0 -- linear: u'*v
1 -- polynomial: (gamma*u'*v + coef0)^degree
2 -- radial basis function: exp(-gamma*|u-v|^2)
3 -- sigmoid: tanh(gamma*u'*v + coef0)
4 -- precomputed kernel (kernel values in training_set_file)

因此线性将是-t 0

自述文件中还列出了其他选项,它们会更改每个内核函数中使用的参数。

关于python - Libsvm:工具/easy.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14538637/

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