Browse Source

Fixing `compare model` thing in part4

master
sipp11 11 years ago
parent
commit
d3f77a0f33
  1. 1
      base.py
  2. 7
      s4.py

1
base.py

@ -37,6 +37,7 @@ class Lo:
self.model[k][v].append(lo_id)
self.los[lo_id] = t.copy()
self.los[lo_id]['weight'] = r[35]
self.los[lo_id]['model'] = r[1]
def get(self, lo_id):
try:

7
s4.py

@ -45,10 +45,13 @@ def produce(match_all):
rows = []
weight = get_weight(ii)
for lo in sorted(los.los):
is_matched = 1 if lo in match_all[ii] else 0
is_matched = 1 if ii.lower() == los.los[lo]['model'].lower() else 0
r = [lo, is_matched, los.los[lo]['weight']]
if is_matched:
try:
r += weight[lo][1:]
except KeyError:
# print(ii, ' = ', is_matched, ' / ', lo)
pass
rows.append(r)
_f = '%s-step4.csv' % ii
create_csv(_f, rows, directory='part4')

Loading…
Cancel
Save