Created
April 11, 2015 09:22
-
-
Save tokoroten/1eb8cf801d372b829aba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.kaggle.com/c/otto-group-product-classification-challenge/details/evaluation | |
def print_kaggle_score(label_list, proba_result): | |
label_index = sorted(list(set(label_list))) | |
score = - 1.0 / len(label_list) * sum( | |
[ | |
math.log( | |
max(min( | |
proba_result[i][label_index.index(label_list[i])] | |
/ sum(proba_result[i]) | |
, | |
1 - 1e-15 | |
), | |
1e-15) | |
) | |
for i in xrange(len(label_list)) | |
] | |
) | |
print "kaggle_score=", score |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment