<div style="color:#000; font-size: 14px;font-family: arial;"><div><br></div><div><span style="font-size: 20px;">hi all,</span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7; font-size: 20px;">I want to export the svm parameters and apply it in a c++ svm implementation at  </span><a href="https://github.com/yctung/AndroidLibSvm." _src="https://github.com/yctung/AndroidLibSvm." style="line-height: 1.7; font-size: 10px; text-decoration: underline;"><span style="font-size: 20px;">https://github.com/yctung/AndroidLibSvm.</span></a><span style="line-height: 1.7; font-size: 20px;">  after grid search, </span><span style="line-height: 23.8px; font-size: 20px;">SVC with C=1.0,gamma =10.0 get  92% accuracy,  </span><span style="line-height: 1.7; font-size: 20px;">but </span><span style="line-height: 23.8px; font-size: 20px;">unfortunately</span><span style="line-height: 1.7; font-size: 20px;">, SVC model does't  contains the paratmeters needed by the c++ model, which take as input the low-level svm params, ie sv_coef,probA ..., the </span><span style="line-height: 23.8px; font-size: 20px;">returns of </span><span style="line-height: 1.7; font-size: 20px;">low level svm api ,'libsvm.fit', match the requirement, but the prediction result is different from SVC model:</span></div><div><br></div><div><span style="color: rgb(36, 39, 41); font-family: Arial, Helvetica Neue, Helvetica, sans-serif; line-height: 19.5px; font-size: 20px; background-color: rgb(255, 255, 255);">The code :</span></div><div><pre style="font-family: Courier New; font-size: 18pt; background-color: rgb(255, 255, 255);"><span style="font-size: 20px;">model = libsvm.fit(X_data.astype(np.float64),Y_data.astype(np.float64),</span><span style="color: rgb(102, 0, 153); font-size: 20px;">svm_type</span><span style="font-size: 20px;">=</span><span style="color: rgb(0, 0, 255); font-size: 20px;">0</span><span style="font-size: 20px;">,</span><span style="color: rgb(102, 0, 153); font-size: 20px;">kernel</span><span style="font-size: 20px;">=</span><span style="color: rgb(0, 128, 0); font-weight: bold; font-size: 20px;">'rbf'</span><span style="font-size: 20px;">,</span><span style="color: rgb(102, 0, 153); font-size: 20px;">C </span><span style="font-size: 20px;">= </span><span style="color: rgb(0, 0, 255); font-size: 20px;">1.0</span><span style="font-size: 20px;">,</span><span style="color: rgb(102, 0, 153); font-size: 20px;">gamm</span><span style="line-height: 1.7; font-size: 20px;">= </span><span style="line-height: 1.7; color: rgb(0, 0, 255); font-size: 20px;">10.0</span><span style="line-height: 1.7; font-size: 20px;">)</span></pre><pre style="font-family: Courier New; font-size: 18pt; background-color: rgb(255, 255, 255);"><span style="font-size: 20px;">pred = libsvm.predict(X_data.astype(np.float64), *model,</span><span style="color: rgb(102, 0, 153); font-size: 20px;">kernel</span><span style="font-size: 20px;">=</span><span style="color: rgb(0, 128, 0); font-weight: bold; font-size: 20px;">'rbf'</span><span style="font-size: 20px;">)<br></span></pre><pre style="font-family: Courier New; font-size: 18pt; background-color: rgb(255, 255, 255);"><span style="line-height: 1.7; color: rgb(0, 0, 128); font-weight: bold; font-size: 20px;">print </span><span style="line-height: 1.7; color: rgb(0, 128, 0); font-weight: bold; font-size: 20px;">"hello mean " </span><span style="line-height: 1.7; font-size: 20px;">+ </span><span style="line-height: 1.7; color: rgb(0, 0, 128); font-size: 20px;">s</span><span style="color: rgb(102, 0, 153); font-size: 20px;">a </span><span style="color: rgb(0, 0, 128); font-size: 20px;">tr</span><span style="font-size: 20px;">(np.mean(pred == Y_data)) # result "hello mean 0.570588235294"</span></pre><pre style="font-family: Courier New; font-size: 18pt; background-color: rgb(255, 255, 255);"><span style="font-size: 20px;">can somebody give some suggestion on this problem,thanks!</span></pre></div></div><div><br><br><span title="neteasefooter"><p> </p></span></div><br><br><span title="neteasefooter"><p> </p></span>