blob: 11a1e1b9694532d432a2c8ee50624cc7748ef3b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/usr/bin/env ruby
require 'csv'
tp = 0
fp = 0
tn = 0
fn = 0
rows = CSV.read(ARGV[0],headers: true,:col_sep => ";")
rows.each do |row|
a = row.to_h["Actual Outcome"].to_i
p = row.to_h["Predicted Outcome"].to_i
tp += 1 if a == 1 and p == 1
tn += 1 if a == 0 and p == 0
fp += 1 if a == 0 and p == 1
fn += 1 if a == 1 and p == 0
end
puts "#{tp},#{fp}\n#{fn},#{tn}"
|