We show a lot of cool code and models on this site. Learn how to use them yourself.
What is science if you can't reproduce it? Why show models with claims of conquering the odds if you can't verify them?
Here at DecodedSports, our goal is simply to Decode the models, Decode the research, Decoded the code. This means, anywhere you see code on this site, we offer a few ways for you to dive and get your hands dirty with the models yourself.
You don't have to have a Masters of Science in Computer Science from top schools or a career of data analysis experience to begin. Simply hit the F12 key on your keyboard and start hacking, hero!
This gives you access to an advanced, in-browser suite of developer tools where you'll use the "Console" tab to run all of our examples.
The code we show in our examples is the same code we use in production, meaning it is already loaded into the browser for you to use without having to copy/paste anything.
function random_int(min, max) {
// Returns random num, min <= i <= max
const i = Math.random() * (max - min + 1);
return Math.floor(i) + min;
}
random_int(10, 99);
>>> 23
You can now try the executing the function yourself in your Developer Tools browser menu by typing "random_int(10, 99)" and pressing 'enter'.
JavaScript is the language of choice for browsers (i.e. the only one that works). We use Python in our server-side code and then translate applicable code to JavaScript for demonstration in our blog.
When we do this, we make every attempt to keep the translation as simple as possible by avoiding language specific constructs so readers can translate it back easily, if they want.
Long term, we plan to release these examples as a GitHub repo that will have both language versions.