sure enoughthe benchmark dataset that we will be using contains only the first seconds of each songso that we would not need to cut off the last percent we do it neverthelessso that our code works on other datasets as wellwhich are most likely not truncated similar to our work with fftwe certainly would also want to cache the oncegenerated mfcc features and read them instead of recreating them each time we train our classifier this leads to the following codedef write_ceps(cepsfn)base_fnext os path splitext(fndata_fn base_fn cepsnp save(data_fncepsprint("written %sdata_fndef create_ceps(fn)sample_ratex scipy io wavfile read(fncepsmspecspec mfcc(xwrite_ceps(cepsfndef read_ceps(genre_listbase_dir=genre_dir)xy [][for labelgenre in enumerate(genre_list)for fn in glob glob(os path joinbase_dirgenre"ceps npy"))ceps np load(fnnum_ceps len(cepsx append(np meanceps[int(num_ceps* / ):int(num_ceps* / )]axis= ) append(labelreturn np array( )np array(