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

📄 form1.cs

📁 一个用C#编写的ID3分类算法
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using DecisionTreeID3;

namespace WindowsID3
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private bool flag;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.TreeView treeView1;
		private System.Windows.Forms.Splitter splitter1;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.ComboBox cbo_cloud;
		private System.Windows.Forms.ComboBox cbo_humidity;
		private System.Windows.Forms.ComboBox cbo_temperature;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.ComboBox cbo_zone;
		private System.Windows.Forms.Button btn_Distinct;
		private System.Windows.Forms.Button btn_Exit;
		private System.Windows.Forms.Label label6;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		
		
		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.treeView1 = new System.Windows.Forms.TreeView();
			this.splitter1 = new System.Windows.Forms.Splitter();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.btn_Exit = new System.Windows.Forms.Button();
			this.label5 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.cbo_cloud = new System.Windows.Forms.ComboBox();
			this.cbo_humidity = new System.Windows.Forms.ComboBox();
			this.cbo_temperature = new System.Windows.Forms.ComboBox();
			this.label1 = new System.Windows.Forms.Label();
			this.cbo_zone = new System.Windows.Forms.ComboBox();
			this.btn_Distinct = new System.Windows.Forms.Button();
			this.label6 = new System.Windows.Forms.Label();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.treeView1);
			this.groupBox1.Dock = System.Windows.Forms.DockStyle.Left;
			this.groupBox1.Location = new System.Drawing.Point(0, 0);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(328, 389);
			this.groupBox1.TabIndex = 1;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "决策树";
			// 
			// treeView1
			// 
			this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.treeView1.ImageIndex = -1;
			this.treeView1.ItemHeight = 14;
			this.treeView1.Location = new System.Drawing.Point(3, 17);
			this.treeView1.Name = "treeView1";
			this.treeView1.SelectedImageIndex = -1;
			this.treeView1.Size = new System.Drawing.Size(322, 369);
			this.treeView1.TabIndex = 0;
			// 
			// splitter1
			// 
			this.splitter1.Location = new System.Drawing.Point(328, 0);
			this.splitter1.Name = "splitter1";
			this.splitter1.Size = new System.Drawing.Size(8, 389);
			this.splitter1.TabIndex = 2;
			this.splitter1.TabStop = false;
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.label6);
			this.groupBox2.Controls.Add(this.btn_Exit);
			this.groupBox2.Controls.Add(this.label5);
			this.groupBox2.Controls.Add(this.label4);
			this.groupBox2.Controls.Add(this.label3);
			this.groupBox2.Controls.Add(this.label2);
			this.groupBox2.Controls.Add(this.cbo_cloud);
			this.groupBox2.Controls.Add(this.cbo_humidity);
			this.groupBox2.Controls.Add(this.cbo_temperature);
			this.groupBox2.Controls.Add(this.label1);
			this.groupBox2.Controls.Add(this.cbo_zone);
			this.groupBox2.Controls.Add(this.btn_Distinct);
			this.groupBox2.Dock = System.Windows.Forms.DockStyle.Left;
			this.groupBox2.Location = new System.Drawing.Point(336, 0);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(240, 389);
			this.groupBox2.TabIndex = 5;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "判断";
			// 
			// btn_Exit
			// 
			this.btn_Exit.Location = new System.Drawing.Point(72, 344);
			this.btn_Exit.Name = "btn_Exit";
			this.btn_Exit.Size = new System.Drawing.Size(144, 32);
			this.btn_Exit.TabIndex = 13;
			this.btn_Exit.Text = "退出 ";
			this.btn_Exit.Click += new System.EventHandler(this.btn_Exit_Click);
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(24, 212);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(40, 16);
			this.label5.TabIndex = 12;
			this.label5.Text = "云量";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(24, 164);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(40, 16);
			this.label4.TabIndex = 11;
			this.label4.Text = "湿度";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(24, 116);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(40, 16);
			this.label3.TabIndex = 10;
			this.label3.Text = "温度";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(24, 68);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(32, 16);
			this.label2.TabIndex = 9;
			this.label2.Text = "地区";
			// 
			// cbo_cloud
			// 
			this.cbo_cloud.Location = new System.Drawing.Point(72, 208);
			this.cbo_cloud.Name = "cbo_cloud";
			this.cbo_cloud.Size = new System.Drawing.Size(144, 20);
			this.cbo_cloud.TabIndex = 8;
			// 
			// cbo_humidity
			// 
			this.cbo_humidity.Location = new System.Drawing.Point(72, 160);
			this.cbo_humidity.Name = "cbo_humidity";
			this.cbo_humidity.Size = new System.Drawing.Size(144, 20);
			this.cbo_humidity.TabIndex = 7;
			// 
			// cbo_temperature
			// 
			this.cbo_temperature.Location = new System.Drawing.Point(72, 112);
			this.cbo_temperature.Name = "cbo_temperature";
			this.cbo_temperature.Size = new System.Drawing.Size(144, 20);
			this.cbo_temperature.TabIndex = 6;
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(24, 32);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(80, 24);
			this.label1.TabIndex = 5;
			this.label1.Text = "请选择属性:";
			// 
			// cbo_zone
			// 
			this.cbo_zone.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbo_zone.Location = new System.Drawing.Point(72, 64);
			this.cbo_zone.Name = "cbo_zone";
			this.cbo_zone.Size = new System.Drawing.Size(144, 20);
			this.cbo_zone.TabIndex = 4;
			// 
			// btn_Distinct
			// 
			this.btn_Distinct.Location = new System.Drawing.Point(72, 304);
			this.btn_Distinct.Name = "btn_Distinct";
			this.btn_Distinct.Size = new System.Drawing.Size(144, 32);
			this.btn_Distinct.TabIndex = 3;
			this.btn_Distinct.Text = "判断";

⌨️ 快捷键说明

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