Machine learning for climbing grades

Conventional assessment of route difficulty for rock climbing is a subjective process. A small number of people (often just one) assign a level for a particular route, and there isn’t really a process for refining grades once they’ve been assigned (it’s just one opinion vs another). Most of the grading systems are on an ordinal scale, which means you can put the grades in order but the difference or ratio between grades isn’t meaningful. Intentional biases are even part of climbing culture.

To address these problems, I developed a statistical model for grading rock climbing routes. It uses ratings parameters for the difficulty of the routes and the performance of the climbers to predict ascent outcomes. The difference in ratings between a climber and a route determines the probability the climber will ascend the route “successfully” (which loosely means getting to the top without weighting a rope or other mechanical devices). It’s based on a dynamic Bradley-Terry model, which is a common model for game and sports rating systems such as Elo, Glicko-2, and WHR.

While the model provides a mathematical theory for predicting ascent outcomes based on ratings parameters, it’s not useful in practice without a process for estimating the parameters. So I implemented a machine learning algorithm for estimating the parameters, based on the Whole-History Rating algorithm. This is a fast algorithm that uses second-order (Newton-Raphson) optimization for finding the maximum a posteriori estimates of the model parameters. This implementation is available as a free, open-source software package at the climbing ratings project on github.

So, how did it perform? With the help of theCrag.com, I fitted the model to hundreds of thousands of ascents from Australia. The output ratings were closely correlated with the conventional (subjectively-assigned) grades. This is an important result because it shows the principles of science (using observations to make testable predictions about the world) can be applied to grading climbs. I’ve published a more formal write-up of the results in the academic paper: Estimation of Climbing Route Difficulty using Whole-History Rating, and a layman’s explanation in the climbing magazine Vertical Life.

The real value for climbers came when theCrag.com integrated the machine learning model into their website, to produce grades for the thousands of routes where they have sufficient ascent data. The machine-learned grades are available on the route description page under the grade citations as “grAId”, alongside the grades from guidebooks. Sometimes the machine-learned grade and the conventional grade differ, suggesting the conventional grade was inconsistent with climbers’ actual ascent experiences. This sparked some debate, but it also provided some valuable feedback and opportunities for improvements.

I’m now starting to plan out the next steps from a technical perspective. Get in contact if you have ideas!

Silencing the Ergodox EZ

Even after modifying my switches with silicone and dental floss, I still wasn’t satisfied with the noise of my Ergodox EZ. The dampened upstrokes were still causing a reverberation that I determined was coming from the Ergodox EZ case/PCB itself.

The Ergodox EZ CIY case has an integrated plate-mount design (where the “plate” is just part of the ABS upper shell), which is a design that’s notorious for producing reverb. The case is also very hollow, with 1–3mm gaps above the PCB and 2–4mm gaps below it. This all contributed to a mid-range “thonk” around 1kHz on upstrokes.

I successfully dampened the “thonk” sound by adding neoprene foam and rubber. This cost less than $10 (AUD) in materials and took about 90 minutes.

photo of Ergodox EZ top case with neoprene rubber strips
Top-half of the Ergodox EZ with 1.5mm neoprene rubber strips inserted in between columns.

Continue reading “Silencing the Ergodox EZ”

Ergodox coding layer layout

I’ve previously written about the Ergodox EZ and the difficulty of where to place all those pesky right-pinky keys that don’t fit, and how to make those symbols (many of which are frequently used for coding) convenient to access.

Before jumping into my solution, let’s review other popular ideas:

  • ZSA’s default Ergodox layout has square brackets on the bottom row of the base layer, and various parens/brackets on the left middle and index columns on a “symbols” layer. The symbols layer is activated with the pinkies. = is in heaps of places: top-right of the base layer, and in layer 1 next to the layer 1 toggles.
  • BEAKL 15 places various bracket-like symbols on the AltGr layer, using the ring and index fingers of both hands. = is on the right middle finger, home row. The AltGr key is on the right thumb.

My solution is a coding layer:

diagram of right-hand key assignments on an ergodox keyboard

The left thumb’s space key acts as a layer modifier for the coding layer while held. The coding layer adds a shift modifier to all the numbers (except 9 and 0, which become square brackets instead of parentheses), and also changes the right hand to have the following layout (where ()=⏎ are the home positions):

&*[]⌫
0{}\/
()=⏎-
!":>+

I think this works better for modern programming languages (C, C++, Java, Javascript, Python, Ruby, Swift) than the ZSA and BEAKL layouts. It optimizes frequent bigrams and trigrams by making them rollable without releasing the layer modifier. For example, ␣{⏎ is a single-direction roll, as are ():⏎ (think Python!), ␣=> (think Javascript arrow functions), ({, }), )⏎ and }⏎. The frequent trigram ␣=␣, while not a continuous roll, is all on home-positions. The layout also complements Dvorak’s left hand symbols: );⏎ can be timed as one stroke.

Subtly, these placements are meant to feel familiar to Dvorak users. I have short pinkies, so I type [0] on Dvorak by moving my whole hand slightly then hitting middle-index-ring with a single stroke; the same can be done with this layout. Similarly, I hit = on Dvorak with my ring finger; it’s still the same finger, but the home-row placement reflects the high frequency of “ = ” in code. Having \ and on the right pinky should also feel very familiar.

I think the layer modifier is also better placed (on the thumb rather than the pinkies) compared to ZSA’s layouts. This leaves all the other left hand fingers in relatively comfortable positions, and space is already covered by the right thumb. I take advantage of this by using the left-hand home positions for modifier keys.

diagram showing an ergodox keyboard layout for the left hand

Of course, my typing preferences aren’t the same as everyone else. This layout is certainly not “balanced” (it’s biased to typing characters with the right hand), and it really emphasizes the efficiency of strokes and rolls rather than penalizing finger movement. It doesn’t perform amazingly with conventional BEAKL penalties.

You can check out my QMK branch from github for the source code, or download the compiled firmware directly (it’s Oryx-compatible!).

Edit 2020-10-28: this is actually v2 of the coding layer, this post previously described a slightly different layout.