Mobile application for Decentralized ML POC: Spotify Recommendation
This repo contains mobile applications to perform training on Spotify listening history.
The applications (Android / iOS) share code from a Kotlin/Native library under
The Android application currently does not contain code to actually perform learning.
You will need the following:
- JDK & Gradle (for building shared library)
- Xcode 13+ (under Rosetta for M1 Macs)
sudo gem install cocoapods
- cocoapods-generate plugin:
sudo gem install cocoapods-generate
- A modified version of SwiftSyt:
swiftsyft-parcelright next to this repo root.
It is referenced in
shared, perform Gradle sync.
ios/App.xcworkspaceto run the app
Using the app
- Configure Spotify client ID and authorize your account
- Log into Spotify developer dashboard: https://developer.spotify.com/dashboard/applications
- Create an app. Any title would be fine.
- On the app detail page, record the Client ID displayed under the name of the app.
- Click “Edit Settings” to open the settings dialog. Under “Redirect URIs”, add
- Click “Users and Access” and add your own spotify account as a new user.
- Inside the app, next to “Spotify” > “Client ID”, tap “Change” and paste the Client ID obtained from the developer dashboard.
- Tap “Authorize” to test the Spotify authorization.
- Tap “Fetch” to retrieve your listening history.
- Authorize your Oasis account.
- Inside the app, tap “Authorize” under “Parcel”.
- Follow instructions on the screen to authorize the app to interact with Parcel on your behalf.
- Starting training
- Inside the app, tap “Train with API Data”.
- A new screen should show. Training will start automatically with output similar to this:
Data source: API Participant ID: 1 Data: 4067 tracks Model: spotify_recommendation Version: 1.0 connecting to ws://pygrid.dadtax.io:7001 Loading data, batch size = 64 Training... Uploading diff... Uploaded document <<document-id>> Reporting diff... Done