Code Monkey home page Code Monkey logo

ice's Introduction

ice hockey playability prediction

background

Whenever it gets cold enough during the winter, I love to play ice hockey on the lakes in Potsdam, see bit.ly/eis_mt.
This hobby started 2012: Till Francke gave a course on numerical modelling in which we predicted ice thickness. I told about my ice skating experience (as model verification) and he invited me out to play.
Since then I’ve been logging the days we could play in this file (rightclick on “Raw” -> “Save target as…”).

predictive modelling

I’m always anxious about whether I get to play soon, so I wanted to create a computer model that predicts when the ice will hold. This should be mainly dependent on weather conditions and can be calibrated with the past playing dates.
With the rdwd package, we can easily get the weather data for the Potsdam climate station. Using this R function, we can see the days on which the ice was strong enough to play and compute the prediction correctness rate.
For a simple (yet very effective) model, I looked whether the previous 4 days all had a maximum temperature below zero.

This is good enough for me! I see some potentially missed chances in earlier years and the results of some aggressive advertising through our mailing list in the spirit of “the ice shall hold!” later on (we never broke through the ice).
So next time after two or three days of frost, I will be checking 10 different weather prognosis services - and yet probably be even more excited than I was in previous years.

vis

Here are the playable days (*) along with temperature:

play

You live near Potsdam and want to join? You can! Very much so!
Subscribe to the mailing list at bit.ly/eis_mt.

code

If you want to create a (better) prediction model, this code might be a nice starting point:

eistage <- read.table("Eishockey_Tage.txt", stringsAsFactors=FALSE)
eistage <- as.Date(eistage[,1])
source("icePlot.R")
icePlot(eistage, rep(TRUE, length(eistage)), main="Ice hockey rocks")

Check out the source code of this document if you want the weather data code and prediction model I used for the plot above.

caveats

The data in the first years is not as complete as in later years (especially 2012 when I was late to the party). With the increasing number of people in the mailing list, lag time decreased ^^. Also, in 2019 we discovered a pond that freezes much earlier than the lakes we played on previously (again, see bit.ly/eis_mt for the locations).
I did not play on all the days myself, but also recorded when other people from our mailing list were on.

Locations are available in the dataset as well and reflect ice formation. The ice on the shallow ponds is safe significantly earlier than on the deeper lakes.

The 4 day model was found by comparing the correct classification rate (CCR) for several days and with several temperature comparisons.

The cutoff at the end of March is somewhat arbitrary and affects CCR of course (during summer time it is easy to predict no ice). It has to be somewhere, so I just chose it. That’s how science works. Deal with it ;-). Or take the code and perform a significance analysis.

Licence: This entire project is under GPL3 (as are all my R packages). Feel free to copy, distribute, edit or enhance as you like, but please mention me as the original author.

Hire me if you think I did a good job coding this. I’m freelancing, see brry.github.io

Feedback is welcome, of course. File an issue or send an email as you like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.