![]() |
IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
|
Class labels hierarchy resolver.
This function parses a list of multi-level class labels, essentially finding the individual labels between the '|' separators.
It also mounts new class labels and gives their corresponding new class numbers, if the 'new_hierarchy' input is passed.
Everything is returned in a 2D cell that contains one row for each class label. The meanings of the cell columns are as follows:
/// >> c = {'A|1|T', 'A|1|F', 'A|2|T', 'A|2|F', 'A|3|T', 'A|3|F', 'B|1|T', 'B|1|F'};
/// >> cc = classlabels2cell(c, [1, 3])
///
/// cc =
///
/// [0] 'A|1|T' 'A|T' [1] 'A' '1' 'T'
/// [1] 'A|1|F' 'A|F' [0] 'A' '1' 'F'
/// [2] 'A|2|T' 'A|T' [1] 'A' '2' 'T'
/// [3] 'A|2|F' 'A|F' [0] 'A' '2' 'F'
/// [4] 'A|3|T' 'A|T' [1] 'A' '3' 'T'
/// [5] 'A|3|F' 'A|F' [0] 'A' '3' 'F'
/// [6] 'B|1|T' 'B|T' [3] 'B' '1' 'T'
/// [7] 'B|1|F' 'B|F' [2] 'B' '1' 'F'
/// @sa cell2classlabels.m
Definition in file classlabels2cell.m.
Go to the source code of this file.
Functions | |
| function | classlabels2cell (in classlabels, in new_hierarchy) |
| function classlabels2cell | ( | in | classlabels, |
| in | new_hierarchy | ||
| ) |
| classlabels | |
| new_hierarchy | =[]. New hierarchy. 0 means "none"; [] means "all" |