PRTools Contents

PRTools User Guide

cat2real

CAT2REAL

Convert categorical features to real features by one-hot encoding

    B = CAT2REAL(A)
    B = A*CAT2REAL

Input
 A Dataset

Output
 B Dataset

Description

Categorical features with N > 2 categories are split in N real features,  one for each category. If the category is set for an object, the real  feature value gets a value sqrt(2)/2. The distance contribution for two  objects with different category values is thereby 1. Features with two  categories are transformed in binary (0/1) features, also contributing  with 1 to object distances for objects with a different feature value.

Missing values in categorical features of A will result in a NaN for all  corresponding features of B. They may be set by MISVAL.

See also

datasets, mappings, setfeatdom, cat2dset, cat2feat, misval,

PRTools Contents

PRTools User Guide

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