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