pyprophet/stats.py
def final_err_table(df, num_cut_offs=51):
    """ Create artificial cutoff sample points from given range of cutoff
    values in df, number of sample points is 'num_cut_offs' """

    cutoffs = df.cutoff.values
    min_ = min(cutoffs)
    max_ = max(cutoffs)
    # extend max_ and min_ by 5 % of full range
    margin = (max_ - min_) * 0.05
    sampled_cutoffs = np.linspace(min_ - margin, max_ + margin, num_cut_offs, dtype=np.float32)

    # find best matching row index for each sampled cut off:
    ix = find_nearest_matches(np.float32(df.cutoff.values), sampled_cutoffs)

    # create sub dataframe:
    sampled_df = df.iloc[ix].copy()
    sampled_df.cutoff = sampled_cutoffs
    # remove 'old' index from input df:
    sampled_df.reset_index(inplace=True, drop=True)

    return sampled_df
def final_err_table(df, num_cut_offs=51):
    cutoffs = df.cutoff.values
    min_ = min(cutoffs)
    max_ = max(cutoffs)
    # extend max_ and min_ by 5 % of full range
    margin = (max_ - min_) * 0.05
    sampled_cutoffs = np.linspace(min_ - margin, max_ + margin, num_cut_offs, dtype=np.float32)

    # find best matching row index for each sampled cut off:
    ix = find_nearest_matches(np.float32(df.cutoff.values), sampled_cutoffs)

    # create sub dataframe:
    sampled_df = df.iloc[ix].copy()
    sampled_df.cutoff = sampled_cutoffs
    # remove 'old' index from input df:
    sampled_df.reset_index(inplace=True, drop=True)

    return sampled_df
def final_err_table ( df , num_cut_offs = 51 ) : cutoffs = df . cutoff . values min_ = min ( cutoffs ) max_ = max ( cutoffs ) # extend max_ and min_ by 5 % of full range margin = ( max_ - min_ ) * 0.05 sampled_cutoffs = np . linspace ( min_ - margin , max_ + margin , num_cut_offs , dtype = np . float32 ) # find best matching row index for each sampled cut off: ix = find_nearest_matches ( np . float32 ( df . cutoff . values ) , sampled_cutoffs ) # create sub dataframe: sampled_df = df . iloc [ ix ] . copy ( ) sampled_df . cutoff = sampled_cutoffs # remove 'old' index from input df: sampled_df . reset_index ( inplace = True , drop = True ) return sampled_df
Create artificial cutoff sample points from given range of cutoff
    values in df, number of sample points is 'num_cut_offs'
Create artificial cutoff sample points from given range of cutoff values in df number of sample points is num_cut_offs