using System;
using libsvm;
/* Conversion notes (Andrew Poh):
* Support Class removed.
* BinaryWriter.Write() replaced with Write().
* Removed nested construction of StreamReader.
*/
class svm_predict
{
private static double atof(System.String s)
{
return System.Double.Parse(s);
}
private static int atoi(System.String s)
{
return System.Int32.Parse(s);
}
private static void predict(System.IO.StreamReader input, System.IO.BinaryWriter output, svm_model model, int predict_probability)
{
int correct = 0;
int total = 0;
double error = 0;
double sumv = 0, sumy = 0, sumvv = 0, sumyy = 0, sumvy = 0;
int svm_type = svm.svm_get_svm_type(model);
int nr_class = svm.svm_get_nr_class(model);
int[] labels = new int[nr_class];
double[] prob_estimates = null;
if (predict_probability == 1)
{
if (svm_type == svm_parameter.EPSILON_SVR || svm_type == svm_parameter.NU_SVR)
svm-predict
最新推荐文章于 2021-11-24 13:04:58 发布