PRTools Contents

PRTools User Guide

selclass

SELCLASS

mapping for selecting a single class from a dataset

   [B,J] = SELCLASS(A,CLASS,NAME.K)
   [B,J] = A*SELCLASS([],CLASS,NAME,K)
   [B,J] = A*SELCLASS(CLASS,NAME,K)

Input
 A Dataset
 CLASS Integer: Indices of desired classes in CLASSNAMES(A) String array: Class names  Cell array: Indices of desired classes in CLASSNAMES(A) Default C = {}, i.e. return all classes separated out in a cell  array.
 NAME Integer: Index of desired labeling, see GETLABLISTNAMES String: Name of desired labeling, see GETLABLISTNAMES Default: actual LABLIST
 K Logical, TRUE: keep empty classes in dataset label list.
 FALSE: remove them (default).

Output
 B Desired classes of the dataset A. In case CLASS is a cell array, B is a cell array of the desired classes. In case CLASS is empty, B is a cell array of all classes.
 J Indices of returned objects in dataset A: B = A(J,:). In case CLASS is a cell array, J is a cell array as well.

Description

B is a subset of the dataset A defined by the set of classes (CLASS). In  case of a multi-labeling system (see MULTI_LABELING) the desired CLASS should refer to the label list NAME.

In case A is soft labeled or is a target dataset by B = SELCLASS(A,CLASS) the entire dataset is returned, but the labels or targets are reduced to  the selected class (target) CLASS.

In case CLASS is a cell array the outputs are organised as cell arrays.

Example(s)

 a = gendatm; b = selclass(a,[2 3 4]); % selects 3 classes
 a = gendatm; b = a*selclass;         % returns every class in a cell
 a = gendatb; 
 a = addlabels(a,genlab(25*ones(4,1)),'4class'); % add second label list
 b = a*selclass('4class'); % returns 4 cells, preserves label list.

See also

datasets, seldat, classnames, gendat, getlablist, getclassi, remclass, getlablistnames, multi_labeling,

PRTools Contents

PRTools User Guide

This file has been automatically generated. If badly readable, use the help-command in Matlab.