An open API service indexing awesome lists of open source software.

https://github.com/alexandrelam/spotifyml

Neural Network Classifier guesses Spotify songs genre 🧠🎸🀘🎼
https://github.com/alexandrelam/spotifyml

neural spotify tensorflow

Last synced: about 2 months ago
JSON representation

Neural Network Classifier guesses Spotify songs genre 🧠🎸🀘🎼

Awesome Lists containing this project

README

          

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]





Logo

Neural Network for Spotify genre
(97% accuracy)



I built a neural network that guesses the genre of a music based on data
scrapped on Spotify!




Report Bug
Β·
Request Feature





![image](https://user-images.githubusercontent.com/25727549/150351115-159e7884-6637-41f8-8416-73dd69dc8576.png)

### Built With

- [Tensorflow](https://www.tensorflow.org/?hl=fr)
- [Keras](https://keras.io/)
- [Scikit-learn](https://scikit-learn.org/stable/)
- [Pandas](https://pandas.pydata.org/docs/index.html)
- [Numpy](https://numpy.org/)

(back to top)

## Results

![image](https://user-images.githubusercontent.com/25727549/150337874-c738bc4e-1e1f-4ca8-977e-690cb10c2bdf.png)

```
prediction: punk | real result: punk
prediction: country | real result: country

good/total: 28/30 - 93%
```

(back to top)

### Getting Started

#### Train the neural network

1. Install dependancies

```
pip install -r requirements.txt
```

2. Run

```
python train.py
```

3. Open the dashboard

```
tensorboard --logdir=logs
```

#### Run the test

1. Install dependancies

```
pip install -r requirements.txt
```

2. Change `NUMBER_VALUES` in `test.py`

3. Run!

```
python test.py
```

(back to top)

### Media

![image](https://user-images.githubusercontent.com/25727549/150351268-9e431d18-f281-47f6-b01e-b6dec1fb659a.png)

![image](https://user-images.githubusercontent.com/25727549/150351367-9bb9b308-5201-49e5-b9f0-8da06ad5d915.png)

![image](https://user-images.githubusercontent.com/25727549/150337784-b327c5b8-f9e1-4502-af85-032ff020e30d.png)

```
prediction: pop | real result: pop
prediction: rock | real result: rock
prediction: pop | real result: pop
prediction: edm | real result: edm
prediction: jazz | real result: jazz
prediction: electro | real result: electro
prediction: pop | real result: pop
prediction: rock | real result: rock
prediction: salsa | real result: salsa
prediction: chanson | real result: chanson
prediction: chanson | real result: hip hop
prediction: rock | real result: rock
prediction: hip hop | real result: hip hop
prediction: dance | real result: dance
prediction: pop | real result: pop
prediction: hip hop | real result: soul
prediction: jazz | real result: jazz
prediction: pop | real result: pop
prediction: hip hop | real result: hip hop
prediction: hip hop | real result: hip hop
prediction: pop | real result: pop
prediction: edm | real result: edm
prediction: dance | real result: dance
prediction: rock | real result: rock
prediction: disco | real result: disco
prediction: rock | real result: rock
prediction: country | real result: country
prediction: blues | real result: blues
prediction: punk | real result: punk
prediction: country | real result: country

good/total: 28/30 - 93%
```

(back to top)

### Roadmap

- [x] with a long training acc should be ok, but test dataset has low acc. maybe it's overtraining...

### Things to try

- [x] change the model (layers, categorical to binary?)
- [x] drop some col on the dataset that are useless
- [x] check normalization

(back to top)

[contributors-shield]: https://img.shields.io/github/contributors/alexandrelam/spotifyml.svg?style=for-the-badge
[contributors-url]: https://github.com/alexandrelam/spotifyml/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/alexandrelam/spotifyml.svg?style=for-the-badge
[forks-url]: https://github.com/alexandrelam/spotifyml/network/members
[stars-shield]: https://img.shields.io/github/stars/alexandrelam/spotifyml.svg?style=for-the-badge
[stars-url]: https://github.com/alexandrelam/spotifyml/stargazers
[issues-shield]: https://img.shields.io/github/issues/alexandrelam/spotifyml.svg?style=for-the-badge
[issues-url]: https://github.com/alexandrelam/spotifyml/issues
[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge
[license-url]: https://github.com/alexandrelam/spotifyml/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[product-screenshot]: images/screenshot.png