CardiovascularDisease/CVD/postprocessor.py
def find_mislabels(y_test, model_preds):
    """
    Find all mislabels given the predictions of a given estimator/model.
    Find the false positive and negatives.
    RETURN: list of indices of all mislabeled, false positive, and false negative samples

    """

    y_pred = pd.Series(model_preds, index=y_test.index)
    diffs = y_pred - y_test
    mislabels = diffs[diffs != 0]  # All mislabeled samples
    fp = mislabels[mislabels == 1]  # False positives
    fn = mislabels[mislabels == -1]  # False negatives

    return list(mislabels.index), list(fp.index), list(fn.index)

    Find all mislabels given the predictions of a given estimator/model.
    Find the false positive and negatives.
    RETURN: list of indices of all mislabeled, false positive, and false negative samples

    
Find all mislabels given the predictions of a given estimator/model.
Find the false positive and negatives.
RETURN: list of indices of all mislabeled, false positive, and false negative samples
Find all mislabels given the predictions of a given estimator / model . Find the false positive and negatives . RETURN : list of indices of all mislabeled false positive and false negative samples
def find_mislabels(y_test, model_preds):
    y_pred = pd.Series(model_preds, index=y_test.index)
    diffs = y_pred - y_test
    mislabels = diffs[diffs != 0]  
    fp = mislabels[mislabels == 1]  
    fn = mislabels[mislabels == -1]  
    return list(mislabels.index), list(fp.index), list(fn.index)
def find_mislabels ( y_test , model_preds ) : y_pred = pd . Series ( model_preds , index = y_test . index ) diffs = y_pred - y_test mislabels = diffs [ diffs != 0 ] fp = mislabels [ mislabels == 1 ] fn = mislabels [ mislabels == - 1 ] return list ( mislabels . index ) , list ( fp . index ) , list ( fn . index )
Find all mislabels given the predictions of a given estimator/model.
Find all mislabels given the predictions of a given estimator / model .
"""
    Find all mislabels given the predictions of a given estimator/model.
    Find the false positive and negatives.
    RETURN: list of indices of all mislabeled, false positive, and false negative samples

    """ # All mislabeled samples # False positives # False negatives
y_test
model_preds