Brian Bykenhaal wrote:Okay I have I have changed my project so that each class other then main in under my game board package.
I would like to make my main in outside the game package where I have all my classes should this be any issue?
I have not been able get past these errors. I have 6 classes including my main.
run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol: variable EMPTY
location: class games.board.Mark
at games.board.Cell.<init>(Cell.java:10)
at games.board.Board.<init>(Board.java:10)
at BoardGameTester.main(BoardGameTester.java:13)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
Brian Bykenhaal wrote:
Mike Philips wrote:
Cheers Red, that went over my head a bit to be honest, probably a few thing's I need to get through first ;)
Mike Philips wrote:I have a do while loop that's just asking the user to input a number until the number 6 is input, at which point the user gets congratulated for entering the number 6...
however I'd like to make an if statement that changed the SystemOutput if an incorrect value was entered. If a letter is entered at the moment the program returns an error, so I was wondering how to make it so that if letters are entered instead of numbers the program will return something along the lines of asking the user to enter a number instead, and re prompting for a number...
I'm not sure where the If statement should live, inside the do code block or after it where the while part is?
Natasha Teokotai wrote:
// build classifier - do this once only for each classifier
fcs = new FilteredClassifier[models.length]; // Create a FilteredClassifier object
((OptionHandler)models[j]).setOptions(optionsArray[j]);
// Run for each classifier model
for(int j = 0; j < models.length; j++) {
61 fcs[j].buildClassifier(training);
comment should be "Create array to hold each FilteredClassifier"
fcs = new FilteredClassifier[models.length]; // Create a FilteredClassifier object
Natasha Teokotai wrote:
Absolutely correct![]()
I wish to retain seven filtered classifiers
We start with a base classifier such as KStar
We then apply filters, options etc.
And end up with a filtered classifier e.g. KStar_filtered
However, whilst I have the base classifier array initialized near the beginning of my overall program I do not have the same initialization array for the filtered classifier
And this is where I am stuck
I need something along the lines of
// create an array of Filtered Classifiers
FilteredClassifier [] fcs = new FilteredClassifier[] {
???
???
}
but what exactly do I put in between the {} ??
Natasha
Natasha Teokotai wrote:
Hi Red
Thank you so much for answering my query.........................
I have tried to separate out all code which should only be run once !
********************************************
// called once
Classifier[] models = createModels(optionsArray);
// called repeatedly and contains the part of your current logic that must be done each processing cycle, versus being created once and forgotten about
for (int j = 0; j < models.length; j ++) {
training.setClassIndex(classAttributeArray[j]);
testing.setClassIndex(classAttributeArray[j]);
fc.buildClassifier(training);
// test the model
Evaluation eval = new Evaluation(training);
eval.evaluateModel(fc, testing);
// print out results, etc.
}
process(models);
Classifier [] createModels(Options[] optionsArray)
{
// Choose a set of classifiers
Classifier[] models = new Classifier[]
{
new KStar(),
new J48(),
new JRip(),
new NaiveBayes(),
new LMT(),
new KStar(),
new LibSVM()
};
for(int j = 0; j < models.length; j++)
{
Remove filter new Remove();
filter.setAttributeIndicesArray(filtersArray[j]);
FilteredClassifier fc = new FilteredClassifier();
((OptionHandler)models[j]).setOptions(optionsArray[j]);
fc.setClassifier(models[j]);
fc.setFilter(filter);
}
return models;
}
*********************************************
Question: In the repeated over and over section there are two references to 'fc' (filtered classifier) which originates in the once-only section
How do I refer to the current 'filtered classifier' in the repeated over and over section ?
'fc' will not cut it !
Natasha
p.s. The data is the only thing that changes at each new time interval
As you suspect - the seven classifiers with their options, filters, etc. is static
The problem not to use a custom constructor or move "createEmail" inside of the class Email is that it's part of an external API. I should have mentioned it in my example, sorry.
Avor Nadal wrote:Red Smith: I guess that I should have clarified that, sorry. "createEmail" is a method of an utility class that has nothing to do with Email. It's only used to encapsulate code that is going to be used in many places of my application.
Natasha Teokotai wrote:
This I don't understand at all (and maybe I need to talk to the weka architects to find out what is going on?)
That is, unless you have any further suggestions ?
Natasha