jcolibri.evaluation.evaluators
Class SameSplitEvaluator
java.lang.Object
jcolibri.evaluation.Evaluator
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
app
protected StandardCBRApplication app
SameSplitEvaluator
public SameSplitEvaluator()
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 basequerySet
- Output param where queries are storedcasebaseSet
- Output param where case base is storedtestPercent
- 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)