예제 #1
0
        /// <summary>
        /// creates tree by all xy array and all variables
        /// only internal use
        /// </summary>
        /// <param name="xy">train set</param>
        /// <param name="nclasses">now works only with 2</param>
        /// <param name="nvars"></param>
        /// <param name="npoints"></param>
        /// <param name="modNvars"></param>
        /// <param name="vidxes"></param>
        /// <returns></returns>
        private static DecisionTree CreateTree(double[,] xy, int nclasses, int nvars, int npoints, int modNvars, int[] vidxes, int[] ridxes)
        {
            DecisionTree result;

            try
            {
                int info;
                alglib.decisionforest df;
                alglib.dfreport rep;
                alglib.dfbuildrandomdecisionforest(xy, npoints, modNvars, nclasses, 1, 1, out info, out df, out rep);

                result = new DecisionTree();
                result.Id = CreateId();
                result.AlglibTree = df;
                result.NClasses = nclasses;
                result.NVars = nvars;
                result.ModNvars = modNvars;
                result.VarIndexes = vidxes;
                result.RowIndexes = ridxes;
            }
            catch (Exception e)
            {
                Logger.Log(e);
                throw;
            }

            return result;
        }
예제 #2
0
 public void AddTree(DecisionTree tree)
 {
     _batch.Add(tree);
 }
예제 #3
0
 public void AddTree(DecisionTree tree)
 {
     _batch.Add(tree);
 }