A Look at Twitter's "Peak Detection Algorithm"

StaffApplicationDevelopmentNews, Developer & Design

Share this Post

"We used peak detection algorithm to detect spikes and snap goals to the closest spikes," explained Krist Wongsuphasawat (@kristw), a Twitter Data Scientist who works on data visualization at Twitter. "There are many ways we can measure “excitement”. Using raw number of Tweets could be one way, but we chose to normalized the data such that each goal is measured as a percentage of total Tweets in that game, in order to make the goals comparable across the entire tournament. Otherwise, any goal in later matches will easily beat the group stage goals, as those matches attract many more viewers. However, using percentage overcompensated for the matches with fewer viewers so we had to add another weight to adjust the value based on total volume in a match."

Twitter likes to use popular events to illustrate the power of their platform and more importantly the power of their data. Data visualization is a way to bring Twitter's enormous amount of data to the surface and make it meaningful.

"With Twitter we can gauge the excitement caused by each goal during #EURO2016 by looking at the spikes in Tweet volume after each goal," Wongsuphasawat said. "The greater the spike, the more reaction it inspired among fans. This visualization shows every goal of EURO, when it happened, who scored it, how it affected the score, and the corresponding reaction on Twitter."

Krist Wongsuphasawat elaborates:

The excitement level of a goal can be due to many factors, as you’ll see in the viz:

  • Impact: How much a goal affects the course of the game can determine the reactions to it. Goals that takes the lead are indicated in red, and in general caused more excitement (higher spikes).
  • Timing: Goals closer to the end of the game tend (towards the right side of the viz) to have higher spikes. For example, double goals from France duo Griezmann and Payet in the 90’ and 90+6’ minutes against Albania.
  • Beauty: Slovakia’s Marek Hamsik’s thunderous strike from a tight angle against Russia hits the inner post and bounce in. Totally worth watching over and over.
  • Surprise: Underdog goals seem to also get fans excited and cause outsize reactions. For example, McGinn’s goal which gave N. Ireland its first win in major tournament, and Iceland’s winning goal in the last match of group stage both had notable spikes.

Here are some ways you can navigate the viz:

  • Hover (desktop) / Tap on (mobile) any goal to see all the goals from that match.
  • Filter matches by team, to see every goal they scored or conceded throughout the tournament. Goals scored by the team are highlighted in yellow.
  • Filter matches by stage, to see only the knockout or group stage goals.
  • Filter goals by name, to find goals from player you are interested in.
  • Combine the filters above
WebProNews | Breaking eBusiness News