示例#1
0
文件: ATForest.java 项目: dhonza/ne
 public double[] getConstants() {
   double[][] constants = new double[trees.length][];
   for (int i = 0; i < trees.length; i++) {
     constants[i] = trees[i].getConstants();
   }
   return ArrayHelper.flatten(constants);
 }
示例#2
0
文件: ATForest.java 项目: dhonza/ne
 public void setConstants(double[] constants) {
   int[] parts = new int[trees.length];
   for (int i = 0; i < trees.length; i++) {
     parts[i] = trees[i].getNumOfConstants();
   }
   double[][] treeConstants = ArrayHelper.partition(constants, parts);
   for (int i = 0; i < trees.length; i++) {
     trees[i].setConstants(treeConstants[i]);
   }
 }