package yi.iu.imgdb.learn.absrgn;



/**
 * select the promising bi-relationship of abstract regions
 */

public interface AbsRgnPromisingBiRelSelector {

  /**
   * Select those relationship that most promising.
   *
   * The procedure likes this: the regions are classified already, so each
   * image has several abstract regions (we don't care what's the attribute of
   * those regions, what we know is that they corresponding to some features).
   * Then the relationship of each pair of cluster types are considered.  For
   * example, image_i has n_i^j regions corresponding to abstract region cluster
   * c_j.  The overlapped regions formed by c_j1 and c_j2 clusters will be
   * calculated by the intersection of each region in r_i^j1 and each region in
   * r_i^j2.  Suppose there are J abstract region clusters, then there are
   * J*(J-1)/2 possible bi-relationships to select from.
   *
   * The passed in parameter "candidates" contains the possible overlapped
   * regions for all the image.  The first dimension is image index and the
   * second dimension is the overlapped region cluster index (0, .., J*(J-1)/2)
   *
   * The objective is to select the most promising overlapping (or other
   * bi-relationship) from those candidates.

   * @param candidates
   * @param positive
   * @return
   */
//  public double score(AbsRgnProbMapList candidates, boolean positive);

  public AbsRgnProbMap[][] select(AbsRgnProbMap[][]
                                            candidates,
                                            boolean[] pos_inst_flag, int n);


  /**
   * Tell whether the selector depends on the negative instances as positive
   * instances
   * @return
   */
//  public boolean dependsOnNegativeInstances();
  public double score(double[] probs, boolean[] pos_inst_flag);

}