Skip to content

Instantly share code, notes, and snippets.

View Mostafa-Samir's full-sized avatar

Mostafa Samir Mostafa-Samir

View GitHub Profile
var files = ['1', '2', '3'];
var result = waterfall(files, asyncTask);
result.then(console.log.bind(console));
//> ['1', '2', '3']
// This can be replaced by any async task that returns a promise
function asyncTask(path) {
return new Promise(function (resolve) {
resolve(path);
});
@bwhite
bwhite / rank_metrics.py
Created September 15, 2012 03:23
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np