def evaluate_fix_classifier(): text_name = 'message' classification_function = is_fix classification_column = 'corrective_pred' concept_column = 'Is_Corrective' df = pd.read_csv(join(DATA_PATH, 'corrective_texts_tests.csv')) #df = df[df.certain != 'FALSE'] df = df[~df.Is_Corrective.isna()] #concept_column='is_corrective' #df = pd.read_csv("/Users/idan/playground/commit-classification/data/change_samples.csv") df = classifiy_commits_df(df, classification_function=classification_function, classification_column=classification_column, text_name=text_name) cm = evaluate_performance(df, classification_column, concept_column, text_name=text_name) print("corrective_labels CM") print(cm) df = df[(df['disable'] != 1)] """ fp = get_false_positives(df , classifier_column=classification_column , concept_column=concept_column) print("False Positives") pd.options.display.max_columns = 50 pd.options.display.max_rows = 2000 print(fp) """ fn = get_false_negatives(df, classifier_column=classification_column, concept_column=concept_column) print("False Negatives") pd.options.display.max_columns = 50 pd.options.display.max_rows = 2000 print(fn)
def evaluate_cc_fix_classifier(): text_name = 'message' classification_function = is_cc_corrective classification_column = 'corrective_pred' concept_column = 'Is_Corrective' df = pd.read_csv(join(DATA_PATH, 'conventional_commits.csv')) df = classifiy_commits_df(df, classification_function=classification_function, classification_column=classification_column, text_name=text_name) cm = evaluate_performance(df, classification_column, concept_column, text_name=text_name) print("corrective_labels CM") print(cm)
def evaluate_abstraction_classifier(): text_name = 'message' classification_function = is_abstraction classification_column = 'abstraction_pred' concept_column = 'Is_abstraction' df = pd.read_csv(join(DATA_PATH, 'abstraction_commits.csv')) df = classifiy_commits_df(df, classification_function=classification_function, classification_column=classification_column, text_name=text_name) cm = evaluate_performance(df, classification_column, concept_column, text_name=text_name) print("Abstraction labels CM") print(cm)
def evaluate_adaptive_classifier(): text_name = 'message' classification_function = is_adaptive classification_column = 'corrective_pred' concept_column = 'Is_Adaptive' df = pd.read_csv(join(DATA_PATH, 'commit_classification_batch2.csv')) df = df[df.certain != 'FALSE'] df = df[~df.Is_Corrective.isna()] """ concept_column = 'is_adaptive' df = pd.read_csv(join(DATA_PATH, "commit_classification_batch2.csv")) df[concept_column] = df.expected.map(lambda x: not x) """ df = classifiy_commits_df(df, classification_function=classification_function, classification_column=classification_column, text_name=text_name) cm = evaluate_performance(df, classification_column, concept_column, text_name=text_name) print("corrective_labels CM") print(cm) """ fp = get_false_positives(df , classifier_column=classification_column , concept_column=concept_column) print("False Positives") pd.options.display.max_columns = 50 pd.options.display.max_rows = 2000 print(fp) """ fn = get_false_negatives(df, classifier_column=classification_column, concept_column=concept_column) print("False Negatives") pd.options.display.max_columns = 50 pd.options.display.max_rows = 2000 print(fn)