1
$\begingroup$

I'm solving a problem of ranking classes for each unique id based on the utilization quantity. I have 6 unique classes in the training and test data. My neural net mode predicts the utilization coressponding to each class. So if there are 10000 test samples, I have 10000X6 prediction array and 10000X6 true value array. I want to validate the model performance using NDCG metrics. I followed https://www.kaggle.com/davidgasquez/ndcg-scorer to compute NDCG. In there, the shapes for the parameters are as follows: y_true : array, shape = [nsamples] Ground truth (true relevance labels). y_score : array, shape = [nsamples, n_classes] Predicted scores. k : int Rank.

In my case the ytrue is an array of shape [nsamples,nclasses]. I have aggregated the true values for individual classes for each unique id and y_true is now [n_unique_id,1]. y_score is of shape [unique_id,n_classes]. I've used Rank = 6 since there are 6 distinct classes.

ndcg score for the above data [score = ndcg_score(df_true, df_pred_array, k=6)] is 19.6 and I know the score cannot be greater than 1. Am I missing something here?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.