testGPHIKRawClassifier.m 1016 B

12345678910111213141516171819202122232425262728293031323334353637
  1. % brief: Demo-program showing how to use the GPHIKRaw Interface (without a class wrapper)
  2. % author: Alexander Freytag
  3. % date: 21-09-2015 (dd-mm-yyyy)
  4. myData = [ 0.2 0.3 0.5;
  5. 0.3 0.2 0.5;
  6. 0.9 0.0 0.1;
  7. 0.8 0.1 0.1;
  8. 0.1 0.1 0.8;
  9. 0.1 0.0 0.9
  10. ];
  11. myLabels = [1,1,2,2,3,3];
  12. % init new GPHIKRawClassifier object
  13. myGPHIKRawClassifier = GPHIKRawClassifierMex ( ...
  14. 'new', ...
  15. 'verbose', 'false' ...
  16. );
  17. % run train method
  18. GPHIKRawClassifierMex ( 'train', myGPHIKRawClassifier, myData, myLabels);
  19. myDataTest = [ 0.3 0.4 0.3
  20. ];
  21. myLabelsTest = [1];
  22. % run single classification call
  23. [ classNoEst, score ] = GPHIKRawClassifierMex ( 'classify', myGPHIKRawClassifier, myDataTest )
  24. % run test call which classifies entire data set
  25. [ arr, confMat, scores] = GPHIKRawClassifierMex ( 'test', myGPHIKRawClassifier, myDataTest, myLabelsTest )
  26. % clean up and delete object
  27. GPHIKRawClassifierMex ( 'delete',myGPHIKRawClassifier);