Scikit Learn Multilabel Classification, Getting back labels from MultiLabelBinarizer -
in multilabel classification problem, use multilabelbinarizer transform 20 text labels binary list of zeros , ones.
after prediction list of 20 binary values, , output corresponding text labels.
i wondering whether multilabelbinarizer() provides getting transformation or should manually.
yes, multilabelbinarizer provides method named inverse_transform() convert binarized labels original names supplied during fit().
inverse_transform(yt)
transform given indicator matrix label sets parameters: yt : array or sparse matrix of shape (n_samples, n_classes) matrix containing 1s ands 0s. returns: y : list of tuples set of labels each sample such y[i] consists of classes_[j] each yt[i, j] == 1.
Comments
Post a Comment