File: Example3.m

package info (click to toggle)
python-pycm 4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,952 kB
  • sloc: python: 5,029; sh: 8; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
close all

try
    python_version = pyversion;
    fprintf(2,'** Python Version : %s\n', python_version);
catch e
    fprintf(2,'** Error : %s\n', e.message);
end

% Import pycm lib
pycmlib = py.importlib.import_module('pycm');
% Input file
address = 'cm1.obj';
file = py.open(address,'r');
% ConfusionMatrix object
cm = pycmlib.ConfusionMatrix(pyargs('file', file));
% Matrix
disp(cm.matrix);
% Classes list
disp(cm.classes);
% Print matrix
cm.print_matrix()
% Print normalized matrix
cm.print_normalized_matrix();
% Print stat
cm.stat();