Training Song
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 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
Metadata
Release files for training-song 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| training_song-0.2.2.tar.gz | 10.9 kB | Without provenance | Details for training_song-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| training_song-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for training_song-0.2.2-py3-none-any.whl |
Total release size: 23.4 kB
Release files / training_song-0.2.2.tar.gz
| Download URL | training_song-0.2.2.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ca177cb362b14ec51f2368bb6e7549fa0a161e124a812e9d8e7fff558a44b9b
|
|
BLAKE2b-256 checksum How to use checksums |
f32a970d81b55512a6d1611bcc759b7821b48d50f59eb47bd51f9c04e06ff7ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.12 Linux/5.15.0-1039-azure
|
Release files / training_song-0.2.2-py3-none-any.whl
| Download URL | training_song-0.2.2-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53be205f9d761d094db4aa8129008b9f4dac6be10ec3c0219cbc19babb5defa4
|
|
BLAKE2b-256 checksum How to use checksums |
c4e0505f966396129a41e5fc569035f7e40909738f5b577802faf55bd2755713
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.12 Linux/5.15.0-1039-azure
|
Security for training-song 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.