<jupyter_start><jupyter_text>Valence:  (x >= .50 => 176965) ,  (x >= .52  =>  142684), (x >= .60 => 41709) Energy:  (x >= .50 => 143239)  , (x >= .60  =>  66969) ,    (x >= .70 => 11272) Dance:    (x >= .50 => 115251) ,  (x >= .55  =>  23194) , (x >= .60 => 357) Acoustic:  (x >= .10 => 110334) ,  (x >= .20  =>  15501) ,  (x >= .30 => 72)  Good or Bad Playlist Based on Review and Personal Perspectives<jupyter_code>#lyrics = get_file(s3,'s3ssp',download_file='NLP_Data/master_lyrics_audio_features.csv',rename_file='0320_2020_nlp.csv')

audiofeatures = get_file(s3,'s3ssp',download_file='Analysis_Data/playlist_level_train_dataset.csv',rename_file='a_playlist_training_dataset.csv')


df1 = pd.read_csv(audiofeatures,sep='|')
df1





df1.count()
good_playlist_df_median = df1[(df1['valence']>=.45) & (df1['energy']>=.65) 
                              & (df1['danceability']>=.52)
                             ]
good_playlist_df_median.head()


good_playlist_df_median.describe()
df_copy = df1.copy()
df_bad = pd.concat([df_copy,good_playlist_df_median],sort=False)
df_bad_update = df_bad.drop_duplicates('playlist',keep=False)
df_bad_update.describe()
bad_playlist_df_median = df_bad_update[(df_bad_update['valence']<.45) | (df_bad_update['energy']<.65)  
                                          | (df_bad_update['danceability']<.52)
                             ]
bad_playlist_df_median.describe()
good_playlist_df_median['target'] = '1'
good_playlist_df_median.describe()
bad_playlist_df_median['target']='0'
bad_playlist_df_median.describe()
df_train = pd.concat([bad_playlist_df_median,good_playlist_df_median])
df_train.describe()
df_train.sample(5)
df_train.to_csv('new_master_train_playlist.csv',sep='|',index=False)
from s3 import upload_file
import boto3
s3 = boto3.resource('s3')
upload_file(s3,'s3ssp',upload_file='new_master_train_playlist.csv'
            ,rename_file='Analysis_Data/new_master_train_playlist.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16038696537678207, 'fraction_numerical': 0.06415478615071284, 'mean_word_length': 4.383561643835616, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '579697', 'license': 'MIT', 'n_tokens_mistral': 840, 'n_tokens_neox': 750, 'n_words': 95, 'path': '5_Machine_Learning/What_Makes_A_Good_Playlist.ipynb', 'repo_name': 'VintageGold/TSP', 'size': '1964'}