jcolibri.evaluation.evaluators
Class SameSplitEvaluator

java.lang.Object
  extended by jcolibri.evaluation.Evaluator
      extended by jcolibri.evaluation.evaluators.SameSplitEvaluator

public class SameSplitEvaluator
extends Evaluator

This method splits the case base in two sets: one used for testing where each case is used as query, and another that acts as normal case base.
This method is different of the other evaluators beacuse the split is stored in a file that can be used in following evaluations. This way, the same set is used as queries for each evaluation.
The generateSplit() method does the initial random split and saves the query set in a file. Later, the HoldOutfromFile() method uses that file to load the queries set and perform the evaluation.

Version:
2.0
Author:
Juan A. Recio García & Lisa Cummins

Field Summary
protected  StandardCBRApplication app
           
 
Fields inherited from class jcolibri.evaluation.Evaluator
report
 
Constructor Summary
SameSplitEvaluator()
           
 
Method Summary
 void generateSplit(int testPercent, java.lang.String filename)
           
 void HoldOutfromFile(java.lang.String file)
           
 void init(StandardCBRApplication cbrApp)
          Initializes the evaluator with the CBR application to evaluate
protected  void save(java.util.Collection<CBRCase> queries, java.lang.String filename)
           
protected  void splitCaseBase(java.util.Collection<CBRCase> wholeCaseBase, java.util.List<CBRCase> querySet, java.util.List<CBRCase> casebaseSet, int testPercent)
          Splits the case base in two sets: queries and case base
protected  void splitCaseBaseFromFile(java.util.Collection<CBRCase> wholeCaseBase, java.util.List<CBRCase> querySet, java.util.List<CBRCase> casebaseSet, java.lang.String filename)
           
 
Methods inherited from class jcolibri.evaluation.Evaluator
getEvaluationReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

app

protected StandardCBRApplication app
Constructor Detail

SameSplitEvaluator

public SameSplitEvaluator()
Method Detail

init

public void init(StandardCBRApplication cbrApp)
Description copied from class: Evaluator
Initializes the evaluator with the CBR application to evaluate

Specified by:
init in class Evaluator
See Also:
StandardCBRApplication

generateSplit

public void generateSplit(int testPercent,
                          java.lang.String filename)

save

protected void save(java.util.Collection<CBRCase> queries,
                    java.lang.String filename)

HoldOutfromFile

public void HoldOutfromFile(java.lang.String file)

splitCaseBase

protected void splitCaseBase(java.util.Collection<CBRCase> wholeCaseBase,
                             java.util.List<CBRCase> querySet,
                             java.util.List<CBRCase> casebaseSet,
                             int testPercent)
Splits the case base in two sets: queries and case base

Parameters:
wholeCaseBase - Complete original case base
querySet - Output param where queries are stored
casebaseSet - Output param where case base is stored
testPercent - Percentage of cases used as queries

splitCaseBaseFromFile

protected void splitCaseBaseFromFile(java.util.Collection<CBRCase> wholeCaseBase,
                                     java.util.List<CBRCase> querySet,
                                     java.util.List<CBRCase> casebaseSet,
                                     java.lang.String filename)

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