Browse Source

s7 add yynn_count

master
sipp11 10 years ago
parent
commit
4b1394b5b6
  1. 5
      s1.py
  2. 5
      s2.py
  3. 6
      s3.py
  4. 4
      s4.py
  5. 4
      s5.py
  6. 4
      s6.py
  7. 16
      s7.py
  8. 4
      s8.py

5
s1.py

@ -1,5 +1,8 @@
# -*- coding:utf-8 -*-
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 1
'''
from __future__ import print_function
from base import Lo, RAW_DIR, TARGET_DIR
import os

5
s2.py

@ -1,5 +1,8 @@
# -*- coding:utf-8 -*-
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 2
'''
from __future__ import print_function
from base import Lo, create_csv, TARGET_DIR
import os

6
s3.py

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
WTH
Step 3
'''
# -*- coding:utf-8 -*-
#!/usr/bin/env python
from __future__ import print_function
from base import Lo, create_csv, TARGET_DIR
import os

4
s4.py

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 4
'''
# -*- coding:utf-8 -*-
#!/usr/bin/env python
from __future__ import print_function
from base import Lo, create_csv, TARGET_DIR
import os

4
s5.py

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 5
'''
# -*- coding:utf-8 -*-
#!/usr/bin/env python
from __future__ import print_function
from base import create_csv, TARGET_DIR, MODEL_LIST
import os

4
s6.py

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 6
'''
# -*- coding:utf-8 -*-
#!/usr/bin/env python
from __future__ import print_function
from base import create_csv, TARGET_DIR, MODEL_LIST
import os

16
s7.py

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 7
'''
#!/usr/bin/env python
from __future__ import print_function
from base import create_csv, TARGET_DIR, MODEL_LIST
import os
@ -17,12 +17,21 @@ No of R ของคณ ======= TOTAL -- ถาตองการท
แต ผมไมบรองวาจะใชไดงหมดเพราะว นกนกบหลายอยาง
เช 1Ts ไมนอาจจะ error ? โดยเฉพาะเวลา random
'''
NOT_ARG = '2Ts'
NOT_ARG = '3Ts'
TOTAL = 20
SRC_PATH = os.path.join(TARGET_DIR, 'part6')
def get_yynn_count(cols):
n = 0
for c in cols:
if c in ('Y', 'Y*', 'N', 'N*'):
n += 1
elif c in ('Y/N', 'Y/N*'):
n += 2
return n
def get_by_order():
for m in MODEL_LIST:
result = []
@ -38,6 +47,7 @@ def get_by_order():
r[2], # No of Tree
m, # model
] + r[7:]
row.append(get_yynn_count(r[7:])) # ??????????
result.append(row)
count += 1
if count >= TOTAL and TOTAL > 0:
@ -60,6 +70,7 @@ def get_by_random():
r[2], # No of Tree
m, # model
] + r[7:]
l.append(get_yynn_count(r[7:])) # ??????????
lo_list.append(l)
picked = []
@ -111,6 +122,7 @@ def get_by_group(model_name, step, **kwargs):
_r[i] = '%s*' % calibrator[i]
else: # one Y one N
_r[i] = 'Y/N*'
_r.append(get_yynn_count(r[7:])) # ??????????
result.append(_r)
calibrator = _r[:]

4
s8.py

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Step 7
Step 8
'''
#!/usr/bin/env python
from __future__ import print_function
from base import create_csv, TARGET_DIR, MODEL_LIST, RAW_DIR
import os

Loading…
Cancel
Save