Esempio n. 1
0
def main(options):
    now = time_utils._timestamp_pretty()

    meta_conf = "level%d_feature_conf_meta_linear_%s" % (options.level, now)
    stacking_conf = "level%d_feature_conf_%s" % (options.level, now)
    feat_name = "level%d_meta_linear_%s" % (options.level, now)

    # get meta feature conf for `level` models
    cmd = "python get_feature_conf_linear_stacking.py -d %d -o %s.py" % (
        options.dim, meta_conf)
    os.system(cmd)

    # NOTE: using predictions from `level-1` models to generate features
    # for `level` models
    cmd = "python get_stacking_feature_conf.py -l %d -t %d -o %s.py" % (
        options.level - 1, options.top, stacking_conf)
    os.system(cmd)

    # generate feature for `level` models
    cmd = "python feature_combiner.py -l %d -c %s -m %s -n %s -s .csv -t %f" % (
        options.level, stacking_conf, meta_conf, feat_name, options.corr)
    os.system(cmd)

    # train `level` models
    if options.refit_once:
        cmd = "python task.py -m stacking -f %s -l %s -e 100 -o" % (
            feat_name, options.learner)
    else:
        cmd = "python task.py -m stacking -f %s -l %s -e 100" % (
            feat_name, options.learner)
    os.system(cmd)
def main(options):
    now = time_utils._timestamp_pretty()

    meta_conf = "level%d_feature_conf_meta_linear_%s"%(options.level, now)
    stacking_conf = "level%d_feature_conf_%s"%(options.level, now)
    feat_name = "level%d_meta_linear_%s"%(options.level, now)

    # get meta feature conf for `level` models
    cmd = "python get_feature_conf_linear_stacking.py -d %d -o %s.py"%(
        options.dim, meta_conf)
    os.system(cmd)

    # NOTE: using predictions from `level-1` models to generate features 
    # for `level` models
    cmd = "python get_stacking_feature_conf.py -l %d -t %d -o %s.py"%(
        options.level-1, options.top, stacking_conf)
    os.system(cmd)

    # generate feature for `level` models
    cmd = "python feature_combiner.py -l %d -c %s -m %s -n %s -s .csv -t %f"%(
        options.level, stacking_conf, meta_conf, feat_name, options.corr)
    os.system(cmd)

    # train `level` models
    if options.refit_once:
        cmd = "python task.py -m stacking -f %s -l %s -e 100 -o"%(feat_name, options.learner)
    else:
        cmd = "python task.py -m stacking -f %s -l %s -e 100"%(feat_name, options.learner)
    os.system(cmd)
Esempio n. 3
0
# -*- coding: utf-8 -*-
"""
@author: Chenglong Chen <*****@*****.**>
@brief: script for testing 1st level model with reg_xgb_tree

"""

import os
import sys

from utils import time_utils

if len(sys.argv) >= 3:
    suffix = sys.argv[1]
    threshold = float(sys.argv[2])
else:
    suffix = time_utils._timestamp_pretty()
    threshold = 0.05

cmd = "python get_feature_conf_nonlinear.py -d 10 -o feature_conf_nonlinear_%s.py"%suffix
os.system(cmd)

cmd = "python feature_combiner.py -l 1 -c feature_conf_nonlinear_%s -n basic_nonlinear_%s -t %.6f"%(suffix, suffix, threshold)
os.system(cmd)

cmd = "python task.py -m single -f basic_nonlinear_%s -l reg_xgb_tree -e 100"%suffix
os.system(cmd)
# -*- coding: utf-8 -*-
"""
@author: Chenglong Chen <*****@*****.**>
@brief: script for testing 1st level model with reg_xgb_tree

"""

import os
import sys

from utils import time_utils

if len(sys.argv) >= 3:
    suffix = sys.argv[1]
    threshold = float(sys.argv[2])
else:
    suffix = time_utils._timestamp_pretty()
    threshold = 0.05

cmd = "python get_feature_conf_nonlinear.py -d 10 -o feature_conf_nonlinear_%s.py" % suffix
os.system(cmd)

cmd = "python feature_combiner.py -l 1 -c feature_conf_nonlinear_%s -n basic_nonlinear_%s -t %.6f" % (
    suffix, suffix, threshold)
os.system(cmd)

cmd = "python task.py -m single -f basic_nonlinear_%s -l reg_xgb_tree -e 100" % suffix
os.system(cmd)