jcolibri.extensions.maintenance_evaluation.evaluators
Class MaintenanceNFoldEvaluator
java.lang.Object
jcolibri.evaluation.Evaluator
jcolibri.extensions.maintenance_evaluation.MaintenanceEvaluator
jcolibri.extensions.maintenance_evaluation.evaluators.MaintenanceNFoldEvaluator
public class MaintenanceNFoldEvaluator
- extends MaintenanceEvaluator
This evaluation divides the case base into several random folds
(indicated by the user).
For each fold, their cases are used as queries and the remaining folds are
used together as case base. Maintenance is performed on the case-base before
running the queries.
This process is performed several times.
- Author:
- Lisa Cummins., Juan A. Recio García - GAIA http://gaia.fdi.ucm.es
Method Summary |
protected java.util.ArrayList<java.util.ArrayList<CBRCase>> |
createFolds(java.util.Collection<CBRCase> cases,
int numFolds)
Divides the given cases into the given number of folds. |
static void |
getFolds(int f,
java.util.List<CBRCase> querySet,
java.util.List<CBRCase> caseBaseSet,
java.util.ArrayList<java.util.ArrayList<CBRCase>> folds)
Clears the current query and case base sets and populates the query set with fold
f and the case base set with the cases not contained in fold f. |
void |
NFoldEvaluation(int numFolds,
int repetitions)
Executes the N-Fold evaluation. |
protected void |
prepareCases(java.util.Collection<CBRCase> originalCases,
java.util.List<CBRCase> querySet,
int fold,
CBRCaseBase caseBase,
java.util.ArrayList<java.util.ArrayList<CBRCase>> folds)
Prepares the cases for evaluation by setting up test and training sets |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MaintenanceNFoldEvaluator
public MaintenanceNFoldEvaluator()
NFoldEvaluation
public void NFoldEvaluation(int numFolds,
int repetitions)
- Executes the N-Fold evaluation.
- Parameters:
numFolds
- the number of randomly generated folds.repetitions
- the number of repetitions
prepareCases
protected void prepareCases(java.util.Collection<CBRCase> originalCases,
java.util.List<CBRCase> querySet,
int fold,
CBRCaseBase caseBase,
java.util.ArrayList<java.util.ArrayList<CBRCase>> folds)
- Prepares the cases for evaluation by setting up test and training sets
- Parameters:
originalCases
- Complete original set of casesquerySet
- Where queries are to be storedfold
- The fold numbercaseBase
- The case base
createFolds
protected java.util.ArrayList<java.util.ArrayList<CBRCase>> createFolds(java.util.Collection<CBRCase> cases,
int numFolds)
- Divides the given cases into the given number of folds.
- Parameters:
cases
- the original cases.numFolds
- the number of folds.
getFolds
public static void getFolds(int f,
java.util.List<CBRCase> querySet,
java.util.List<CBRCase> caseBaseSet,
java.util.ArrayList<java.util.ArrayList<CBRCase>> folds)
- Clears the current query and case base sets and populates the query set with fold
f and the case base set with the cases not contained in fold f.
- Parameters:
f
- the fold to use.querySet
- the set of queries.caseBaseSet
- the set of cases.