def getPriors(labels):
    """
    Get the class priors by calculating the class probability from the 
    provided set. The prior is computed as 
    
    (prior for class A) = (number of class A samples) / (total number of samples)

    Parameters
    ----------
    labels : target class values    
        
    Returns
    -------
    priors : A dictionary with the class priors. 
             E.g. { ClassA: prior, ClassB: prior, ...}    
    """
    priors = {}
    for className in labels:
        N = labels.size
        class_occurrence = (labels == className).sum()
        priors[className] = class_occurrence/N
    return priors