summaryrefslogtreecommitdiff
path: root/scripts/confusion-matrix.rb
blob: c40ee2f1f8d1bd15684de50fb8473c8f03147384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby
require 'csv'

tp = 0
fp = 0
tn = 0
fn = 0
File.readlines(ARGV[0]).each do |line|
  pred = line.chomp.split(",").last
  case pred
  when "TP"
    tp+=1
  when "TN"
    tn+=1
  when "FP"
    fp+=1
  when "FN"
    fn+=1
  end
end
puts "#{tp},#{fp}\n#{fn},#{tn}"