benhamner / Metrics

Machine learning evaluation metrics, implemented in Python, R, Haskell, and MATLAB / Octave
Other
1.63k stars 453 forks source link

wrong ap@k #51

Open MentalOmega opened 5 years ago

MentalOmega commented 5 years ago

After I run the code in my anaconda3

pip install ml_metrics Collecting ml_metrics Requirement already satisfied: numpy in /home/westwood/anaconda3/lib/python3.7/site-packages (from ml_metrics) (1.15.1) Requirement already satisfied: pandas in /home/westwood/anaconda3/lib/python3.7/site-packages (from ml_metrics) (0.23.4) Requirement already satisfied: python-dateutil>=2.5.0 in /home/westwood/anaconda3/lib/python3.7/site-packages (from pandas->ml_metrics) (2.7.3) Requirement already satisfied: pytz>=2011k in /home/westwood/anaconda3/lib/python3.7/site-packages (from pandas->ml_metrics) (2018.5) Requirement already satisfied: six>=1.5 in /home/westwood/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.5.0->pandas->ml_metrics) (1.11.0) Installing collected packages: ml-metrics Successfully installed ml-metrics-0.1.4

In the file

image

Is wrong !!!

And different with

image

TingNLP commented 5 years ago

Denominator seems error? https://medium.com/@pds.bangalore/mean-average-precision-abd77d0b9a7e

MegaYEye commented 4 years ago

Hi, the code for counting scores is also not consistent with https://web.stanford.edu/class/cs276/handouts/EvaluationNew-handout-1-per.pdf why using p not in predicted[:i]?