com.sun.labs.minion.classification
Class Rocchio.HE

java.lang.Object
  extended by com.sun.labs.minion.classification.Rocchio.HE
All Implemented Interfaces:
java.lang.Comparable<Rocchio.HE>
Enclosing class:
Rocchio

protected class Rocchio.HE
extends java.lang.Object
implements java.lang.Comparable<Rocchio.HE>

A class to hold a single element of the heap that we'll use to negotiate the results of queries.


Field Summary
 BigQuery bq
           
 FeatureClusterSet fcs
           
 ArrayGroup.DocIterator iter
           
 float[] neg
           
 float[] pos
           
 WeightingComponents wc
           
 WeightingFunction wf
           
 
Constructor Summary
Rocchio.HE(FeatureClusterSet fcs, BigQuery bq)
          Creates an element for the heap for a given array group.
 
Method Summary
 int compareTo(Rocchio.HE o)
          Our comparison will be based on the iterators, but we'll return the opposite of their result, since we want to be used in a max heap.
 void finish()
          Finishes off any remaining training documents.
 boolean handleCurr()
          Handles the document at the head of the iterator.
 boolean next()
          Advances our iterator, returning true if there is a next element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bq

public BigQuery bq

fcs

public FeatureClusterSet fcs

wf

public WeightingFunction wf

wc

public WeightingComponents wc

iter

public ArrayGroup.DocIterator iter

pos

public float[] pos

neg

public float[] neg
Constructor Detail

Rocchio.HE

public Rocchio.HE(FeatureClusterSet fcs,
                  BigQuery bq)
Creates an element for the heap for a given array group.

Parameters:
bq - the query for which we're building centroids
Method Detail

next

public boolean next()
Advances our iterator, returning true if there is a next element.


handleCurr

public boolean handleCurr()
Handles the document at the head of the iterator.

Returns:
true if the document was in the training set, false otherwise

finish

public void finish()
Finishes off any remaining training documents.


compareTo

public int compareTo(Rocchio.HE o)
Our comparison will be based on the iterators, but we'll return the opposite of their result, since we want to be used in a max heap.

Specified by:
compareTo in interface java.lang.Comparable<Rocchio.HE>