Skip to content
/ orpheus Public

Training online classification model to learn individual music tastes w/ Spotify API

Notifications You must be signed in to change notification settings

shunr/orpheus

Repository files navigation

Orpheus

Node experiment for training an online classification model to learn individual music tastes using user feedback to 30-second Spotify previews.

preview

Installation

Clone this repo

git clone https://github.com/shunr/orpheus.git
cd code-curator

Install dependencies

npm install

Orpheus uses @ikegami-yukino's python implementation of OLL

pip install -r requirements.txt

Create configuration file

cp config.example.json config.json

Usage

npm start

Configuration

Configuration is done through the objects found in /config.json

config.spotify

Option Description
clientId Client id used to access Spotify API
clientSecret Client secret used to authenticate with Spotify API

config.db

Option Description
firstInitialization Orpheus generates a database of song metadata retrieved from Spotify to overcome rate limits. Required to be true on the first time running Orpheus, then should be set to false to improve startup speed.
storagePath Path to persistent JSON database
modelDirectory Directory used to store classification models for each user session

config.tracks

Option Description
minPopularity Integer from 1 to 100 representing minimum popularity of a song to be used as a training case.
tracksPerGenre Integer from 1 to 100 of tracks to fetch per genre. A higher number is recommended for accurate training results but will take longer to initialize
maxQueuedTracks Maximum number of tracks to play to a user
ignoredGenres Array of genre names to not include on initialization

config.hyperParams

These represent training hyperparameters used by the oll library. Tweak for possibly better results. CW should be optimal.

Features

Features need to be normalized from the data retrieved from Spotify API.

Good feature scaling

Optimization cab be done with feature objects in /feature_mapping.json. Generally, mean values should correspond to zero. For example, while loudness can range for -60 to 0 dB, the mean value is -8 and the feature should be normalized with this in mind.

Example feature

"loudness": {
  "min": -16,
  "max": 0,
  "key": 5,
  "icon": "volume up",
  "extremes": [
    "quiet",
    "loud"
  ]
}

About

Training online classification model to learn individual music tastes w/ Spotify API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published