Exemple #1
0
        private readonly int maxFeatureTypeIndex;           // 特征组的最大索引

        /// <summary>
        /// 构造函数:多组特征,最后一组得到结果
        /// </summary>
        /// <param name="treename">决策树的表所在的数据库名</param>
        /// <param name="classname">类别的字段名</param>
        /// <param name="treeFeatureAsType">当前参与建树的所有特征,按类型排列</param>
        public MultipleClassicDecisionTree(string treename, string classname, List <string>[] treeFeatureAsType)
        {
            connectdb              = new ConnectToDB(treename);
            this.classname         = classname;
            this.treeFeatureAsType = treeFeatureAsType;
            maxFeatureTypeIndex    = treeFeatureAsType.Length - 1;
        }
        private readonly string classname;      // 类别的字段名

        /// <summary>
        /// 构造函数:一组特征直接得到结果
        /// </summary>
        /// <param name="treename">决策树的表所在的数据库名</param>
        /// <param name="classname">类别的字段名</param>
        public ClassicDecisionTree(string treename, string classname)
        {
            connectdb      = new ConnectToDB(treename);
            this.classname = classname;
        }