예제 #1
0
 public void computeStats(Stats s, int l)
 {
     for (int i = 0; i < nc; i++)
     {
         s.n[l+1]++;
         s.size[l+1] += models[children[i]].Size();
         s.max_error[l+1] = Math.Max(s.max_error[l+1], models[children[i]].err);
         models[children[i]].computeStats(s, l + 1);
     }
 }
예제 #2
0
 public void computeStats()
 {
     stat = new Stats(max_depth());
     stat.n[0] = 1;
     stat.size[0] = Size();
     stat.max_error[0] = err;
     for (int i = 0; i < nc; i++)
     {
         stat.n[1]++;
         stat.size[1]+=models[children[i]].Size();
         stat.max_error[1] = Math.Max(stat.max_error[1], models[children[i]].err);
         models[children[i]].computeStats(stat,  1);
     }
 }