?? calc_output.m
字號:
% 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 XData belongs to tree node, -1 otherwise (y is a vector)
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 + -