Visualize similar artist maps for musical artists in your library.
- Contents
- hosted on render, deployed by Gunicorn
--workers=2- speed may be limited by free tier hosting, can workers/threads be optimized for performance?
- source code for site is located on another repository, differences for deployment:
- define
serverin Dash app - set
Debug=False
- define
- Choose an Artist, then view it and its Similar Artists on an interactive network map. See images above.
- Artists are colored to indicate whether they are in or out of the library. Learn how artists you know are connected, and find other artists to explore.
- If a Similar Artist also has associated data, it will be added to the map, with the option to add even more similar artists: add neighbors
- Information for each connection is provided by hovering over its midpoint.
- Five network layout options are available, and a sixth, Random, produces a new result each time.
This section describes how data was prepared and visualized for Similar Artist Map. A detailed example is provided in two notebooks.
Note that packages were used in the notebooks that are not listed in requirements.txt, as they are not needed for the site's deployment
The data collection process is exemplified in detail in the example notebook. A brief overview is listed below, as well as some challenges.
- Gather list of musical artists from a library
- Query last.fm API to find up to 10 similar artists for each artist in library
- Save matches as JSON file
Some challenges were worked around rudimentarily, and could be improved by using last.fm API's search feature to properly match artists.
- if an artist was not found and contained
+or&, the symbols were replaced byandand the search was tried again- a list of alias names were saved to make data selection for graphing easier
- alias names were not extensively used to determine if a found similar artist was in or out of the library
- without using last.fm Search, I could not fix queries for obvious artists, and they were not found, ex:
Jay-Z - some similar artists with a perfect match score,
1, were simply- alternate names / alternate representations of names
Jay Dee<>J Dilla - closely related side-projects
MF Doom
- alternate names / alternate representations of names
Network Graphs of Artists, Similar Artists, and their match scores were created using NetworkX. Each artist was treated as a node and was connected to each of its similar artists by edges with weights related to match scores. When the networks were drawn, artist nodes were colored:
- special color for artist of interest
- another color for artists in library
- another color for artists not in library
Various network options are discussed and displayed in the example notebook, as well as code for plotting in matplotlib and Plotly. The interactive Plotly figures were easily integrated into the demonstration site, which is a Dash application.
- Create and activate a virtual environment in a directory
cd path/to/your/directory
python -m venv venv
. venv/bin/activate # UNIX
venv\Scripts\activate # Windows-
Copy source code into your directory
-
Install requirements via requirements.txt or install packages listed below without version specification
pip install -r requirements.txt-
Use sample artist data or generate your own data. Refer to Jupyter Notebooks for guidance. Artist data should be saved in the
/artist_data/directory. -
Run Dash application
python -m appOptional: Delete unneeded files and folders from your directory
dependencies of the listed packages are not provided, see requirements.txt for full list of packages installed


