Opened 14 years ago

Closed 14 years ago

#238 closed defect (invalid)

clone function in DataLookup2D returning pointer to new DataLookup2D based on subset of features

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.4
Component: classifier Version: trunk
Keywords: Cc:

Description

This is needed for ticket:236 (see discussion there)

virtual const DataLookup2D* *some good name*(const std::vector<size_t>& features) const=0;

The returned DataLookup2D is dynamically located and the caller owns the object. It should be pretty clear how these should be implemented.

What should the name of function be???

In KernelLookup? it is already implemented as a function selected. If we decide for a different name, will we then remove the function kernel? That implies breaking contract and stuff, but we are still in 0.x which could be save.

Change History (4)

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

If kernel selected is used by us in (more than a few) places the we should stick to that name. Otherwise my vote goes for the name select_features.

comment:2 Changed 14 years ago by Peter

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

grep selected *.cc in /yat/classifier/ results in

Kernel.cc:              data_ = other.data_->selected(index);
Kernel.cc:                      data_w_ = other.data_w_->selected(index);
KernelLookup.cc:        KernelLookup::selected(const std::vector<size_t>& inputs) const
KernelLookup.cc:                        // matrix with selected features
MatrixLookup.cc:        MatrixLookup::selected(const std::vector<size_t>& i) const
MatrixLookupWeighted.cc:        MatrixLookupWeighted::selected(const std::vector<size_t>& i) const
SubsetGenerator.cc:                                             const KernelLookup* kl = kernel->selected(features_.back());

That is not more than a few places, I would say. It is a surpise that is pops up in MatrixLookup? and MatrixLookupWeighted?.

I'll fix this and change name to selected_features.

comment:3 Changed 14 years ago by Peter

ooh you suggested select_features that is even better.

comment:4 Changed 14 years ago by Peter

Resolution: invalid
Status: assignedclosed

Functionality, already exists. I don't change name of the function.

Note: See TracTickets for help on using tickets.