scripts/processing/threshold_selector.py
def compute_possible_gathering_thresholds(scores, chunks=4):
    """
    Selects a number of probable gathering thresholds to try
    building the model with.

    param scores:
    param chunks:
    return:
    """

    ga_thresholds = []

    all_scores = scores["SEED"] + scores["FULL"]

    # sorts scores in descending order to match order in outlist
    rev_scores = list(reversed(sorted(all_scores)))

    median = statistics.median(rev_scores)
    min_seed_score = sorted(scores["SEED"])[0]

    index = 0

    if min_seed_score < median:
        ga_thresholds.append(min_seed_score)
        index = rev_scores.index(min_seed_score)
    else:
        if len(rev_scores) % 2 != 0:
            index = rev_scores.index(median)
            ga_thresholds.append(median)
        else:
            # a bit conservative, always chooses the highest value
            index = int(len(rev_scores)/2)
            ga_thresholds.append(rev_scores[index])

    scores_chunk = rev_scores[index:]
    chunks -= 2

    while chunks != 0:
        median = statistics.median(scores_chunk)
        if len(scores_chunk) % 2 != 0:
            index = scores_chunk.index(median)
            ga_thresholds.append(median)
        else:
            # a bit conservative, always chooses the highest value
            index = int(len(scores_chunk)/2)
            ga_thresholds.append(scores_chunk[index])

        scores_chunk = scores_chunk[index:]
        chunks -= 2

    # always consider last hit above reversed
    ga_thresholds.append(rev_scores[-1])

    return ga_thresholds

    Selects a number of probable gathering thresholds to try
    building the model with.

    param scores:
    param chunks:
    return:
    
Selects a number of probable gathering thresholds to try
building the model with.

param scores:
param chunks:
return.
Selects a number of probable gathering thresholds to try building the model with . param scores : param chunks : return .
def compute_possible_gathering_thresholds(scores, chunks=4):
    ga_thresholds = []
    all_scores = scores["SEED"] + scores["FULL"]
    rev_scores = list(reversed(sorted(all_scores)))
    median = statistics.median(rev_scores)
    min_seed_score = sorted(scores["SEED"])[0]
    index = 0
    if min_seed_score < median:
        ga_thresholds.append(min_seed_score)
        index = rev_scores.index(min_seed_score)
    else:
        if len(rev_scores) % 2 != 0:
            index = rev_scores.index(median)
            ga_thresholds.append(median)
        else:
            index = int(len(rev_scores)/2)
            ga_thresholds.append(rev_scores[index])
    scores_chunk = rev_scores[index:]
    chunks -= 2
    while chunks != 0:
        median = statistics.median(scores_chunk)
        if len(scores_chunk) % 2 != 0:
            index = scores_chunk.index(median)
            ga_thresholds.append(median)
        else:
            index = int(len(scores_chunk)/2)
            ga_thresholds.append(scores_chunk[index])
        scores_chunk = scores_chunk[index:]
        chunks -= 2
    ga_thresholds.append(rev_scores[-1])
    return ga_thresholds
def compute_possible_gathering_thresholds ( scores , chunks = 4 ) : ga_thresholds = [ ] all_scores = scores [ "SEED" ] + scores [ "FULL" ] rev_scores = list ( reversed ( sorted ( all_scores ) ) ) median = statistics . median ( rev_scores ) min_seed_score = sorted ( scores [ "SEED" ] ) [ 0 ] index = 0 if min_seed_score < median : ga_thresholds . append ( min_seed_score ) index = rev_scores . index ( min_seed_score ) else : if len ( rev_scores ) % 2 != 0 : index = rev_scores . index ( median ) ga_thresholds . append ( median ) else : index = int ( len ( rev_scores ) / 2 ) ga_thresholds . append ( rev_scores [ index ] ) scores_chunk = rev_scores [ index : ] chunks -= 2 while chunks != 0 : median = statistics . median ( scores_chunk ) if len ( scores_chunk ) % 2 != 0 : index = scores_chunk . index ( median ) ga_thresholds . append ( median ) else : index = int ( len ( scores_chunk ) / 2 ) ga_thresholds . append ( scores_chunk [ index ] ) scores_chunk = scores_chunk [ index : ] chunks -= 2 ga_thresholds . append ( rev_scores [ - 1 ] ) return ga_thresholds
Selects a number of probable gathering thresholds to try
building the model with.
Selects a number of probable gathering thresholds to try building the model with .
"""
    Selects a number of probable gathering thresholds to try
    building the model with.

    param scores:
    param chunks:
    return:
    """ # sorts scores in descending order to match order in outlist # a bit conservative, always chooses the highest value # a bit conservative, always chooses the highest value # always consider last hit above reversed
scores
chunks