Skip to content

Instantly share code, notes, and snippets.

@thebabush
Created May 7, 2016 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebabush/836c9ea23ff3ff1cb42c73976699810c to your computer and use it in GitHub Desktop.
Save thebabush/836c9ea23ff3ff1cb42c73976699810c to your computer and use it in GitHub Desktop.
Kaggle Private Leaderboard Re-evaluation
/**
* Replace CSV download links with urls to re-evaluate the past submission.
* Basically, you can get the private leaderboard score without re-uploading the file.
*
* USAGE:
* 1) Copy this script and change COMPETITION_URL accordingly
* 2) Go to "My Submissions" page
* 3) Open the Developer Console
* 4) Paste the script and execute it
* 5) Click on the links to open new tabs :)
*
* Author: Paolo Montesel
* License: https://opensource.org/licenses/MIT
* Copyright 2016
*
*/
var COMPETITION_URL = "https://www.kaggle.com/c/santander-customer-satisfaction/leaderboard?submissionId=";
function xp(t){for(var e=[],n=document.evaluate(t,document,null,XPathResult.ANY_TYPE,null),u=n.iterateNext();u;)e.push(u),u=n.iterateNext();return e}
xp("//a[@class='file']").forEach(function (link) {
link.href = COMPETITION_URL + link.href.match(/\d+/)[0];
});
@thebabush
Copy link
Author

Or just make a bookmarklet with this code inside:
javascript:void%20function(){function%20t(t){for(var%20e=[],a=document.evaluate(t,document,null,XPathResult.ANY_TYPE,null),n=a.iterateNext();n;)e.push(n),n=a.iterateNext();return%20e}var%20e=%22https://www.kaggle.com/c/santander-customer-satisfaction/leaderboard%3FsubmissionId=%22;t(%22//a[%40class='file']%22).forEach(function(t){t.href=e+t.href.match(/\d+/)[0]})}();

(This is because typing "javascript:" in Chrome's url bar doesn't work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment