Can the label powerset method be used to predict probability for reach class? The label powerset is a method used to transform a multi-label problem to multi-class problem. The idea is straightfoward, just enumerate all the possible combinations of outputs, and treat each of them as a single unique label. However, I feel that this method cannot be used to predict the possibility for each of the class. Suppose that we have 4 binary classes. For an example $x$, if we predict  $(1,0,0,1)$ to be $0.9$ and $(0,1,1,0)$ to be $0.1$. Is it possible to assign individual probabilities to each of the $4$ classes?
 A: *

*For each subset classes, the predicted probability for that subset is added to each of the individual $1$ classes, to compute the individual probabilities.


*For example, $P(1,0,0,1|x) = 0.9$ will add  $0.9$ to both $P(C_1|x)$ and $P(C_4|x)$, whereas $P(0,1,1,0|x) = 0.1$ will add  $0.1$ to both $P(C_2|x)$ and $P(C_3|x)$.


*With skmultilearn's implementation of LabelPowerset the individual probabilities are computed with the function predict_proba() as follows:
source: http://scikit.ml/_modules/skmultilearn/problem_transform/lp.html#LabelPowerset.predict_proba
def predict_proba(self, X):    
    lp_prediction = self.classifier.predict_proba(self._ensure_input_format(X))
    result = sparse.lil_matrix((X.shape[0], self._label_count), dtype='float')
    for row in range(len(lp_prediction)):
        assignment = lp_prediction[row]
        for combination_id in range(len(assignment)):
            for label in self.reverse_combinations_[combination_id]:
                result[row, label] += assignment[combination_id]
    return result

The following example demonstrates how it works:
# generate multi-label dataset
from sklearn.datasets import make_multilabel_classification
from skmultilearn.problem_transform import LabelPowerset
from sklearn.ensemble import RandomForestClassifier
import numpy.random as random

random.seed(123)
X, y = make_multilabel_classification(n_classes=4, n_labels=2,
                                      allow_unlabeled=False,
                                      random_state=1)
y[0:2]
# array([[0, 1, 0, 1],
#        [1, 0, 0, 1]])

classifier = LabelPowerset(
   classifier = RandomForestClassifier(),
   require_dense = [False, True]
)
classifier.fit(X, y)

x = X[2] # test datapoint

pred = classifier.classifier.predict_proba(x.reshape(1,-1))[0]
for i in range(len(classifier.unique_combinations_)):
    print(classifier.reverse_combinations_[i], pred[i])
# [1, 3] 0.05
# [0, 3] 0.04
# [0, 1] 0.67
# [0, 1, 3] 0.07
# [1] 0.04
# [3] 0.01
# [0, 1, 2, 3] 0.05
# [0] 0.07


*

*For example, from the above code snippet we can see that $P(0,1,0,1|x)=0.05$ and $P(1,0,0,1|x)=0.04$.


*The above probabilities can be converted to individual class probabilities in the following way:
classifier.predict_proba(x.reshape(1,-1)).toarray()
# array([[0.9 , 0.88, 0.05, 0.22]])



*The above output shows the individual class-probabilities predicted: $P(C_0|x)=0.9$, $P(C_1|x)=0.88$ etc.
