damianos melidis
unread,Feb 1, 2017, 1:00:49 PM2/1/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MOA users
Dear all,
Currently, I want to perform prequential evluation, for each incoming instance firstly test and then learn, but using the MOA api instead of the command line or GUI.
Until now I do the following pseudocode:
windowSize = 10;
//inside the prequential evaluation
evaluator = new WindowClassificationPerformanceEvaluator();
evaluator.widthOption(windowSize)
firstTimeSlidingWindow = true;
while(trainingSet.hasMoreInstances){
trainingInsance = getTrainingInstance
//test the model using current instance
trainingInstanceExample = //create a training instance example from the training instance
votes = selectedClassifier.getVotesForInstance(trainingInstance);
evaluator.addResult(trainingInstanceExample)
-> if ((firstTimeSlidingWindow && windowCount == 0) || (!firstTimeSlidingWindow && windowCount == 1)){
firstTimeSlidingWindow = false
accuracy = evaluator.getFractionCorrectlyClassified()
windowCount = windowSize
-> //evaluator.reset()
}
//train the model on the current instance
windowCount--
}
Now, I am not sure for the lines with "->" that is,
for the first -> using this condition I get the correct number of statistics, accuracy, for the sliding windows (tested with a sample of 5 instances and window size of 2)
but the alternative simpler if (windowCount == 0){..} does not give me the correct number of statistics for the previous small test of sliding window (5 instances, window size 2).
Which of the two conditions is the correct?
For the second -> when the window size is reached do I need to reset my evaluation? I guess not as the sliding window always resets the head of the window and add the instance next to its' tail. But am I correct?
Lastly, a fundamental question (to understand) if I have set the window size of evaluation to X and I ask for the accuracy (inside the if with "->") at an instance number Y < X, is the resulted accuracy of any validity?
Grateful for your time and suggestions!
Many thanks,
Damianos