6.9. Transforming the prediction target (y)

    is a utility class to help create a label indicatormatrix from a list of multi-class labels:

    >>>

    >>>

    6.9.2. Label encoding

    is a utility class to help normalize labels such thatthey contain only values between 0 and n_classes-1. This is sometimes usefulfor writing efficient Cython routines. can be used asfollows:

    It can also be used to transform non-numerical labels (as long as they arehashable and comparable) to numerical labels:

    >>>