def prediction_error(y, y_hat):
    """
    Calculate prediction accuaracy.
    
    Arguments:
        y  -- np.array / pd.Series
            The original value of the binary dependent variable;
        
        y_hat -- np.array / pd.Series
            The predicted value of the binary dependent variable;
            
    Return:
        error -- float
    """
    error = float(sum(y!=y_hat))/len(y)
    return error