Return to Snippet

Revision: 68610
at January 25, 2015 05:18 by mizunoandrey


Initial Code
protected int GetNextCriterion(Table table)
        {
            Dictionary<_NodeCriterionInfo, int> filter = GetFilter();
            Table rest = table.Filter(filter);

            List<double> infos = new List<double>();

            int i;

            for (i = 0; i < rest.Criteria.Count - 1; i++)
                infos.Add(rest.Infos(i));



            for (i = 0; i < rest.Criteria.Count - 1; i++)
            {
                bool containsKey = false;
                foreach (KeyValuePair<_NodeCriterionInfo,int> kvp in filter)
                    if (kvp.Key.Index == i)
                    {
                        containsKey = true;
                        break;
                    }
                if (
                    !containsKey
                    ) break;
            }
                


            int iMin = i;
            double min = infos[iMin];


            for (i = iMin; i < rest.Criteria.Count - 1; i++)
            {
                bool containsKey = false;
                foreach (KeyValuePair<_NodeCriterionInfo, int> kvp in filter)
                    if (kvp.Key.Index == i)
                    {
                        containsKey = true;
                        break;
                    }
                if (
                    containsKey
                    ) continue;

                if (infos[i] < min)
                {
                    min = infos[i];
                    iMin = i;
                }
            }


            return iMin;
        }

Initial URL

                                

Initial Description
older version of and id3/c45 classifier

Initial Title
choose criterion 2011

Initial Tags

                                

Initial Language
C#