def predict_sex(x_coverage, y_coverage):
    """Make a simple yet accurate prediction of a samples sex.

    The calculation is based on the average coverage across the X and Y
    chromosomes. Note that an extrapolation from a subsection of bases is
    usually quite sufficient.

    Args:
        x_coverage (float): estimated average coverage on X chromosome
        y_coverage (float): estimated average coverage on Y chromosome

    Returns:
        str: prediction, ['male', 'female', 'unknown']
    """
    if y_coverage == 0:
        return 'female'
    else:
        ratio = x_coverage / y_coverage
        if x_coverage == 0 or (ratio > 12 and ratio < 100):
            return 'unknown'
        elif ratio <= 12:
            # this is the entire prediction, it's usually very obvious
            return 'male'
        else:
            # the few reads mapping to the Y chromosomes are artifacts
            return 'female'