model/utils.py
def load_data(all_features):
    """
    Load the data of all repos.

    Args:
        all_features: A boolean indicating whether to load all feature.

    Returns:
        data_arr: A numpy array of the original loaded data.
        pr_data: A numpy array of the pull request level features,
        file_data: A numpy array of the aggregated file level features.
        labels: A numpy array of labels.
    """
    data_loader = DataLoader(REPOS)
    pr_columns, file_columns, data_dict = data_loader.load_data_from_txt()
    data_list = expand_dict_to_lst(data_dict)
    data_arr = np.array(data_list)
    np.random.shuffle(data_arr)
    if all_features:
        file_features_indices = [file_columns.index(s) for s in file_columns]
    else:
        file_features_indices = [file_columns.index(s) for s in
                                 SIGNIFICANT_FILE_FEATURES]

    if all_features:
        pr_features_indices = [pr_columns.index(s) for s in
                               pr_columns]
    else:
        pr_features_indices = [pr_columns.index(s) for s in
                               SIGNIFICANT_PR_FEATURES]
    pr_data = np.array(list(data_arr[:, 0]))[:, pr_features_indices]
    labels = np.array(list(map(int, data_arr[:, 2])))
    print("Aggregating file level data")
    aggregated_file_data = aggregate_file_data(
        data_arr, file_features_indices)
    file_data = np.array(aggregated_file_data)
    return data_arr, pr_data, file_data, labels

    Load the data of all repos.

    Args:
        all_features: A boolean indicating whether to load all feature.

    Returns:
        data_arr: A numpy array of the original loaded data.
        pr_data: A numpy array of the pull request level features,
        file_data: A numpy array of the aggregated file level features.
        labels: A numpy array of labels.
    
Load the data of all repos.
Load the data of all repos .
def load_data(all_features):
    data_loader = DataLoader(REPOS)
    pr_columns, file_columns, data_dict = data_loader.load_data_from_txt()
    data_list = expand_dict_to_lst(data_dict)
    data_arr = np.array(data_list)
    np.random.shuffle(data_arr)
    if all_features:
        file_features_indices = [file_columns.index(s) for s in file_columns]
    else:
        file_features_indices = [file_columns.index(s) for s in
                                 SIGNIFICANT_FILE_FEATURES]
    if all_features:
        pr_features_indices = [pr_columns.index(s) for s in
                               pr_columns]
    else:
        pr_features_indices = [pr_columns.index(s) for s in
                               SIGNIFICANT_PR_FEATURES]
    pr_data = np.array(list(data_arr[:, 0]))[:, pr_features_indices]
    labels = np.array(list(map(int, data_arr[:, 2])))
    print("Aggregating file level data")
    aggregated_file_data = aggregate_file_data(
        data_arr, file_features_indices)
    file_data = np.array(aggregated_file_data)
    return data_arr, pr_data, file_data, labels
def load_data ( all_features ) : data_loader = DataLoader ( REPOS ) pr_columns , file_columns , data_dict = data_loader . load_data_from_txt ( ) data_list = expand_dict_to_lst ( data_dict ) data_arr = np . array ( data_list ) np . random . shuffle ( data_arr ) if all_features : file_features_indices = [ file_columns . index ( s ) for s in file_columns ] else : file_features_indices = [ file_columns . index ( s ) for s in SIGNIFICANT_FILE_FEATURES ] if all_features : pr_features_indices = [ pr_columns . index ( s ) for s in pr_columns ] else : pr_features_indices = [ pr_columns . index ( s ) for s in SIGNIFICANT_PR_FEATURES ] pr_data = np . array ( list ( data_arr [ : , 0 ] ) ) [ : , pr_features_indices ] labels = np . array ( list ( map ( int , data_arr [ : , 2 ] ) ) ) print ( "Aggregating file level data" ) aggregated_file_data = aggregate_file_data ( data_arr , file_features_indices ) file_data = np . array ( aggregated_file_data ) return data_arr , pr_data , file_data , labels
Load the data of all repos.
Load the data of all repos .
"""
    Load the data of all repos.

    Args:
        all_features: A boolean indicating whether to load all feature.

    Returns:
        data_arr: A numpy array of the original loaded data.
        pr_data: A numpy array of the pull request level features,
        file_data: A numpy array of the aggregated file level features.
        labels: A numpy array of labels.
    """
A numpy array of the original loaded data.
pr_data: A numpy array of the pull request level features,
file_data: A numpy array of the aggregated file level features.
labels: A numpy array of labels.
A numpy array of the original loaded data . pr_data : A numpy array of the pull request level features file_data : A numpy array of the aggregated file level features . labels : A numpy array of labels .
data_arr
all_features
A boolean indicating whether to load all feature.
A boolean indicating whether to load all feature .