Primary competition visual

AI4D Africa’s Anglophone Research Lab Tanzania Tourism Classification Challenge

Helping Tanzania, United Republic of
$1 000 USD
Challenge completed over 3 years ago
Classification
506 joined
180 active
Starti
Jun 01, 22
Closei
Jul 01, 22
Reveali
Jul 01, 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
Robotics and artificial intelligence nigeria

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

1 Jun 2022, 16:30
Upvotes 2
User avatar
Koleshjr
Multimedia university of kenya

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]

User avatar
Emmanuel360__RAIN
Robotics and artificial intelligence nigeria

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

Model.predict_proba()

1 Jun 2022, 16:38
Upvotes 1
User avatar
Koleshjr
Multimedia university of kenya

Oh thank you solved it.

User avatar
Emmanuel360__RAIN
Robotics and artificial intelligence nigeria

That's good

1 Jun 2022, 18:19
Upvotes 0
User avatar
Koleshjr
Multimedia university of kenya

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