Пример #1
0
    # 预测时间必须是整数,且不等于0
    if not isinstance(args.predict_time, int) and args.predict_time == 0:
        return 'error predict time'
    if not os.path.exists(args.data_dir):
        return 'the data file is not exist'
    else:
        return ''


if __name__ == "__main__":
    parser = ArgumentParser(
        description='Periodic prediction of the time series.')

    parser.add_argument('--model_name',
                        default='lr',
                        choices=models.names(),
                        help='Name of the model to use.')

    parser.add_argument(
        '--data_dir',
        default='./aiopstools/timeseries_predict/data/timeseries_data.csv',
        help='Dir of the data to train')

    parser.add_argument('--predict_time',
                        type=int,
                        help='The prediction time.')

    args = parser.parse_args()

    check_result = check_param(args)
    if check_result == '':
Пример #2
0
    # 预测时间必须是整数,且不等于0
    if not isinstance(args.predict_time, int) and args.predict_time == 0:
        return 'error predict time'
    if not os.path.exists(args.data_dir):
        return 'the data file is not exist'
    else:
        return ''



if __name__ == "__main__":
    parser = ArgumentParser(description='Prediction of the time series.')

    parser.add_argument(
        '--model_name', default='lr',
        choices=models.names(), help='Name of the model to use.')

    parser.add_argument(
        '--data_dir', default='./timeseries_predict/data/timeseries_data.csv',
        help='Dir of the data to train')

    parser.add_argument(
        '--predict_time', type=int,
        help='The prediction time.')
    args = parser.parse_args()

    check_result = check_param(args)

    if check_result == '':
        ori_data, timestamp_list, value_list = handle_data.get_train_data(args.data_dir, args.predict_time)
        if len(value_list) < args.predict_time: