kavgan / nlp-in-practice

Starter code to solve real world text data problems. Includes: Gensim Word2Vec, phrase embeddings, Text Classification with Logistic Regression, word count with pyspark, simple text preprocessing, pre-trained embeddings and more.
http://kavita-ganesan.com/kavitas-tutorials/#.WvIizNMvyog
1.14k stars 785 forks source link

label_ranking_average_precision_score #3

Closed shantanuo closed 4 years ago

shantanuo commented 5 years ago

mrr has been implemented as a class in sklearn called "label_ranking_average_precision_score".

https://scikit-learn.org/stable/modules/generated/sklearn.metrics.label_ranking_average_precision_score.html

The code in "Text Classification with Logistic Regression.ipynb" file will be much shorter if it is used.

shantanuo commented 5 years ago

Here is a simplified version: https://gist.github.com/shantanuo/d2cbbe4f77e0eba880010ef9bbadf82f