covartech / PRT

Pattern Recognition Toolbox for MATLAB
http://covartech.github.io/
MIT License
145 stars 70 forks source link

Proposal: add field to featureInfo or a field to prtDataSetStandard - isDiscrete #7

Open peterTorrione opened 12 years ago

peterTorrione commented 12 years ago

We often deal with discrete variables simply by pretending they don't exist.

But sometimes you want to do things slightly differently if things are discrete - e.g., histograms instead of ksdensities. Or even categorical (vs. discrete).

even ksdensity is OK., but even it often treats things you want to be continuous as discrete.

Couple of options:

1) Don't do anything

2) add isFeatureDiscrete to prtDataSetStandard; gets modified like everything else (defaults to "true"; no automatic inference, you gotta set it)

3) add field to .featureInfo, isDiscrete.

(1) is the way things have been. It's not that bad.

(2) takes a little more behind the scenes effort to make sure catFeatures, removeFeatures, etc. all work (even catObservations), but then is pretty much invisible unless you want to use it, (and it's easy to use - anything that subclasses prtDataSetStandard automatically gets it)

(3) takes more memory (we need an array of structs instead of an array of logicals), and is harder to enforce and query; but may be simpler in some cases.