1 %>@ingroup datasettools classlabelsgroup
3 %> @brief searches and replaces
class labels
5 %> This
function performs the search within
class levels, not the whole labels. For example, in a label 'A|B|C', matched will be tried against 'A', 'B', and 'C' separately
9 %> @param map See syntax below: @code {old_label1, new_label1; old_label2, new_label2; ...}
@endcode
10 %> @param levelstosearch Levels to search
11 %> @
return Dataset with classlabels changed
16 if ~exist('levelstosearch', 'var') || isempty(levelstosearch)
17 levelstosearch = 1:(size(comoassim, 2)-4); % all levels
20 no_map = size(map, 1);
27 for j = 5:size(comoassim, 2)
28 if any(levelstosearch == j-4)
30 if strcmp(comoassim{i, j}, map{k, 1})
31 comoassim{i, j} = map{k, 2};
39 s = [s comoassim{i, j}];
46 data.classlabels =
new;
function data_rename_classlabels(in data, in map, in levelstosearch)
function classlabels2cell(in classlabels, in new_hierarchy)