资源简介
svr 算法实现(基于smo算法) java实现
代码片段和文件信息
package SVM;
import java.util.Vector;
import java.io.*;
public class SVR {
int positivenum=0;//正样例数
int negativenum=0;//负样例数
int takenum=0;
float positivedistance=(float)0.01;//正样例回归距离
float negativedistance=3;//负样例分类距离
float c=100;
int kerneltype=0;
float step=1;
float oldb=0;
float[] svcrvalue;
float eps=(float)0.001;
float mindistance=10000;
Vector alphmin = new Vector();
float[] pastvalue=new float[3];
Vector alph = new Vector();
Vector x=new Vector();
Vector y=new Vector();
Vector w=new Vector();
float b = 0;
int d=528;//数据维数
double tolerance=0.0001;
double[] D=new double[this.d];
public static void main(String[] arg) throws Exception
{
SVR svr= new SVR();
//svr.run();
svr.caculateprecision();
}
public double[] train(int pnint nnString fil
评论
共有 条评论