libsvm svm_predict_probability函数的用法――>返回概率
2014-10-06 12:16
856 查看
svm_predict_probability函数 需要在train之前设置parameter参数 才能得到概率模型。当svm_parameter.probability=1,或者options中的-b参数设置为1时。struct svm_parameter
{
int svm_type;
int kernel_type;
int degree; /* for poly */
double gamma; /* for poly/rbf/sigmoid */
double coef0; /* for poly/sigmoid */
/* these are for training only */
double cache_size; /* in MB */
double eps; /* stopping criteria */
double C; /* for C_SVC, EPSILON_SVR, and NU_SVR */
int nr_weight; /* for C_SVC */
int *weight_label; /* for C_SVC */
double* weight; /* for C_SVC */
double nu; /* for NU_SVC, ONE_CLASS, and NU_SVR */
double p; /* for EPSILON_SVR */
int shrinking; /* use the shrinking heuristics */
int probability; /* do probability estimates */ 1 do,0 not
};
2)svm_predict_probability函数与svm_predict函数在接口上只有第三个参数prob_estimates不同,其余两个都相同,所以这里只说明第三个参数的作用。prob_estimates里实际上存放的就是估计出的概率,比如说m分类问题,那prob_estimates就是一个1*m列的矩阵,没列代表属于相对类别的概率。这个相对类别是与svm输出结构体中的Lable相对应的!3)返回值,返回的就是最大概率对应的类别标签。如果二分类问题那就是1或-1.
{
int svm_type;
int kernel_type;
int degree; /* for poly */
double gamma; /* for poly/rbf/sigmoid */
double coef0; /* for poly/sigmoid */
/* these are for training only */
double cache_size; /* in MB */
double eps; /* stopping criteria */
double C; /* for C_SVC, EPSILON_SVR, and NU_SVR */
int nr_weight; /* for C_SVC */
int *weight_label; /* for C_SVC */
double* weight; /* for C_SVC */
double nu; /* for NU_SVC, ONE_CLASS, and NU_SVR */
double p; /* for EPSILON_SVR */
int shrinking; /* use the shrinking heuristics */
int probability; /* do probability estimates */ 1 do,0 not
};
2)svm_predict_probability函数与svm_predict函数在接口上只有第三个参数prob_estimates不同,其余两个都相同,所以这里只说明第三个参数的作用。prob_estimates里实际上存放的就是估计出的概率,比如说m分类问题,那prob_estimates就是一个1*m列的矩阵,没列代表属于相对类别的概率。这个相对类别是与svm输出结构体中的Lable相对应的!3)返回值,返回的就是最大概率对应的类别标签。如果二分类问题那就是1或-1.
相关文章推荐
- libsvm 之svmpredict 输出概率用法
- libsvm 之svmpredict 输出概率用法
- 封装Libsvm与Liblinear(重要概念之返回预测类别的概率分数)
- matlab中Svmtrain和Svmpredict的用法
- libsvm2.88之“svm-predict”的使用
- SVM学习笔记(2 )libsvm--svmtrain\svmpredict函数说明
- libsvm中svmpredict返回值为空的解决办法
- <Opencv for Android 调试>加载XML模型,使用SVM.predict出现的NullPointerException问题
- libsvm的使用svm-scale和svm-train与svm-predict
- Felomeng翻译:libsvm2.88之“svm-predict”的使用
- libsvm源代码注释+算法描述:svm_predict
- 返回值类型为SqlDataReader的用法
- c#使用存储过程返回数据集(SqlCommand->DataSet)
- SVM学习之一:libsvm中的数据预处理
- Asp.Net中几种相似的标记符号: < %=...%> < %#... %> < % %> < %@ %>解释及用法(转)
- Struts 2 标签之<s:property/>的用法举例
- ManualResetEvent用法(阻塞->激活->阻塞->激活...) 样例
- Felomeng翻译:libsvm2.88之“svm-scale”的使用
- struts 1.x <logic:iterate>用法详解
- ClientID、 <%=%>用法之一