public static DecisionStump buildStump(List<DataEntry<double[], Integer>> data_set, double[] weight){
		int M = data_set.size();
		int N = data_set.get(0).data_vec.length;
		int[] labels = new int[M];
		for(int i=0;i<M;i++){
			labels[i] = data_set.get(i).label;
		}
		DecisionStump ret_stump = new DecisionStump();
		double min_error = Double.MAX_VALUE;
		for(int d=0;d<N;d++){
			double max = Double.MIN_VALUE;
			double min = Double.MAX_VALUE;
			for(int i=0;i<M;i++){
				double curr_val = data_set.get(i).data_vec[d];
				max = Math.max(curr_val, max);
				min = Math.min(curr_val, min);
			}
			double step_size = (max-min)/(double)STEPS;
			double curr_val = min;
			for(int i=0;i<STEPS;i++,curr_val+=step_size){
				boolean is_less = true;
				for(int ii=0;ii<2;ii++,is_less = !is_less){
					int[] pred_labels = batchClassify(data_set, d, curr_val, is_less);
					double pred_errors = 0.0;
					for(int m=0;m<M;m++){
						if(pred_labels[m]!=labels[m])
							pred_errors += weight[m];
					}
					if(pred_errors<min_error){
						min_error = pred_errors;
						ret_stump.dimension = d;
						ret_stump.error = min_error;
						ret_stump.is_less = is_less;
						ret_stump.threshold = curr_val;
						ret_stump.predict_val = pred_labels;
					}
				}
			}
		}
		return ret_stump;
	}