perClass Documentation
version 5.4 (7-Dec-2018)
SDRELAB Rename classes or define meta-classes

    OUT=SDRELAB(IN,MAP)
    OUT=SDRELAB(IN,options)

    P2=SDRELAB(P,MAP)  % rename decisions in pipeline P

 INPUT
    IN    SDLAB or SDDATA object
    MAP   Cell array with relabeling rules {SOURCE, DEST, ...}
    P     Pipeline returning decisions

 OUTPUT
    OUT   Relabeled SDLAB or SDDATA object
    P2    Pipeline returning decisions described by MAP

 OPTIONS
  'nodisplay'       - do not show the final label translation table
  'all',S           - label all samples as S
  'add','prefix',S  - add prefix string S to all class names
  'suffix',S        - add suffix string S to all class names
  'add to all',S    - add prefix string to all groups in all indexed sample
                      properties (sdlab).

 DESCRIPTION
 SDRELAB allows us to redefine class names in SDLAB or SDDATA objects.
 Class renaming rules are defined in a cell array MAP with source and
 destination entries. Classes may be specified by names, indices or SDLAB
 objects. The Tilde character (~) in the source class name defines the
 negation. This means that the rule applies to all remainig classes.
 Tilde character (~) in the source class name defines the negation. This
 means that the rule applies to all remainig classes.
 Alternatively, both SOURCE and DEST may be sdlab objects of equal length
 defining the conversions directly.
 SDRELAB prints the translation table by default. To suppress it, use
 'nodisplay' option.
 SDRELAB may also rename decisions in a pipeline P using arbitrary
 rewriting rules in MAP.

 EXAMPLES
  % relabel first two classes into 'fruit' and third class into 'outlier'
  B=sdrelab(A,{1:2,'fruit' 3 'outlier'})
  B=sdrelab(A,{'~outlier','target'}) % what is not 'outlier' becomes 'target'
  B=sdrelab(A,{'/apple|ban','fruit'}) % use regular expression (samples that
                                      % contain 'apple' or 'ban' become 'fruit')
  B=sdrelab(A,'add','old-')    % add prefix 'old-' to all class names
  B=sdrelab(A,'all','unknown') % label all samples in A as 'unknown'

 Defining conversion rules by direct example in sdlab objects:
 B=sdrelab(A,{sdlab('stone','banana','apple'),sdlab('non-fruit','fruit','fruit')})

sdrelab is referenced in examples: