jcolibri.method.reuse.classification
Class MajorityVotingMethod

java.lang.Object
  extended by jcolibri.method.reuse.classification.AbstractKNNClassificationMethod
      extended by jcolibri.method.reuse.classification.MajorityVotingMethod
All Implemented Interfaces:
KNNClassificationMethod

public class MajorityVotingMethod
extends AbstractKNNClassificationMethod

Provides the ability to classify a query by predicting its solution from supplied cases. Classification is done by majority voting, so the predicted class is the one that has the highest number of votes.

Author:
Derek Bridge, Lisa Cummins 16/05/07

Constructor Summary
MajorityVotingMethod()
           
 
Method Summary
 ClassificationSolution getPredictedSolution(java.util.Collection<RetrievalResult> cases)
          Predicts the class that has the highest number of votes among the k most similar cases.
 
Methods inherited from class jcolibri.method.reuse.classification.AbstractKNNClassificationMethod
getPredictedCase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MajorityVotingMethod

public MajorityVotingMethod()
Method Detail

getPredictedSolution

public ClassificationSolution getPredictedSolution(java.util.Collection<RetrievalResult> cases)
Predicts the class that has the highest number of votes among the k most similar cases. If several classes receive the same highest vote, the class that has the lowest hash code is taken as the prediction.

Specified by:
getPredictedSolution in interface KNNClassificationMethod
Specified by:
getPredictedSolution in class AbstractKNNClassificationMethod
Parameters:
cases - an ordered list of cases along with similarity scores.
Returns:
Returns the predicted solution.

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es