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

📄 prune_tree_c45.m

📁 决策树算法的matlab实现
💻 M
字号:
function T = prune_tree_C45(T,A,B,CF)
% PRUNE_TREE_C45 prunes the decision tree T using the pruning algorithm from 
%	C4.5: Programs from Machine Learning.
%
%	T = prune_tree_C45(T,A,B,CF)
%
%	T : matrix representing decision tree generated by MSM-T algorithm
%	A: matrix representing the point set A
%	B: matrix representing the point set B
%	CF: certainty factor used in pruning.  0 <= CF <= 1.0
%
%	ASSUME: the root node will always remain

% coeff is a global variable and is accessible for function prune, prune_tree.

global coeff;
global CF;

% n is the dimension of the points in sets A,B
global n;
n = size(A,2);

% determine coeff:
coeff = prune_det_coeff_C45(CF);


% prune the tree
% first determine T_breakdown
T_breakdown = msmt_tree_breakdown(T_breakdown,T,A,B,1);
position = [ 1 ];
[T,error] = prune_C45(T,T_breakdown,0,[position,T(n+2,1)]);	% prune left
[T,error] = prune_C45(T,T_breakdown,1,[position,T(n+3,1)]);	% prune right

⌨️ 快捷键说明

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