{"id":22089524,"url":"https://github.com/fatihilhan42/spotify-songs-recommendations-system_with_python","last_synced_at":"2026-05-02T15:35:59.669Z","repository":{"id":50735525,"uuid":"519998236","full_name":"fatihilhan42/Spotify-Songs-Recommendations-System_with_python","owner":"fatihilhan42","description":"We developed a song recommendation system for the user with the data we received from our Spotify song dataset. Data set and other applications are given in the description. Have a nice day.","archived":false,"fork":false,"pushed_at":"2022-08-01T07:06:31.000Z","size":5653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T06:24:56.284Z","etag":null,"topics":["data-analysis","data-science","data-visualization","jupyter-notebook","python","recommendation-engine","recommendation-system"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fatihilhan42.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-08-01T06:54:57.000Z","updated_at":"2022-10-27T10:54:09.000Z","dependencies_parsed_at":"2022-09-02T18:42:03.604Z","dependency_job_id":null,"html_url":"https://github.com/fatihilhan42/Spotify-Songs-Recommendations-System_with_python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihilhan42%2FSpotify-Songs-Recommendations-System_with_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihilhan42%2FSpotify-Songs-Recommendations-System_with_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihilhan42%2FSpotify-Songs-Recommendations-System_with_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihilhan42%2FSpotify-Songs-Recommendations-System_with_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fatihilhan42","download_url":"https://codeload.github.com/fatihilhan42/Spotify-Songs-Recommendations-System_with_python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245181548,"owners_count":20573718,"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":["data-analysis","data-science","data-visualization","jupyter-notebook","python","recommendation-engine","recommendation-system"],"created_at":"2024-12-01T02:13:11.839Z","updated_at":"2026-05-02T15:35:59.641Z","avatar_url":"https://github.com/fatihilhan42.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spotify-Songs-Recommendations-System_with_python\nWe developed a song recommendation system for the user with the data we received from our Spotify song dataset. Data set and other applications are given in the description. Have a nice day.\n\n### import\n```Python\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport plotly.express as px\nimport plotly.graph_objects as go\nimport matplotlib.pyplot as plt\nimport plotly\nfrom sklearn.preprocessing import StandardScaler\nfrom scipy.spatial import distance\nimport copy\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nplotly.offline.init_notebook_mode (connected = True)\n```\n## Having First Look At The Data\n```Python\ndata.head()\n```\n![image](https://user-images.githubusercontent.com/63750425/182090399-8e159e3d-3d1e-43ff-8245-c5b15ee6d7ab.png)\n\n```Python\ncols=list(data.columns[11:])\ndel cols[7]\ndf=copy.deepcopy(data)\ndf.drop(columns=cols,inplace=True)\nsns.set(style=\"ticks\", context=\"talk\")\nplt.style.use(\"dark_background\")\nsns.pairplot(df,corner=True,hue='genre')\n```\n![image](https://user-images.githubusercontent.com/63750425/182090600-c2f2a269-a620-4713-9e73-24de868673d1.png)\n\n```Python\npx.box(data_frame=data,y='duration_ms',color='genre')\n```\n\n![image](https://user-images.githubusercontent.com/63750425/182090680-c7bfbc15-c9e6-452b-b1d1-238a0a8b99e1.png)\n\n```Python\nx=list(data.corr().columns)\ny=list(data.corr().index)\nvalues=np.array(data.corr().values)\nfig = go.Figure(data=go.Heatmap(\n    z=values,\n    x=x,\n    y=y,\n                   \n    \n                   hoverongaps = False))\nfig.show()\n```\n\n![image](https://user-images.githubusercontent.com/63750425/182090778-fa40ff7b-3a02-4ad1-9285-1567701f17c1.png)\n\n## Let's Make A Recommendation System\n\n```Python\ndata=data.dropna(subset=['song_name'])\n```\n\n## Creating a new dataframe with required features\n\n\n\n\n```Python\n# Making a weight matrix using euclidean distance\ndef make_matrix(data,song,number):\n    df=pd.DataFrame()\n    data.drop_duplicates(inplace=True)\n    songs=data['song_name'].values\n#    best = difflib.get_close_matches(song,songs,1)[0]\n    best=find_word(song,songs)\n    print('The song closest to your search is :',best)\n    genre=data[data['song_name']==best]['genre'].values[0]\n    df=data[data['genre']==genre]\n    x=df[df['song_name']==best].drop(columns=['genre','song_name']).values\n    if len(x)\u003e1:\n        x=x[1]\n    song_names=df['song_name'].values\n    df.drop(columns=['genre','song_name'],inplace=True)\n    df=df.fillna(df.mean())\n    p=[]\n    count=0\n    for i in df.values:\n        p.append([distance.euclidean(x,i),count])\n        count+=1\n    p.sort()\n    for i in range(1,number+1):\n        print(song_names[p[i][1]])\n ```\n \n ```Python\na=input('Please enter The name of the song :')\nb=int(input('Please enter the number of recommendations you want: '))\nmake_matrix(df,a,b)\n ```\n \n ![image](https://user-images.githubusercontent.com/63750425/182091192-e953dbb6-f896-4d93-bdf9-1e7ad7176115.png)\n ```Python\ndef make_matrix_correlation(data,song,number):\n    df=pd.DataFrame()\n    data.drop_duplicates(inplace=True)\n    songs=data['song_name'].values\n#    best = difflib.get_close_matches(song,songs,1)[0]\n    best=find_word(song,songs)\n    print('The song closest to your search is :',best)\n    genre=data[data['song_name']==best]['genre'].values[0]\n    df=data[data['genre']==genre]\n    x=df[df['song_name']==best].drop(columns=['genre','song_name']).values\n    if len(x)\u003e1:\n        x=x[1]\n    song_names=df['song_name'].values\n    df.drop(columns=['genre','song_name'],inplace=True)\n    df=df.fillna(df.mean())\n    p=[]\n    count=0\n    for i in df.values:\n        p.append([distance.correlation(x,i),count])\n        count+=1\n    p.sort()\n    for i in range(1,number+1):\n        print(song_names[p[i][1]])\n  ```\n ```Python\ne=input('Please enter The name of the song :')\nf=int(input('Please enter the number of recommendations you want: '))\nmake_matrix_correlation(df,e,f)\n  ```\n  \n  ![image](https://user-images.githubusercontent.com/63750425/182091405-fb736d12-bf27-439a-a0a1-5b4276539b08.png)\n\n## See you on other data science projects. Take care of yourselves:)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatihilhan42%2Fspotify-songs-recommendations-system_with_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffatihilhan42%2Fspotify-songs-recommendations-system_with_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatihilhan42%2Fspotify-songs-recommendations-system_with_python/lists"}