Primary competition visual

AI4D Africa’s Anglophone Research Lab Tanzania Tourism Classification Challenge

Helping Tanzania, United Republic of
$1 000 USD
Completed (over 4 years ago)
Classification
525 joined
180 active
Starti
01 Jun 22
Closei
01 Jul 22
Reveali
01 Jul 22
User avatar
Koleshjr
Multimedia university of kenya
How to implement logloss for multiclass?
Help · 1 Jun 2022, 16:24 · 6

Kindly, Can anyone help me in understanding how to implement logloss for multiclass problems

Discussion 6 answers
User avatar
Emmanuel360__RAIN

Let's assume ur using a logistic regression model.

Lr=LogisticsRegression()

Lr.fit(X_train,y_train)

Pred=lr.predict_proba(X_test)

Log_loss(y_pred,y_true)

So u needed to get the probability function of ur prediction to be able to check for the log_losss

Upvotes 2
User avatar
Koleshjr

Thanks but this is the error i am getting.

ValueError: y_true and y_pred contain different number of classes 6, 2. Please provide the true labels explicitly through the labels argument. Classes found in y_true: [0 1 2 3 4 5]

Upvotes 0
User avatar
Emmanuel360__RAIN

That's bcos u didn't use the proba key word.

Model.predict_proba()

Upvotes 1
User avatar
Koleshjr

Oh thank you solved it.

Upvotes 0
User avatar
Emmanuel360__RAIN

That's good

Upvotes 0
User avatar
Koleshjr

And can you please share how the submission file should be created from fold predictions?

Upvotes 0