Dream to Learn is shutting down...

We are very sorry to say that Dream to Learn will be shutting down as of December 28th, 2019. If you have content that you wish to keep, you should make a copy of it before that date.


2COMMENTS0RECOMMENDS

Self- and Super-organizing Maps in R: The kohonen Package (Part 2) - NHL Stats

70
POSTED IN: Data Analytics & Visualization Blog

NHL Stats - Regular Season 2013/2014 

Legends, Stars and Bench-Warmers....

OVERVIEW - these visualizations are created in R Programming Language and use a specific library (Kohonen) that is developed to ingest data sets and visualize the data.  Self Organizing Maps. 

and with commentary...

Source Code

  ## R Source Code - Ryan Anderson - Dream to Learn - May 1st 2014
  ## Playing around with supervised pattern recognition, and self organizing maps 
  ## Figured NHL player stats could be interesting (and can check if the viz is 'meaningful')
  #install.packages("kohonen")
  # Load the kohonen package 
  library("kohonen")
  setwd("C:/Users/Home/Documents/DTL Data Viz Community/Canada")
  players <- read.csv("HockeyStats2014CSV.csv")
  ## data source: http://sports.yahoo.com/nhl/stats/byposition?pos=C,RW,LW,D&conference=NHL&year=season_2013&qualified=1
  ## or here https://drive.google.com/file/d/0BwjxYjWyopXhWVM0N19zSExINzA/edit?usp=sharing (CSV)
  ## and with player names and teams https://drive.google.com/file/d/0BwjxYjWyopXhUWlHcGJzdS1ZVEk/edit?usp=sharing
  
  head(players)
  players.sc <- scale(players)
  set.seed(7)
  players.som <- som(players.sc, grid = somgrid(10, 6, "hexagonal"))
  plot(players.som, main = "NHL Player Stats - 2013/2014 - Regular Season")

-- end of code

Here is what data looked like on Yahoo Stats board - I removed the player name and team, and a few columns in CSV..

## From Kohonen library PDF Abstract... 

#  "In this age of ever-increasing data set sizes, especially in the natural sciences, visualisation
#  becomes more and more important. Self-organizing maps have many features
#  that make them attractive in this respect: they do not rely on distributional assumptions,
#  can handle huge data sets with ease, and have shown their worth in a large number of
#  applications. We highlight the kohonen package for R, which implements 
#  self-organizing maps and extensions for supervised pattern recognition and data fusion.

 

Interested in more content by this author?

About the Author

Ryan Anderson

Ryan Anderson

Hi! I like to play with data, analytics and hack around with robots and gadgets in my garage. Lately I've been learning about machine learning.

About this blog

Description is...<br/>Data Analytics & Visualization Blog - Generating insights from Data since 2013

Created: July 25, 2014

Englishfrançais

Up Next