annotate core/tools/machine_learning/cut_Y.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function r = cut_Y(r, valid_idx)
Daniel@0 2 % disables the invalid parts of the ranking structure Y
Daniel@0 3
Daniel@0 4 % get indices not mentioned
Daniel@0 5 u = find(~valid_idx);
Daniel@0 6
Daniel@0 7 % clear bad data
Daniel@0 8 for i = 1 : numel(u)
Daniel@0 9
Daniel@0 10 r{u(i), 1} = [];
Daniel@0 11 r{u(i), 2} = [];
Daniel@0 12 end
Daniel@0 13
Daniel@0 14 % also clear weights if applicable
Daniel@0 15 if size(r,2) == 3
Daniel@0 16 for i = 1 : numel(u)
Daniel@0 17 r{u(i), 3} = 0;
Daniel@0 18 end
Daniel@0 19 end
Daniel@0 20 end