Talk:Statistics package: Difference between revisions

Jump to navigation Jump to search
reply to patch
(confusionmat)
 
(reply to patch)
Line 1: Line 1:
== confusionmat ==
Hi, here you have my implementation of the confusionmat function.
Hi, here you have my implementation of the confusionmat function.
I hope it helps someone
I hope it helps someone


function [ret] = confusionmat(v1, v2)
  function [ret] = confusionmat(v1, v2)
  values = union(unique(v1), unique(v2));
    values = union(unique(v1), unique(v2));
  ret = zeros(size(values), size(values));
    ret = zeros(size(values), size(values));
  for i = 1:size(v1)
    for i = 1:size(v1)
      i1 = find(values == v1(i));
        i1 = find(values == v1(i));
      i2 = find(values == v2(i));
        i2 = find(values == v2(i));
      ret(i1, i2) = ret(i1, i2) + 1;
        ret(i1, i2) = ret(i1, i2) + 1;
  end
    end
endfunction
  endfunction
 
: Hi! Thank you for the patch but we don't really use the Octave wiki as discussion forum and almost no one is following this. You really should be submitting this on Octave's [https://savannah.gnu.org/patch/?func=additem&group=octave patch tracker].
: --[[User:Carandraug|carandraug]] ([[User talk:Carandraug|talk]]) 03:29, 14 November 2014 (PST)

Navigation menu