Git Product home page Git Product logo

training_song's Introduction

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 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

training_song's People

Contributors

dependabot[bot] avatar koayon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.