/**
* 梯度提升回归树 简单实现
* @author ysh 1208706282
*
*/
public class Gbdt {
static List<Sample> mSamples;
static List<Double> mTrainTarget;
static List<Double> mTrainCurTarget;
static List<Cart> mCarts;
/**
* 加载数据 回归树
* @param path
* @param regex
* @throws Exception
*/
public void loadData(String path,String regex) throws Exception{
mSamples = new ArrayList<Sample>();
mTrainTarget = new ArrayList<Double>();
mTrainCurTarget = new ArrayList<Double>();
BufferedReader reader = new BufferedReader(new FileReader(path));
String line = null;
String splits[] = null;
Sample sample = null;
while(null != (line=reader.readLine())){
splits = line.split(regex);
sample = new Sample();
sample.label = Double.valueOf(splits[0]);
mTrainTarget.add(sample.label);
mTrainCurTarget.add(0.0);
&
* 梯度提升回归树 简单实现
* @author ysh 1208706282
*
*/
public class Gbdt {
static List<Sample> mSamples;
static List<Double> mTrainTarget;
static List<Double> mTrainCurTarget;
static List<Cart> mCarts;
/**
* 加载数据 回归树
* @param path
* @param regex
* @throws Exception
*/
public void loadData(String path,String regex) throws Exception{
mSamples = new ArrayList<Sample>();
mTrainTarget = new ArrayList<Double>();
mTrainCurTarget = new ArrayList<Double>();
BufferedReader reader = new BufferedReader(new FileReader(path));
String line = null;
String splits[] = null;
Sample sample = null;
while(null != (line=reader.readLine())){
splits = line.split(regex);
sample = new Sample();
sample.label = Double.valueOf(splits[0]);
mTrainTarget.add(sample.label);
mTrainCurTarget.add(0.0);
&