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

📄 决策树dlg.h

📁 Generate_decision_tree算法由数据划分D的训练元组产生决策树。
💻 H
字号:
// 决策树Dlg.h : 头文件
//

#pragma once
#include "决策树.h"




// C决策树Dlg 对话框
class C决策树Dlg : public CDialog
{
// 构造
public:
	C决策树Dlg(CWnd* pParent = NULL);	// 标准构造函数

// 对话框数据
	enum { IDD = IDD_MY_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButton1();
public:
	DNode* Dall;
	Attribute attribute_list[ATTRIBUTE_NUM-1];
public:
	void CreateTranningElement(void);
public:
	void AddToD(int age, int income, int student, int credit_rating, int buys_computer);
public:
	afx_msg void OnBnClickedButton2();
public:
	afx_msg void OnBnClickedButton3();
public:
	TreeNode* Generate_decision_tree(DNode* D,int list);
public:
	bool SameC(DNode* Di);
public:
	int Majority(DNode* Di);
public:
	DNode* FindDj(DNode* D, int nIndexAttr,int nAttrValue);
public:
	CString m_strD;
public:
	CString m_strAttri;
public:
	bool ListEmpty(Attribute* pAttri);
public:
	void Output(DNode* D);
public:
	afx_msg void OnBnClickedButton4();
void OutputTree(TreeNode *tree);
public:
	TreeNode* Tree;
public:
	CString m_strTree;
	int discrete[4];
	public:
	int attribute_selection_method(DNode* D,int aList);
};

⌨️ 快捷键说明

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