jcolibri.extensions.maintenance_evaluation.evaluators
Class MaintenanceNFoldEvaluator

java.lang.Object
  extended by jcolibri.evaluation.Evaluator
      extended by jcolibri.extensions.maintenance_evaluation.MaintenanceEvaluator
          extended by 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

Field Summary
 
Fields inherited from class jcolibri.extensions.maintenance_evaluation.MaintenanceEvaluator
app, editMethod, PERCENT_REDUCED, simConfig
 
Fields inherited from class jcolibri.evaluation.Evaluator
report
 
Constructor Summary
MaintenanceNFoldEvaluator()
           
 
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 jcolibri.extensions.maintenance_evaluation.MaintenanceEvaluator
editCaseBase, init, init, setEditMethod, setSimConfig
 
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
 

Constructor Detail

MaintenanceNFoldEvaluator

public MaintenanceNFoldEvaluator()
Method Detail

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 cases
querySet - Where queries are to be stored
fold - The fold number
caseBase - 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.

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