<jupyter_start><jupyter_text>**Mount Drive**<jupyter_code>from google.colab import drive
drive.mount('/content/drive')<jupyter_output><empty_output><jupyter_text>Install Kaggle and link your kaggle API with your drive: https://towardsdatascience.com/a-quicker-way-to-download-kaggle-datasets-in-google-collab-abe90bf8c866<jupyter_code>!pip install -q kaggle
!pip install -q kaggle-cli
!mkdir -p ~/.kaggle
!cp "/content/drive/MyDrive/Colab Notebooks/kaggle.json" ~/.kaggle/
!cat ~/.kaggle/kaggle.json 
!chmod 600 ~/.kaggle/kaggle.json
cd /content/drive/MyDrive/Projects<jupyter_output><empty_output><jupyter_text>**Download and Unzip dataset in your drive**<jupyter_code>!kaggle datasets download -d ziyangzhang666/song-data -p SongDataset
!unzip /content/drive/MyDrive/Projects/SongDataset/song-data.zip
pip install -U turicreate
import turicreate
songdata = turicreate.SFrame('/content/drive/MyDrive/Projects/SongDataset/song_data.sframe')
songdata
users = songdata['user_id'].unique()
len(songdata[songdata['artist']=='Kanye West'].unique())
len(songdata[songdata['artist']=='Foo Fighters'].unique())
len(songdata[songdata['artist']=='Taylor Swift'].unique())
len(songdata[songdata['artist']=='<NAME>'].unique())
len(users)
traindata,testdata = songdata.random_split(0.8,seed = 0)<jupyter_output><empty_output><jupyter_text>**SIMPLE POPULARITY BASED RECOMMENDER**<jupyter_code>popularitymodel = turicreate.popularity_recommender.create(traindata,
                                                           user_id = 'user_id',
                                                           item_id = 'song')
popularitymodel.recommend(users= [users[0]])<jupyter_output><empty_output><jupyter_text>**RECOMMENDER WITH PERSONALIZATION**<jupyter_code>personalizedmodel= turicreate.item_similarity_recommender.create(traindata,user_id='user_id',item_id='song')
personalizedmodel.recommend(users=[users[1]])
personalizedmodel.get_similar_items(['With Or Without You - U2'])<jupyter_output><empty_output><jupyter_text>**comparision**<jupyter_code>import matplotlib
%matplotlib inline
modelperformance = turicreate.recommender.util.compare_models(testdata,[popularitymodel,personalizedmodel],user_sample= 0.05)

fsongdata.groupby(key_column_names='artist', operations={'total_count': turicreate.aggregate.SUM('listen_count')}).sort('total_count',ascending = True)
subset_test_users = testdata['user_id'].unique()[0:10000]
personalizedmodel.recommend(subset_test_users,k=1)
songdata.groupby(key_column_names='song', operations={'count': turicreate.aggregate.COUNT()}).sort('count',ascending = False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14149504195270785, 'fraction_numerical': 0.010678871090770405, 'mean_word_length': 6.69208211143695, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '203795', 'license': 'MIT', 'n_tokens_mistral': 960, 'n_tokens_neox': 901, 'n_words': 109, 'path': 'SongRecommender.ipynb', 'repo_name': 'SatYu26/Song-Recommender-Model', 'size': '2625'}