Пример #1
0
def run():
    
    print('\n加载训练数据')
    train_ds = DataSource.DataSource(train_data_index,train_data_zip);
    model = BPModel(feature_size,label_size,hidden_size,act_func,rou);
    if need_train:
        print('\n开始训练')
        model.train(train_ds, learn_rate, steps, batch_size,load_values);
    print('\n开始测试')
    train_ds.reload_index(test_data_index);
    print('开始测试输出')
    _,py,y=model.calculate(train_ds);
    print('开始评价')
    evel(py,y);
    
    if need_result_out:
        print('\n开始加载比赛数据集')
        result_ds=DataSource.DataSource(result_test_index,result_test_data_zip);
        indexids=result_ds.getAllIndexID();
        print('计算比赛数据')
        py=model.cal_py_out(result_ds);
        print('创建比赛文件')
        DataSetProcess.create_result_csv(indexids, py, result_test_out_path);

    pass;
Пример #2
0
def run():

    print('\n加载训练数据')
    train_ds = DataSource.DataSource(train_data_index, train_data_zip)
    if need_train:
        print('\n开始训练')
        train_ae(train_ds, )


#     print('\n开始测试')
#     train_ds.reload_index(test_data_index);
#     print('开始测评')
#     evel(train_ds);

    if need_result_out:
        print('\n开始加载比赛数据集')
        result_ds = DataSource.DataSource(result_test_index,
                                          result_test_data_zip)
        indexids = result_ds.getAllIndexID()
        print('计算比赛数据')
        py = calculate(result_ds)
        print('创建比赛文件')
        DataSetProcess.create_result_csv(indexids, py, result_test_out_path)

    pass
Пример #3
0
# -*- coding: utf-8 -*-
'''
Created on 2018年2月28日

@author: zwp
'''
from LAMOST import DataSource
import time
zip_path = r'/home/zwp/work/Dataset/tianci/first_train_data_20180131.zip'
csv_path = r'/home/zwp/work/Dataset/tianci/first_train_index_20180131.csv'
csv_path_type = r'/home/zwp/work/Dataset/tianci/first_train_index_types.csv'
if __name__ == '__main__':

    datasource = DataSource.DataSource(csv_path_type, zip_path)

    now = time.time()
    print(datasource.getDataXY(1, 200))
    print("%.2f" % (time.time() - now))
    datasource.close()
    pass