PRTools Contents

PRTools User Guide

misval

MISVAL

Fixed mapping handling the missing values in a dataset

     B = MISVAL(A,VAL,K)
     B = A*MISVAL([],VAL,K)
     B = A*MISVAL(VAL,K)
     N = A*MISVAL([],K)

Input
 A Dataset, containing NaNs (missing values).
 VAL String with substitution option or value used for substitution.  By default all objects with missing values are removed.
 K Vector with indices of features that should be handled.  Default: all

Output
 B Dataset with NaNs substituted
 N Vector with number of missing values per feature

Description

The following values for VAL are possible
'remove' remove objects (rows) that contain missing values (default)  'f-remove' remove features (columns) that contain missing values  'mean' fill the entries with the mean of the features  'c-mean' fill the entries with the class mean of the features  'median' fill the entries with the median of the features  'c-median' fill the entries with the class median of the features  'majority' fill the entries with the majority of the features  'c-majority' fill the entries with the class majority of the features  fill the entries with a fixed constant  NaN no change: return dataset as it is

Note that replacing missing values by feature means (medians or  majorities) is a very simple solution that might be far from optimal.

See also

datasets, feattypes, ismisval,

PRTools Contents

PRTools User Guide

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