All Multi-Label Classification Models giving zero accuracy

24 Views Asked by At

Any scikit multi-label model I try to apply results in zero accuracy. this is the picture of my dataset after preprocessing: X-label, y-label, complete dataset

I tried applying ClassfierChain, BinaryRelevance and LabelPowerSet with multiple classification models, for instance:

def build_model (model, mlb_estimator, X_train, y_train, X_test, y_test) :
    #create instance
    clf = mlb_estimator(model)
    clf.fit(X_train,y_train)
    
    #predict
    clf_pred = clf.predict(X_test)
    
    #check accuracy
    acc = accuracy_score(y_test, clf_pred)
    ham = hamming_loss(y_test,clf_pred)
    result = {"accuracy ": acc, "hamming loss ": ham}
    return result

clf_chain_model = build_model(MultinomialNB(),LabelPowerset ,X_train, y_train, X_test, y_test)

but all I'm getting is 0.0 accuracy.

I think there might issue with data preprocessing but I cant figure it out

0

There are 0 best solutions below