📄 calc_output.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.
%
% calc_output Implements classification of input by a classification tree node
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%
% y = calc_output(tree_node, XData)
% ---------------------------------------------------------------------------------
% Arguments:
% tree_node - classification tree node
% XData - data, that will be classified
% Return:
% y - 1, if belongs
function y = calc_output(tree_node, XData)
y = XData(tree_node.dim, :) * 0 + 1;
for i = 1 : length(tree_node.parent)
y = y .* calc_output(tree_node.parent, XData);
end
if( length(tree_node.right_constrain) > 0)
y = y .* ((XData(tree_node.dim, :) < tree_node.right_constrain));
end
if( length(tree_node.left_constrain) > 0)
y = y .* ((XData(tree_node.dim, :) > tree_node.left_constrain));
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -