|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.util.ObservableEventSourceImpl<ObservableProgressData>
org.android.activityminer.logic.evaluation.EvaluationHelper
public class EvaluationHelper
A class to delegate evaluation processing to.
Field Summary | |
---|---|
private boolean |
bestResultsOnly
The flag if only the best results shall be returned. |
private Configuration |
config
The current configuration. |
private Context |
context
The context. |
private DBManager |
dbManager
A reference to the database manager. |
private EvaluationResultCollection |
evaluationResults
The evaluation results. |
private List<Set<FeatureTypes>> |
featureSetsToTest
The feature sets to test. |
private String |
lastError
The last error |
private android.support.v4.util.LongSparseArray<List<Long>> |
mapSelectedClassId2SampleIds
A map to store sample (feature vector) identifiers for the selected lass identifiers |
private double |
maxPredictionTime
The maximum prediction time for a sample. |
private double |
minPredictionTime
The minimum prediction time for a sample. |
private int |
progress
The current progress. |
private ObservableProgressData |
progressData
The observable progress data |
private int |
sampleCount
The total sample count. |
private boolean |
succeeded
The success state flag |
private double |
sumOfAvgPredictionTime
The sum of average prediction time for a sample. |
private double |
sumOfAvgTrainingTime
The sum of average training time for a sample. |
private double |
threshold
The accuracy threshold in percent (0%-100%). |
private List<TrainingActivity> |
trainingActivites
The training activities for evaluation. |
private ValidationStrategy |
validationStrategy
The validation strategy. |
Constructor Summary | |
---|---|
EvaluationHelper(DBManager dbManager,
Set<Set<FeatureTypes>> featureSetsToTest,
Configuration config,
boolean bestResultsOnly,
Context context)
Constructor |
Method Summary | |
---|---|
long |
doEvaluate()
Does run the evaluation for all feature sets |
void |
evaluate(Set<FeatureTypes> selectedFeatures,
Classifier classifier)
Evaluation for a single feature set. |
EvaluationResultCollection |
getEvaluationResults()
Getter for the evaluation results |
String |
getLastError()
Getter for the last error |
int |
getMaxProgress()
Getter for the maximum progress |
private static List<Set<FeatureTypes>> |
getSetsSortedBySize(Set<Set<FeatureTypes>> featureSets)
Does sort the feature sets for evaluation by size. |
String |
getStartProgressMessage()
Getter for the start progress message |
double |
getThreshold()
Getter for the accuracy threshold |
boolean |
hasSucceeded()
Getter for the success flag |
boolean |
isBestResultsOnly()
Getter for the flag for selection of best results |
void |
loadSamplesAndCreatePartioning()
Does load available samples as feature vectors from DB and creates the partitioning for k-fold cross validation. |
boolean |
saveResultsToFile(String fileName)
Method to store evaluation result to file. |
void |
updateProgress(String msg)
Does publish the current progress with the given message. |
Methods inherited from class de.unikassel.android.sdcframework.util.ObservableEventSourceImpl |
---|
getObservers, hasObservers, notify, onObserverRegistration, onObserverUnregistration, registerEventObserver, removeAllObservers, unregisterEventObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final DBManager dbManager
private Configuration config
private final List<Set<FeatureTypes>> featureSetsToTest
private int sampleCount
private final ValidationStrategy validationStrategy
private List<TrainingActivity> trainingActivites
private final EvaluationResultCollection evaluationResults
private double sumOfAvgTrainingTime
private double sumOfAvgPredictionTime
private double minPredictionTime
private double maxPredictionTime
private final ObservableProgressData progressData
private int progress
private boolean succeeded
private String lastError
private final android.support.v4.util.LongSparseArray<List<Long>> mapSelectedClassId2SampleIds
private Context context
private final boolean bestResultsOnly
private double threshold
Constructor Detail |
---|
public EvaluationHelper(DBManager dbManager, Set<Set<FeatureTypes>> featureSetsToTest, Configuration config, boolean bestResultsOnly, Context context)
dbManager
- a reference to the database managerfeatureSetsToTest
- the set with the feature sets to testconfig
- the current configurationbestResultsOnly
- flag to limit the result list to the best results (ranked by
overall prediction accuracy)context
- the contextMethod Detail |
---|
public double getThreshold()
public boolean isBestResultsOnly()
public final boolean hasSucceeded()
public final String getLastError()
private static final List<Set<FeatureTypes>> getSetsSortedBySize(Set<Set<FeatureTypes>> featureSets)
featureSets
- the set with the feature sets
public final int getMaxProgress()
public final EvaluationResultCollection getEvaluationResults()
public final long doEvaluate()
public final boolean saveResultsToFile(String fileName)
fileName
- the filename
public final void loadSamplesAndCreatePartioning() throws Exception
Exception
public final void evaluate(Set<FeatureTypes> selectedFeatures, Classifier classifier)
selectedFeatures
- the selected features for evaluationclassifier
- the classifier for evaluationpublic final void updateProgress(String msg)
msg
- the progress messagepublic String getStartProgressMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |