Ejemplo n.º 1
0
def get_all_data():
    print("reading data...")

    # Load training and eval data
    train_data, train_labels, eval_data, eval_labels, max_input_length = \
        inputs.get_data_rq2(training_data_path, eval_data_path, OUT_FOLDER, "rq2_cnn1d_" + smell,
                        train_validate_ratio=TRAIN_VALIDATE_RATIO, max_training_samples=5000)

    print("reading data... done.")
    return input_data.Input_data(train_data, train_labels, eval_data, eval_labels, max_input_length)
def get_all_data(data_path, smell):
    print("reading data...")

    train_data, train_labels, eval_data, eval_labels, max_input_length = \
        inputs.get_data(data_path, OUT_FOLDER, "rq1_rnn_" + smell,
                                                train_validate_ratio=TRAIN_VALIDATE_RATIO, max_training_samples= 5000)

    train_data = train_data.reshape((len(train_labels), max_input_length))
    eval_data = eval_data.reshape((len(eval_labels), max_input_length))
    print("reading data... done.")
    return input_data.Input_data(train_data, train_labels, eval_data,
                                 eval_labels, max_input_length)
Ejemplo n.º 3
0
def get_all_data(training_data_path, eval_data_path, smell):
    print("reading data...")

    if smell in ["ComplexConditional", "ComplexMethod"]:
        max_eval_samples = 150000  # for impl smells (methods)
    else:
        max_eval_samples = 50000  # for design smells (classes)

    training_data, training_labels, eval_data, eval_labels, max_input_length = \
        inputs.get_data_rq2(training_data_path, eval_data_path, OUT_FOLDER, "rq2_rnn_" + smell,
                            train_validate_ratio=TRAIN_VALIDATE_RATIO, max_training_samples=5000,
                            max_eval_samples=max_eval_samples)

    training_data = training_data.reshape((len(training_labels), max_input_length))
    eval_data = eval_data.reshape((len(eval_labels), max_input_length))
    print("reading data... done.")
    return input_data.Input_data(training_data, training_labels, eval_data, eval_labels, max_input_length)
Ejemplo n.º 4
0
def get_all_data(data_path):
    print("reading data...")

    # Load training and eval data
    train_data, train_labels, eval_data, eval_labels, max_input_length = \
        inputs.get_data(data_path, OUT_FOLDER, "rq1_cnn1d_" + smell,
                                                train_validate_ratio=TRAIN_VALIDATE_RATIO, max_training_samples= 5000)

    # train_data = train_data.reshape((len(train_labels), max_input_length))
    # eval_data = eval_data.reshape((len(eval_labels), max_input_length))
    print("train_data: " + str(len(train_data)))
    print("train_labels: " + str(len(train_labels)))
    print("eval_data: " + str(len(eval_data)))
    print("eval_labels: " + str(len(eval_labels)))
    print("reading data... done.")
    return input_data.Input_data(train_data, train_labels, eval_data,
                                 eval_labels, max_input_length)
Ejemplo n.º 5
0
def get_all_data(data_path, smell):
    print("reading data...")
    max_eval_samples = 150000
    if smell in ["MultifacetedAbstraction", "FeatureEnvy"]:
        max_eval_samples = 50000

    train_data, eval_data, eval_labels, max_input_length = \
        inputs.get_data_autoencoder(data_path,
                                    train_validate_ratio=TRAIN_VALIDATE_RATIO,
                                    max_training_samples=5000,
                                    max_eval_samples=max_eval_samples,
                                    )
    print("nan count: " + str(np.count_nonzero(np.isnan(train_data))))
    print("train_data: " + str(len(train_data)))
    print("train_data shape: " + str(train_data.shape))
    print("eval_data: " + str(len(eval_data)))
    print("eval_labels: " + str(len(eval_labels)))
    print("reading data... done.")
    return input_data.Input_data(train_data, None, eval_data, eval_labels, max_input_length)
Ejemplo n.º 6
0
def get_all_data(data_path, smell):
    print("reading data...")

    if smell in ["ComplexConditional", "ComplexMethod"]:
        max_eval_samples = 150000  # for impl smells (methods)
    else:
        max_eval_samples = 50000  #for design smells (classes)

    # Load training and eval data
    train_data, train_labels, eval_data, eval_labels, max_input_length = \
        inputs.get_data(data_path,
                        train_validate_ratio=TRAIN_VALIDATE_RATIO, max_training_samples=5000,
                        max_eval_samples=max_eval_samples, is_c2v = C2V)

    # train_data = train_data.reshape((len(train_labels), max_input_length))
    # eval_data = eval_data.reshape((len(eval_labels), max_input_length))
    print("train_data: " + str(len(train_data)))
    print("train_labels: " + str(len(train_labels)))
    print("eval_data: " + str(len(eval_data)))
    print("eval_labels: " + str(len(eval_labels)))
    print("reading data... done.")
    return input_data.Input_data(train_data, train_labels, eval_data,
                                 eval_labels, max_input_length)