AgriFieldNet India Challenge
Can you detect crop types in a class-imbalanced satellite image dataset?
Prize
$10 000 USD
Time
~1 month to go
Participants
78 active · 352 enrolled
Helping
India
Advanced
Classification
Agriculture
Help on competition's metric
Help · 13 Sep 2022, 23:07 · 0

Hello! This competition is very interesting and while trying to evaluate my results in a validation set I struggled a little bit with the metric.

The Evaluation says:

"The evaluation metric for this challenge is Cross Entropy with the binary outcome for each crop"

I implemented a function but I'm not sure if this is the correct implementation. Could you please check if this is correct?

import pandas as pd
import numpy as np
def cross_entropy(y_true: pd.Series, y_prob: np.ndarray):
    y_true = pd.get_dummies(y_true).values
    # log is undefined for p=0 or p=1
    y_prob = np.clip(y_prob, 1e-6, 1 - 1e-6)   
    return -(y_true * np.log(y_prob)).sum() / len(y_true)

If this is not the case, should I just use sklearn like this?

from sklearn.metrics import log_loss
log_loss(y_true, y_prob)

Discussion 0 answers