资源简介
这是基于ID3算法编写的决策树,里面有一个可视化图形界面
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DecisionTrees
{
public class DataMode
{
private string[] dataArray = new string[20 6]{
{ “90-100“ “bad“ “positive“ “16-18“ “strong“ “substandard“ }
{ “90-100“ “bad“ “positive“ “16-18“ “weak“ “substandard“ }
{ “90-100“ “bad“ “sometimes“ “19-21“ “weak“ “substandard“ }
{ “90-100“ “good“ “positive“ “22-24“ “strong“ “threeGoodStudent“ }
{ “90-100“ “ordinary“ “positive“ “19-21“ “weak“ “threeGoodStudent“ }
{ “90-100“ “bad“ “sometimes“ “16-18“ “weak“ “substandard“ }
{ “80-89“ “good“ “sometimes“ “16-18“ “strong“ “threeGoodStudent“ }
{ “80-89“ “good“ “sometimes“ “16-18“ “weak“ “threeGoodStuden“ }
{ “80-89“ “ordinary“ “sometimes“ “16-18“ “strong“ “threeGoodStudentr“ }
{ “70-79“ “ordinary“ “positive“ “22-24“ “weak“ “substandard“ }
{ “0-69“ “ordinary“ “sometimes“ “19-21“ “weak“ “substandard“ }
{ “80-89“ “ordinary“ “sometimes“ “16-18“ “strong“ “threeGoodStuden“ }
{ “80-89“ “ordinary“ “positive“ “16-18“ “weak“ “substandard“ }
{ “90-100“ “bad“ “sometimes“ “22-24“ “weak“ “substandard“ }
{ “80-89“ “ordinary“ “sometimes“ “16-18“ “strong“ “threeGoodStudent“ }
{ “80-89“ “ordinary“ “positive“ “16-18“ “strong“ “threeGoodStudent“ }
{ “70-79“ “good“ “sometimes“ “22-24“ “strong“ “substandard“ }
{ “70-79“ “good“ “sometimes“ “22-24“ “strong“ “substandard“ }
{ “0-69“ “good“ “positive“ “22-24“ “strong“ “substandard“ }
{ “0-69“ “good“ “positive“ “19-21“ “strong“ “substandard“ }};
private string[][] attribute = new string[6][];
private string[] Items = new string[] { “grade“ “morality“ “sports“ “age“ “otherAbility“ “whetherThreeGood“ };
private int[] conditionAmount = new int[] { 4 3 3 3 2 2 };
public DataMode()
{
}
//初始化属性值
public string[][] getAttribute()
{
attribute[0]=new string[4]{“90-100““80-89““70-79““0-69“};
attribute[1] = new string[3] { “good“ “ordinary““bad“};
attribute[2] = new string[3] { “positive“ “sometimes“ “nonparticipation“ };
attribute[3] = new string[3] { “16-18“ “19-21“ “22-24“ };
attribute[4] = new string[2] { “strong“ “weak“ };
attribute[5] = new string[2] { “threeGoodStudent“ “substandard“ };
return attribute;
}
public int getAttributeByName(string namestring condition)
{
getAttribute();
int index=getIndexOfItems(name);
int sum = getChildAmountByName(name);
for (int i = 0; i < sum; i++)
{
if (attribute[index][i].Comp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 99678 2011-01-18 09:36 决策树-C#代码\DecisionTrees\bin\Debug\114.ico
文件 99678 2011-04-19 09:28 决策树-C#代码\DecisionTrees\bin\Debug\38.ico
文件 117248 2011-05-07 21:29 决策树-C#代码\DecisionTrees\bin\Debug\DecisionTrees.exe
文件 50688 2011-05-07 21:29 决策树-C#代码\DecisionTrees\bin\Debug\DecisionTrees.pdb
文件 14328 2011-05-07 19:26 决策树-C#代码\DecisionTrees\bin\Debug\DecisionTrees.vshost.exe
文件 122368 2011-05-20 19:24 决策树-C#代码\DecisionTrees\bin\Release\DecisionTrees.exe
文件 54784 2011-05-20 19:24 决策树-C#代码\DecisionTrees\bin\Release\DecisionTrees.pdb
文件 14328 2011-05-20 19:23 决策树-C#代码\DecisionTrees\bin\Release\DecisionTrees.vshost.exe
文件 490 2009-06-11 05:14 决策树-C#代码\DecisionTrees\bin\Release\DecisionTrees.vshost.exe.manifest
文件 3943 2011-05-20 19:25 决策树-C#代码\DecisionTrees\DataMode.cs
文件 6372 2011-05-20 19:08 决策树-C#代码\DecisionTrees\DecisionTreeForm.cs
文件 13105 2011-05-20 16:58 决策树-C#代码\DecisionTrees\DecisionTreeForm.Designer.cs
文件 155634 2011-05-20 16:58 决策树-C#代码\DecisionTrees\DecisionTreeForm.resx
文件 3920 2011-05-20 16:45 决策树-C#代码\DecisionTrees\DecisionTrees.csproj
文件 778 2011-05-19 18:09 决策树-C#代码\DecisionTrees\ID3_Algorithm.cs
文件 569 2011-05-07 21:30 决策树-C#代码\DecisionTrees\obj\Debug\DecisionTrees.csproj.FileListAbsolute.txt
文件 916 2011-05-07 19:09 决策树-C#代码\DecisionTrees\obj\Debug\DecisionTrees.csproj.GenerateResource.Cache
文件 100244 2011-05-07 19:09 决策树-C#代码\DecisionTrees\obj\Debug\DecisionTrees.DecisionTreeForm.resources
文件 117248 2011-05-07 21:30 决策树-C#代码\DecisionTrees\obj\Debug\DecisionTrees.exe
文件 50688 2011-05-07 21:30 决策树-C#代码\DecisionTrees\obj\Debug\DecisionTrees.pdb
文件 180 2011-05-07 18:41 决策树-C#代码\DecisionTrees\obj\Debug\DecisionTrees.Properties.Resources.resources
文件 3524 2011-05-20 19:24 决策树-C#代码\DecisionTrees\obj\Release\DecisionTrees.csproj.FileListAbsolute.txt
文件 858 2011-05-20 16:58 决策树-C#代码\DecisionTrees\obj\Release\DecisionTrees.csproj.GenerateResource.Cache
文件 100244 2011-05-20 16:58 决策树-C#代码\DecisionTrees\obj\Release\DecisionTrees.DecisionTreeForm.resources
文件 122368 2011-05-20 19:24 决策树-C#代码\DecisionTrees\obj\Release\DecisionTrees.exe
文件 54784 2011-05-20 19:24 决策树-C#代码\DecisionTrees\obj\Release\DecisionTrees.pdb
文件 180 2011-05-20 16:45 决策树-C#代码\DecisionTrees\obj\Release\DecisionTrees.Properties.Resources.resources
文件 505 2011-05-06 15:34 决策树-C#代码\DecisionTrees\Program.cs
文件 1358 2011-05-06 15:12 决策树-C#代码\DecisionTrees\Properties\AssemblyInfo.cs
文件 2876 2011-05-06 15:12 决策树-C#代码\DecisionTrees\Properties\Resources.Designer.cs
............此处省略22个文件信息
评论
共有 条评论