Esempio n. 1
0
//
// finalizeStage save forest and write the forest statistic to file.
//
func (crf *Runtime) finalizeStage(forest *rf.Runtime) (e error) {
	stat := forest.StatTotal()
	stat.ID = int64(len(crf.forests))

	e = crf.WriteOOBStat(stat)
	if e != nil {
		return e
	}

	crf.AddStat(stat)
	crf.ComputeStatTotal(stat)

	if DEBUG >= 1 {
		crf.PrintStatTotal(nil)
	}

	// (7)
	crf.AddForest(forest)

	return nil
}