{"id":26681176,"url":"https://github.com/okerx/spotifymoods","last_synced_at":"2026-05-09T14:40:54.648Z","repository":{"id":57470269,"uuid":"443770664","full_name":"okerx/spotifymoods","owner":"okerx","description":"A simple ML model to classify Spotify tracks using audio features.","archived":false,"fork":false,"pushed_at":"2022-01-16T08:36:48.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-15T10:55:10.339Z","etag":null,"topics":["machine-learning","pandas","python","scikit-learn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okerx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-02T13:18:13.000Z","updated_at":"2022-04-14T15:04:43.000Z","dependencies_parsed_at":"2022-09-19T10:02:15.806Z","dependency_job_id":null,"html_url":"https://github.com/okerx/spotifymoods","commit_stats":null,"previous_names":["ammar-oker/spotifymoods"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okerx%2Fspotifymoods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okerx%2Fspotifymoods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okerx%2Fspotifymoods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okerx%2Fspotifymoods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okerx","download_url":"https://codeload.github.com/okerx/spotifymoods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245605719,"owners_count":20643030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","pandas","python","scikit-learn"],"created_at":"2025-03-26T07:14:29.879Z","updated_at":"2026-05-09T14:40:54.608Z","avatar_url":"https://github.com/okerx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spotifymoods\n \nA simple ML model to classify Spotify tracks using audio features.\n\n## Installation\n```shell\npip install spotifymoods\n```\n\n## Usage\n### Train the model\n```python\nimport pandas as pd\nfrom spotifymoods import train\n\n# create a Pandas DataFrame from the file 'training_data.csv'\ntrain_data = pd.read_csv('training_data.csv')\n\n# save the trained model to the files 'trained_model.pkl' \u0026 'scaled.pkl'\ntrain(data=train_data, trained_output='trained.pkl', scaled_output='scaled.pkl')\n```\n\n\n### Predict moods\n```python\nimport pandas as pd\nfrom spotifymoods import predict\n\n# create a Pandas DataFrame from the file 'test_data.csv'\ntest_data = pd.read_csv('test_data.csv')\n\n# use the trained model from the files 'trained.pkl' \u0026 'scaled.pkl', and return the results as DataFrame\nresult = predict(data=test_data, trained_path='trained.pkl', scaled_path='scaled.pkl')\n\n# output the results to a .csv file\nresult.to_csv('result.csv', index=False)\n```\n\n### CSV data examples\n``training_data.csv``\n```text\nenergy,liveness,tempo,speechiness,acousticness,instrumentalness,danceability,duration_ms,loudness,valence,id,mood\n0.549,0.22,130.749,0.0698,0.000798,0.00485,0.357,244573,-7.843,0.531,3kdMzXOcrDIdSWLdONHNK5,Energetic\n0.975,0.16,129.022,0.0618,5.13e-05,0.713,0.594,205760,-3.21,0.899,3rFEKOClXOdNFO6fQGuQ9j,Energetic\n```\n\n``test_data.csv``\n```text\nenergy,liveness,tempo,speechiness,acousticness,instrumentalness,danceability,duration_ms,loudness,valence,id\n0.549,0.22,130.749,0.0698,0.000798,0.00485,0.357,244573,-7.843,0.531,3kdMzXOcrDIdSWLdONHNK5\n0.975,0.16,129.022,0.0618,5.13e-05,0.713,0.594,205760,-3.21,0.899,3rFEKOClXOdNFO6fQGuQ9j\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokerx%2Fspotifymoods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokerx%2Fspotifymoods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokerx%2Fspotifymoods/lists"}