?? get_dim_and_tr.asv
字號:
% The algorithms implemented by Alexander Vezhnevets aka Vezhnick
% <a>href="mailto:vezhnick@gmail.com">vezhnick@gmail.com</a>
%
% Copyright (C) 2005, Vezhnevets Alexander
% vezhnick@gmail.com
%
% This file is part of GML Matlab Toolbox
% For conditions of distribution and use, see the accompanying License.txt file.
%
% get_dim_and_tr is the function, that returns dimension and threshold of
% tree node
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%
% output = get_dim_and_tr(tree_node, output)
% ---------------------------------------------------------------------------------
% Arguments:
% tree_node - a node of classification tree
% output - vector of dimensions and thresholds.
% Return:
% tree_node_left - left node (result of splitting)
% tree_node_right - right node (result of splitting)
% split_error - error of splitting
function output = get_dim_and_tr(tree_node, output)
if(nargin < 2)
output = [];
end
if(length(tree_node.parent) > 0)
output = get_dim_and_tr(tree_node.parent, output);
end
output(end+1) = tree_node.dim;
if( length(tree_node.right_constrain) > 0)
output(end+1) = tree_node.right_constrain;
output(end+1) = -1;
elseif( length(tree_node.left_constrain) > 0)
output(end+1) = tree_node.left_constrain;
output(end+1) = +1;
end
% function [dim, tr, signum] = get_dim_and_tr(tree_node)
%
% dim = tree_node.dim;
%
%
%
% if( length(tree_node.right_constrain) > 0)
% tr = tree_node.right_constrain;
% signum = -1;
% end
% if( length(tree_node.left_constrain) > 0)
% tr = tree_node.left_constrain;
% signum = +1;
% end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -