Ejemplo n.º 1
0
                                             resource_p, data_p, transition)

    testset_dir = "../testsets"

    log_config = {
        "control_flow_p": control_flow_p,
        "time_p": time_p,
        "resource_p": resource_p,
        "data_p": data_p,
        "transition": transition
    }

    # load data
    print("flag: loading data")
    fg = FeatureGenerator()
    df = fg.create_initial_log(filename, log_config)
    print("done")

    num_events = len(df)
    num_cases = len(set(df["id"]))

    # feature generation
    print("flag: generating features")
    if task == 'next_activity':
        loss = 'categorical_crossentropy'
        regression = False
        feature_type_list = ["activity_history"]
        df = fg.add_activity_history(df)
        df = fg.add_next_activity(df)

    elif task == 'next_timestamp':
    model_name = args.data_set + args.task

    contextual_info = args.contextual_info
    if args.task == 'next_activity':
        loss = 'categorical_crossentropy'
        regression = False
    elif args.task == 'next_timestamp':
        loss = 'mae'
        regression = True

    batch_size = args.batch_size_train
    num_folds = args.num_folds

    # load data
    FG = FeatureGenerator()
    df = FG.create_initial_log(filename)

    #split train and test
    #train_df, test_df = FG.train_test_split(df, 0.7, 0.3)
    train_df = df
    test_df = train_df
    #create train
    train_df = FG.order_csv_time(train_df)
    train_df = FG.queue_level(train_df)
    train_df.to_csv('./training_data.csv')
    state_list = FG.get_states(train_df)
    train_X, train_Y_Event, train_Y_Time = FG.one_hot_encode_history(
        train_df, args.checkpoint_dir + args.data_set)
    if contextual_info:
        train_context_X = FG.generate_context_feature(train_df, state_list)
        model = net()