本帖最后由 蓝云风翼 于 2013-10-11 11:03 编辑
Download preconfigure cuSVM Visual Studio 2010 solution with LibSVM and matlab scritp for classification。
你需要做的是将cuSVM 中的 cuSVMTrain。mexw32 和cuSVMPredict。mexw32添加到MATLAB path中去,mexw32在附件中的cusvmexw32中,此外你也可以通过release模式生成mexw文件在附件cuSVM中
cuSVMTrain。
用法:[alphas,beta,svs]=cuSVMTrain(y,train,C,kernel,eps, (optional) stoppingcrit)
输出:
1。 alphas is a single-precision vector of the support vector coecients。
2。 beta is a single-precision scalar, the oset b in the SVM prediction function。
3。 svs is a single-precision matrix of the support vectors corresponding to
alphas, i。
e。 the support vector found in row i of svs has the coecient in
the SVM prediction function found in row i of alphas。
输入:
1。
y is a single-precision vector of training outputs。 If you are classifying,
these must be either 1 or -1。 In regression, these are generally continuously
valued。
2。 train is a single-precision matrix of training data corresponding to y。
3。 C is the scalar SVM regularization parameter。
4。 kernel is the scalar Gaussian kernel parameter, i。e。 lamda in exp(-lamda||x-z||。^2)。
5。 eps is in -Support Vector Regression。
If you want to classify rather than
regress, set eps to empty, i。e [ ]。
6。 stoppingcrit is an optional scalar argument that one can use to specify the
optimization stopping criterion。
By default, the stopping criterion is set to
0。001。
cuSVMPredict。 用法:
prediction=cuSVMPredict(test,svs,alphas,beta,kernel,regind)
输出:
1。
prediction is a single-precision vector of predictions。
Inputs:
1。 test is a single-precision matrix of test data。
2。
svs is the single-precision matrix of support vectors output by cuSVMTrain。
3。 alphas is the single-precision vector of support vector coecients output by
cuSVMTrain。
4。 beta is the single-precision scalar oset output by cuSVMTrain。
5。 kernel is the same scalar Gaussian kernel parameter value previously used
in cuSVMTrain。
6。 regind is a scalar indicator variable that tells cuSVMPredict whether you
are classifying or regressing。 Set regind to 0 if the former and 1 if the latter。
全部