Opened 12 years ago

Closed 12 years ago

#540 closed defect (fixed)

EnsembleBuilder::validate triggers assert when EB is built with one class having zero number of samples

Reported by: Peter Owned by: Peter
Priority: minor Milestone: yat 0.6
Component: classifier Version: trunk
Keywords: Cc:

Description

This is only a problem when yat is compiled without PP flag -DNDEBUG.

The same problem is likely in yat 0.5.x but I haven't tested that.

I built a EnsembleBuilder<SvmMultiClass, KernelLookup> with a target in which one class had zero samples. When predicting a sample, you get one output for each class in the training target and for the class that is empty NaN is returned. In EnsembleBuilder::validate, which caclualates a matrix of Averagers, this causes a call to Averager(NaN) which in turn triggers an assert in Averager.

The same would happen in EnsembleBuilder::predict.

The question is whether we want the NaN from propagating to the validation matrix, i.e., could we have block like:

if (!isnan(x))
  averagers[row][col].add(x)

If we instead want the NaN to propagate the question is whether we really should have that assertion in Averager. If the answer is yes, we have to circumvent the assertion in this case. Opinions?

Change History (2)

comment:1 Changed 12 years ago by Peter

Status: newassigned

comment:2 Changed 12 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [2008]) fixes #540 - removed assertion in Averager

Note: See TracTickets for help on using tickets.