Skip to main content

Audio Motivation for Data Scientists and ML Engineers

Project description

Training Song

Tests Package version Supported Python versions

Description

Plays a Billboard Number 1 song corresponding to how accurate your ML model is.

For example if your model is 95.5% accurate then you will hear the number 1 song from 50% through 1995 (Vogue by Madonna 👑).

Take your metrics from A Hard Day's Night (64%) to Mo Money Mo Problems (97%).

How to use

Once you've trained your model, simply wrap your metric in ts(..) as follows:

from trainingsong.core import ts

model.fit(X_train, y_train)
y_pred = model.predict(X_test)

accuracy = ts(accuracy_score(y_test, y_pred))

>> Congrats your model got an accuracy of 92 percent!
>> The Number 1 song 92.0% through the 1900s on the hot-100 chart was
   Black Or White by Michael Jackson.
>> The date was 1992-01-01 and the song was on the chart for 7 weeks.

Installation

Use the package manager pip to install trainingsong.

pip install training-song

Local Development

The API docs can be found here

You can install the development dependencies with:

poetry install

And you can run the tests using

poetry run pytest

Before committing, please run the following to run the tests:

tox

It's recommended to use uvicorn to run the server locally, which is installed as a dependency.

Please create a Postgres database and set the DATABASE_URL as an environment variable in the .env file. The db.py file defines the schema and gives a function to create the table.

Additionally if you're editing the main API then you will need to create a Spotify app and set include the CLIENT_ID and CLIENT_SECRET as environment variables. In this case you will also need to setup a Vercel account and deploy the API to it. Then you can use the Vercel CLI to run the server locally.

vercel .

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Acknowledgements

Thanks to Spotify for the API and Billboard for the data.

Substack

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

training_song-0.2.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

training_song-0.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file training_song-0.2.1.tar.gz.

File metadata

  • Download URL: training_song-0.2.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1038-azure

File hashes

Hashes for training_song-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e8f3c69d6571067886f055f1fccab70c27722109b2491071a487344be99992f2
MD5 43e97e861fb93ee120b6d1821de9f333
BLAKE2b-256 83229972f998e2822e5ff978f362e4c9d1687b0e5640196fa08565bad03fc6fb

See more details on using hashes here.

File details

Details for the file training_song-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: training_song-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1038-azure

File hashes

Hashes for training_song-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8d2ff2fd7ec4a4dbdc049bec5ab921d3ef06071b79aabab303d347a54b76186
MD5 93b6063f137df8f23c7614aeffaa8e9a
BLAKE2b-256 70c92d0fde069cca7d59ed50541c840b48651209f1b0ab97e5ea8eacb2b907ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page