def extract_sub_ids(file, naive=False, label_of_interest=0):
    """
    Extracts sub_ids from dataset_x.txt files of the following format:
    SubjectID,Network,Station,Latitude,Longitude,PercentageEarthquakes,PercentageTremor,
    PercentageNoise,PercentageUnclearEvent

    Args:
        file (path): Path to file containing the dataset info
        naive (bool): If naive = True, apply naive selection based on threshold (no reliability
        score)
        label_of_interest (int): Only used if naive flag is set to true

    Returns (list): List containing extracted subject ids
    """

    sub_ids = []
    threshold = 70.0
    offset_dict = {0: 5, 1: 7, 2: 6, 3: 7}  # Map labels to indices according to headers
    label_index = offset_dict[label_of_interest]

    with open(file, 'r') as f:
        for index, line in enumerate(f.readlines()):
            # Don't consider the headers
            if index > 2:
                info = line.split(",")
                if not naive:
                    sub_ids.append(int(info[0]))
                elif naive and float(info[label_index]) > threshold:
                    sub_ids.append(int(info[0]))

    return sub_ids