Skip to content

Genre Classifier using K-means Clustering and K-Nearest Neighbors using Spotify Audio Features in Python

License

Notifications You must be signed in to change notification settings

austinchia/Genre_Classifier

Repository files navigation

Genre_classifier

This projects explores the use of machine learning methods such as K-means Clustering and K-Nearest Neighbors (K-NN) to predict an artist genre using audio features extracted from Spotify.

Calling Spotify API for Song Dataset, Finding Genres

  1. Genre_Finder.py
  2. Genre_Finder.ipynb
  3. Genre_Finder.html

Cleaning Dataset, K-Means Clustering and K-Nearest Neighbors Model

  1. Cleaning_and_ML.py
  2. Cleaning_and_ML.ipynb
  3. Cleaning_and_ML.html

Used the stats.shapiro function to test for assumptions of normal distributions in each song metric

image

Evaluating the best value of k for prediction accuracy

image

Plotting the Misclassification Error against the number of k neighbors

image

Confusion Matrix

image

Precision and recall values for each label

image

Total precision and recall

image

About

Genre Classifier using K-means Clustering and K-Nearest Neighbors using Spotify Audio Features in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published