⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 targetattribute.cs

📁 It s the Naive Bayes algorithm with import function dat-files, realized by the tools of Visual Stu
💻 CS
字号:
using System;
using System.Collections;
using System.Text;

namespace NaiveBayes
{
    class TargetAttribute : SampleAttribute
    {
        public TargetAttribute(ArrayList values):
            base(values)
        {
            initializedigitizedValues();
            initializedigitizedTypes();
        }

        private void initializedigitizedValues()
        {
            this.digitizedValues = this.values.Clone() as ArrayList;
            for (int i = 0; i < this.values.Count; i++)
            {
                for (int j = 0; j < this.valueTypes.Count; j++)
                {
                    if (this.values[i].Equals(this.valueTypes[j]))
                        this.digitizedValues[i] = j;
                }
            }
        }

        private void initializedigitizedTypes()
        {
            foreach (int value in this.digitizedValues)
            {
                if (!this.digitizedTypes.Contains(value))
                    this.digitizedTypes.Add(value);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -