yzontov / pls-da

Implementation of the Hard and Soft PLS-DA for MATLAB
BSD 2-Clause "Simplified" License
14 stars 3 forks source link

Consider using categorical variables #60

Open svkucheryavski opened 4 years ago

svkucheryavski commented 4 years ago

In 2013b MATLAB introduced categorical variables, which fits perfect the classification need. So instead of keeping separately class numbers and corresponding labels, one can combine them together in a categorical variable. Perhaps can be a good idea to consider using categorical variable to keep class belongings inside the toolbox. For user input it can look as follows:

  1. Check if user already provided categorical variable for classes. If yes - use it as is
  2. If provided class variable is numeric - convert it to categorical (if labels provided - use them as well)
  3. If provided class variable is cell array with class names - convert it to categorical variable

It is not an urgent issue, can be implemented in one of later releases if you agree. The only cons I see here is that older MATLAB versions (< 2013) do not support it.

yzontov commented 4 years ago

Accepted for future releases.