Ejemplo n.º 1
0
        internal DecisionTreeList ReadDecisionTreeListFromDisk(string filename)
        {
            var dtl = new DecisionTreeList(DecisionTreeList.Type.Production);

            try
            {
                if (dtl.FileExists(filename))
                {
                    dtl.ReadFromDisk(filename);
                }
                else
                {
                    dtl = null;
                }
            }
            catch
            {
                dtl = null;
            }
            return dtl;
        }
Ejemplo n.º 2
0
 private string GetVotes(List<int> factors, DecisionTreeList dtl)
 {
     if (null == dtl)
     {
         return "NA";
     }
     else
     {
         int votes = 0;
         dtl.ForEach(dt => votes += dt.Evaluate(factors) ? 1 : 0);
         return string.Format("{0}", votes);
     }
 }