The -p option (output predictions for test instances)
seems only available if I provide a test file.
I'd like to run Naive Bayes classifier on my data,
with default 10-fold validation. I would like to
obtain predictions for the test portion of the data
for each fold. Is this possible?
I had the same problem & I used to patch
just like Aldebaro. However, you will usually have to
do this for each new version and it gets boring after a
while. I talked with the WEKA development group and they
said that although it would be quite useful, Evaluation.java
has become too big and monolithical already - and there is
no clean way to put the cross-validation feature in (remember
that you will need the example indices as well, to be able to
tell the right example... although -p first-last may do as
well, now that I think of it), so until evaluation is made
more modular this will probably not happen.
What makes more sense is to write a small java program which
does the cross-validation, trains and evaluates the classifier
and outputs - not just the predictions, but the class probability
distribution as well (If we generate it, we might as well see it)
- ca. 20-30 lines of code. I can write something like this till the
evening (GMT+1)... I almost have something like this now (wrote it
for a colleague) & intend to post the code later, if it is ok with you.