Skip to content
Davide edited this page Sep 8, 2015 · 6 revisions

To use eval.py from CLI: spark-submit eval.py recommendationFile outputFile configuration.json

  • RecommendationFile: idomaar-format compliant file with a list of recommendation (check data format) e.g.:

recommendation 40 1362093742 {"reclen":5, "expected": {"evidences":[{"evidence":{"type":"rating","value":3}, "subject": {"type": "user", "id": 27}, "object": {"type": "movie", "id": "1024648"}},{"evidence":{"type":"purchase","value":1}, "subject": {"type": "user", "id": 27}, "object": {"type": "movie", "id": "1623205"}}]}} 76 {} [{"id":"1702439","rating":"7.5554733","rank":"1"},{"id":"1623205","rating":"7.3246436","rank":"2"},{"id":"1024648","rating":"7.1299243","rank":"3"},{"id":"1351685","rating":"6.6666665","rank":"4"},{"id":"1371111","rating":"6.464102","rank":"5"}]
recommendation 41 1362093742 {"reclen":5, "expected": {"evidences":[{"evidence":{"type":"rating","value":3}, "subject": {"type": "user", "id": 7}, "object": {"type": "movie", "id": "123"}}, {"evidence":{"type":"purchase","value":1}, "subject": {"type": "user", "id": 7}, "object": {"type": "movie", "id": "45"}}]} } {"subject":"user:7"} 76 {} [{"id":"1702439","rating":"7.5554733","rank":"1"},{"id":"1623205","rating":"7.3246436","rank":"2"},{"id":"1024648","rating":"7.1299243","rank":"3"},{"id":"1351685","rating":"6.6666665","rank":"4"},{"id":"1371111","rating":"6.464102","rank":"5"}]

  • outputFile: where to save the evaluation
  • configuration.json: [conf1,conf2,...] where conf1 =
  • {'mode':'precision@N', 'NList': [1,2,5,...]}
  • {'mode':'precision'}
  • {'mode':'recall@N', 'NList': [1,2,5,...]}