def get_independent_preds()

in bindings/python-compute/performance_comparison.py [0:0]


def get_independent_preds(df_columns, models=None):
    columns = [c for c in df_columns if c.startswith('model_') or c.startswith('modelClass_')]

    if len(columns[0].split('_')) < 3:
        # in case of using loss_df
        indep_cols_all = columns
    else:
        # in case of using pred_df
        non_class0 = [c for c in columns if not c.endswith('_0')]
        indep_cols_all = columns if len(non_class0) == 0 else \
            [c for c in columns if c.startswith('modelClass_') and not c.endswith('_0')]

    if (models is not None and len(models) > 0):
        return [c for c in indep_cols_all if int(c.split('_')[1]) in models]
    return indep_cols_all