|
From: james w. <jbu...@ya...> - 2015-05-06 11:15:54
|
Thanks Eibe,
I understood your example:kernelMatrix.matrix:3 3
1 0.5 0.2
0.5 1 0.5
0.2 0.5 1
train.arff:
@relation docs
@attribute identifier {row1, row2, row3}
@attribute class {a, b, c}
@data
row1, a
row2, b
row3, c
But here, we are ignoring the attributes d1, d2, d3. Assume we have the training and test sets:
train.arff:@RELATION docs
@ATTRIBUTE d1 NUMERIC
@ATTRIBUTE d2 NUMERIC
@ATTRIBUTE d3 NUMERIC
@ATTRIBUTE class {a,b,c}
@DATA
0.1,0.5,0.4,a
0.9,0.1,0.4,b
0.7,0.2,0.3,c
test.arff:@RELATION docs
@ATTRIBUTE d1 NUMERIC
@ATTRIBUTE d2 NUMERIC
@ATTRIBUTE d3 NUMERIC
@ATTRIBUTE class {a,b,c}
@DATA
0.6,2.2,1.4,?
0.2,0.8,0.3,?
0.1,0.1,0.2,?
AND a precomputed matrix of similarities for training:kernelMatrix.matrix:3 3
1 0.5 0.2
0.5 1 0.5
0.2 0.5 1
How can we handle this situation? I have run this example in weka using the precomputed kernel and the arff file with all the attributes in it and it still gives back some results. Could someone explain what is happening here? Here are the results:
=== Run information ===
Scheme: weka.classifiers.meta.FilteredClassifier -F "weka.filters.unsupervised.attribute.NumericToNominal -R first-last" -W weka.classifiers.functions.SMO -- -C 1.0 -L 0.001 -P 1.0E-12 -N 0 -V -1 -W 1 -K "weka.classifiers.functions.supportVector.PrecomputedKernelMatrixKernel -M /home/james/ML_PROJ_DIR/main/Tests/May5_Tests/smallTest/kernelMatrix.matrix"Relation: docs-weka.filters.unsupervised.attribute.ClassAssigner-ClastInstances: 3Attributes: 4 d1 d2 d3 classTest mode: evaluate on training data
=== Classifier model (full training set) ===
FilteredClassifier using weka.classifiers.functions.SMO -C 1.0 -L 0.001 -P 1.0E-12 -N 0 -V -1 -W 1 -K "weka.classifiers.functions.supportVector.PrecomputedKernelMatrixKernel -M /home/james/ML_PROJ_DIR/main/Tests/May5_Tests/smallTest/kernelMatrix.matrix" on data filtered through weka.filters.unsupervised.attribute.NumericToNominal -R first-last
Filtered Header(a)relation docs-weka.filters.unsupervised.attribute.ClassAssigner-Clast-weka.filters.unsupervised.attribute.NumericToNominal-Rfirst-last
@attribute d1 {0.1,0.7,0.9}@attribute d2 {0.1,0.2,0.5}@attribute d3 {0.3,0.4}@attribute class {a,b,c}
@data
Classifier ModelSMO
Kernel used: Using kernel matrix from file with name: /home/Tests/smallTest/kernelMatrix.matrix
Classifier for classes: a, b
BinarySMO
- 1 * <0.1 0.5 0.4 > * X] + 1 * <0.9 0.1 0.4 > * X] + 0
Number of support vectors: 2
Number of kernel evaluations: 0
Classifier for classes: a, c
BinarySMO
1 * <0.7 0.2 0.3 > * X] - 1 * <0.1 0.5 0.4 > * X] + 0
Number of support vectors: 2
Number of kernel evaluations: 0
Classifier for classes: b, c
BinarySMO
1 * <0.7 0.2 0.3 > * X] - 1 * <0.9 0.1 0.4 > * X] + 0
Number of support vectors: 2
Number of kernel evaluations: 0
Time taken to build model: 0.02 seconds
=== Evaluation on training set ===
Time taken to test model on training data: 0 seconds
=== Summary ===
Correctly Classified Instances 3 100 %Incorrectly Classified Instances 0 0 %Kappa statistic 1 Mean absolute error 0.2222Root mean squared error 0.2722Relative absolute error 50 %Root relative squared error 57.735 %Coverage of cases (0.95 level) 100 %Mean rel. region size (0.95 level) 66.6667 %Total Number of Instances 3
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class 1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000 a 1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000 b 1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000 cWeighted Avg. 1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000
=== Confusion Matrix ===
a b c <-- classified as 1 0 0 | a = a 0 1 0 | b = b 0 0 1 | c = c
On Wednesday, May 6, 2015 10:15 AM, Eibe Frank <eibe(a)waikato.ac.nz> wrote:
I just tried my old example from here:
http://weka.8497.n7.nabble.com/PrecomputedKernelMatrixKernel-tp26538p26545.html
It works fine with the current snapshot of WEKA 3.7.
Cheers,
Eibe
> On 1 May 2015, at 07:03, james wafula <jbukossia(a)yahoo.com> wrote:
>
> Hi all,
>
> I am very new to Weka. I have played around with using pre-computed kernel matrix and all was well until recently. Now I get the following error:
>
> Problem reading matrix from kernelMatrix.matrix
>
> What could be the problem? I have neither altered the kernel matrix nor the arff file at all.
>
> Best regards,
>
> James.
>
>
>
>
> On Thursday, April 30, 2015 6:57 PM, jason roger <jasonroger8(a)gmail.com> wrote:
>
>
> Dear Weka user,
>
> Anybody knows how Weka able to select "wordsToKeep" parameter of StringToWordVector filer?
>
> Thanks a lot.
>
> Jason
>
>
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: Wekalist(a)list.waikato.ac.nz
> List info and subscription status: http://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: Wekalist(a)list.waikato.ac.nz
> List info and subscription status: http://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
_______________________________________________
Wekalist mailing list
Send posts to: Wekalist(a)list.waikato.ac.nz
List info and subscription status: http://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
|