Opened 17 years ago

Closed 17 years ago

#104 closed request (fixed)

Why state_ in Sampler and SubsetGenerator?

Reported by: Peter Owned by: Markus Ringnér
Priority: minor Milestone: yat 0.2
Component: classifier Version:
Keywords: Cc:

Description (last modified by Markus Ringnér)

Is it only for historical reasons there was a state in CrossSplitter? (now splitted into Sampler and SubsetGenerator?)? Instead of "next", "more" and "reset", wouldn't it be easier to just all member vectors as const references and users can use operator[] to get what they want.

Change History (9)

comment:1 Changed 17 years ago by Markus Ringnér

Description: modified (diff)

comment:2 Changed 17 years ago by Markus Ringnér

Description: modified (diff)

comment:3 Changed 17 years ago by Markus Ringnér

Description: modified (diff)

Markus thinks: Sampler should have no state but I do not like getting entire vectors (mostly vectors of vectors) out. Instead I have now removed the state but changed the Sampler interface so the access functions take an index as argument. For SubSetGenerator? I think state may be useful.

comment:4 Changed 17 years ago by Peter

It is a bit strange though to have a container with a state. First, it implies a SubsetGenerator? object is not supposed to be shared because that would introduce very long correlations. Second, looking in our dear std containers are clearly separated from iterators, and the latter keep the state functionality. Third, the argument that the state is needed to avoid another parameter in SupervisedClassifier::make_class interface in no longer really valid. When the introduction of MatrixLookupWeighted? is completed make_class could take a DataLookup2D& instead (see #106) solving that issue

comment:5 Changed 17 years ago by Peter

Type: defectidea

comment:6 Changed 17 years ago by Markus Ringnér

I agree make_classifier should take a DataLookup2D. One reason to have a state is that SubsetGenerator? has tons of functions that typically are called close to one another and otherwise would take an index. Using a state would perhas minimize index errors. Is this a useful argument? Otherwise make it statless!

comment:7 Changed 17 years ago by Jari Häkkinen

Type: idearequest

Removing type "idea" and changing this to a "request".

comment:8 Changed 17 years ago by Markus Ringnér

Owner: changed from Peter to Markus Ringnér
Status: newassigned

comment:9 Changed 17 years ago by Markus Ringnér

Resolution: fixed
Status: assignedclosed

(In [704]) Fixes #104. Also fixed inline bug in Averager.h

Note: See TracTickets for help on using tickets.