covartech / PRT

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

Problem with targetNames with retainTargets() #59

Closed patrickkwang closed 7 years ago

patrickkwang commented 7 years ago
ds = prtDataSetClass('X',0,'Y',[0,0],'targetNames',{'first','second'});
ds1 = ds.retainTargets(1);
ds2 = ds.retainTargets(2);
ds1.targetNames
ds2.targetNames

retainTargets() seems to be doing the right thing, but prtDataSetInMem.getTargetNames() looks for a target name associated with index 1 and, not finding it, yields a default target name.

peterTorrione commented 7 years ago

Should be fixed in

https://github.com/covartech/PRT/commit/eb161c7c5bc64eb93fd4d3003cbb52d8faf19d58

ds = prtDataSetClass('X',0,'Y',[0,0],'targetNames',{'first','second'});
ds1 = ds.retainTargets(1);
ds2 = ds.retainTargets(2);
ds1.targetNames
ds2.targetNames

Should output:

ans =
  cell
    'first'
ans =
  cell
    'second'