jcolibri.method.maintenance
Class VotesCalculator

java.lang.Object
  extended by jcolibri.method.maintenance.VotesCalculator

public class VotesCalculator
extends java.lang.Object

Calculates coverage, reachability and liability sets

Author:
Lisa Cummins

Constructor Summary
VotesCalculator()
           
 
Method Summary
 java.util.LinkedList<CBRCase> getAllRetrievedCasesForQuery(java.util.Collection<CBRCase> cases, CBRCase query, KNNConfig simConfig)
          Gets all cases retrieved for the query in the context
 java.util.HashMap<CBRCase,java.util.LinkedList<CBRCase>> getAllRetrievedCasesForWholeCB(java.util.Collection<CBRCase> cases, KNNConfig simConfig)
          Gets all cases retrieved for each of the given cases
 java.util.LinkedList<CBRCase> getkRetrievedCasesForQuery(java.util.LinkedList<CBRCase> cases, CBRCase query, KNNConfig simConfig, int k)
          Gets the top k cases retrieved for each case in the context
 java.util.HashMap<CBRCase,java.util.LinkedList<CBRCase>> getkRetrievedCasesForWholeCB(java.util.Collection<CBRCase> cases, KNNConfig simConfig, int k)
          Gets the top k cases retrieved for each case in the context
 java.lang.String getPredictedClass(java.util.LinkedList<CBRCase> retrievedCases)
          Classifies the predicted class based on the given retrieved cases.
 java.util.HashMap<CBRCase,java.lang.String> getPredictedClasses(java.util.HashMap<CBRCase,java.util.LinkedList<CBRCase>> retrievedCases)
          Classifies the predicted classes of each of the cases based on the given retrieved cases for each cases
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VotesCalculator

public VotesCalculator()
Method Detail

getAllRetrievedCasesForWholeCB

public java.util.HashMap<CBRCase,java.util.LinkedList<CBRCase>> getAllRetrievedCasesForWholeCB(java.util.Collection<CBRCase> cases,
                                                                                               KNNConfig simConfig)
Gets all cases retrieved for each of the given cases


getAllRetrievedCasesForQuery

public java.util.LinkedList<CBRCase> getAllRetrievedCasesForQuery(java.util.Collection<CBRCase> cases,
                                                                  CBRCase query,
                                                                  KNNConfig simConfig)
Gets all cases retrieved for the query in the context


getkRetrievedCasesForWholeCB

public java.util.HashMap<CBRCase,java.util.LinkedList<CBRCase>> getkRetrievedCasesForWholeCB(java.util.Collection<CBRCase> cases,
                                                                                             KNNConfig simConfig,
                                                                                             int k)
Gets the top k cases retrieved for each case in the context


getkRetrievedCasesForQuery

public java.util.LinkedList<CBRCase> getkRetrievedCasesForQuery(java.util.LinkedList<CBRCase> cases,
                                                                CBRCase query,
                                                                KNNConfig simConfig,
                                                                int k)
Gets the top k cases retrieved for each case in the context


getPredictedClasses

public java.util.HashMap<CBRCase,java.lang.String> getPredictedClasses(java.util.HashMap<CBRCase,java.util.LinkedList<CBRCase>> retrievedCases)
Classifies the predicted classes of each of the cases based on the given retrieved cases for each cases

Parameters:
retrievedCases - the cases contributing to the prediction for each case
Returns:
the predicted classes of each of the cases

getPredictedClass

public java.lang.String getPredictedClass(java.util.LinkedList<CBRCase> retrievedCases)
Classifies the predicted class based on the given retrieved cases. The classification is performed using a simple count of the votes, the class with the most votes is the predicted class

Parameters:
retrievedCases - the cases contributing to the prediction
Returns:
the predicted class


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