added code and report

parents
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import scipy.io as sp\n",
"from scipy.fftpack import fft\n",
"from scipy.io import wavfile # get the api\n",
"import sunau;\n",
"import librosa\n",
"import librosa.display\n",
"import pandas\n",
"import os\n",
"np.set_printoptions(suppress=True)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def writeMatrixToFile(self,filename,matrix):\n",
" np.save(filename, matrix);\n",
" os.rename(filename+\".npy\", filename+\".txt\");\n",
" print(\"Written successfully..\");\n",
" pass;\n",
" \n",
"def loadMatrixFromFile(self,filename): \n",
" matrix=None;\n",
" if(os.path.isfile(filename)):\n",
" matrix=np.load(filename); \n",
" return matrix;\n",
"\n",
"def readCSVFile(file):\n",
" data=pandas.read_csv(file,\",\",header=0, na_values='?', skipinitialspace=True);\n",
" return data;\n",
" pass;"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"class PreProcessing:\n",
" filename=None;\n",
" y=None;\n",
" sr=None;\n",
" log_enabled=True;\n",
" centroid=None;\n",
" spectro=None;\n",
" spectro_phase=None;\n",
" max_sample_vector_size=660000; \n",
" duration=30;\n",
" def __init__(self,filename,duration=30):\n",
" #self.log(filename);\n",
" self.filename=filename;\n",
" self.reloadAudioFile(duration);\n",
" self.duration=duration;\n",
" pass;\n",
" \n",
" def reloadAudioFile(self,duration=30):\n",
" self.y, self.sr = librosa.load(self.filename,duration=duration);\n",
" self.y=self.y[:self.max_sample_vector_size];\n",
" pass;\n",
" \n",
" #Short-Term-Fourier trasform\n",
" def getSTFT(self):\n",
" self.stft=librosa.stft(y=self.y);\n",
" return self.stft;\n",
" pass;\n",
" \n",
" #spectro graph\n",
" def getSpectrogram(self):\n",
" stft=self.getSTFT();\n",
" self.spectro, self.spectro_phase = librosa.magphase(stft); \n",
" return self.spectro, self.spectro_phase;\n",
" pass;\n",
" \n",
" def getCentroid(self):\n",
" self.centroid=librosa.feature.spectral_centroid(y=self.y,sr=self.sr);\n",
" return self.centroid; \n",
"\n",
" def getSpectralRolloff(self):\n",
" self.rolloff=librosa.feature.spectral_rolloff(y=self.y, sr=self.sr);\n",
" return self.rolloff;\n",
" \n",
" def getZeroCrossing(self):\n",
" self.zero_crossing_rate=librosa.feature.zero_crossing_rate(self.y);\n",
" return self.zero_crossing_rate;\n",
" \n",
" def getSpectralContrast(self):\n",
" #Jiang, Dan-Ning, Lie Lu, Hong-Jiang Zhang, Jian-Hua Tao, and Lian-Hong Cai. “Music type classification by spectral contrast feature.” In Multimedia and Expo, 2002. ICME‘02. Proceedings. 2002 IEEE International Conference on, vol. 1, pp. 113-116. IEEE, 2002.\n",
" S = np.abs(self.getSTFT());\n",
" self.contrast = librosa.feature.spectral_contrast(S=S, sr=self.sr);\n",
" return self.contrast;\n",
" \n",
" def getMFCC(self):\n",
" self.mfcc = librosa.feature.mfcc(y=self.y, sr=self.sr, hop_length=512, n_mfcc=13);\n",
" return self.mfcc;\n",
" \n",
" def getChroma(self):\n",
" self.chroma = librosa.feature.chroma_stft(y=self.y,sr=self.sr,hop_length=512)\n",
" return self.chroma\n",
" \n",
" def getMelSpec(self):\n",
" self.mel=librosa.feature.melspectrogram(y=self.y, sr=self.sr,n_mels=10);\n",
" return self.mel;\n",
" \n",
" def getRMS(self):\n",
" self.rms=librosa.feature.rms(y=self.y);\n",
" return self.rms;\n",
"\n",
" def drawRMS(self):\n",
" rms=self.getRMS();\n",
" S,phase=self.getSpectrogram();\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" plt.semilogy(rms.T, label='RMS Energy')\n",
" plt.xticks([])\n",
" plt.xlim([0, rms.shape[-1]])\n",
" plt.legend(loc='best')\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),y_axis='log', x_axis='time')\n",
" plt.title('log Power spectrogram')\n",
" plt.tight_layout()\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawSpectrogramWithCentroid(self):\n",
" centroid=self.getCentroid();\n",
" S,phase=self.getSpectrogram();\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" plt.semilogy(centroid.T, label='Spectral centroid')\n",
" plt.ylabel('Hz')\n",
" plt.xticks([])\n",
" plt.xlim([0, centroid.shape[-1]])\n",
" plt.legend()\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),y_axis='log', x_axis='time')\n",
" plt.title('log Power spectrogram')\n",
" plt.tight_layout();\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawSpectralRolloff(self):\n",
" rolloff=self.getSpectralRolloff();\n",
" S,phase=self.getSpectrogram();\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" plt.semilogy(rolloff.T, label='Roll-off frequency')\n",
" plt.ylabel('Hz')\n",
" plt.xticks([])\n",
" plt.xlim([0, rolloff.shape[-1]])\n",
" plt.legend()\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),y_axis='log', x_axis='time')\n",
" plt.title('log Power spectrogram')\n",
" plt.tight_layout();\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawSpectralContrast(self):\n",
" contrast=self.getSpectralContrast();\n",
" S,phase=self.getSpectrogram();\n",
" S = np.abs(self.getSTFT());\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S,ref=np.max),y_axis='log')\n",
" plt.colorbar(format='%+2.0f dB')\n",
" plt.title('Power spectrogram')\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(contrast, x_axis='time')\n",
" plt.colorbar()\n",
" plt.ylabel('Frequency bands')\n",
" plt.title('Spectral contrast')\n",
" plt.tight_layout();\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawMFCC(self):\n",
" mfccs=self.getMFCC();\n",
" plt.figure(figsize=(6, 4))\n",
" librosa.display.specshow(mfccs, x_axis='time')\n",
" #plt.colorbar()\n",
" plt.title('MFCC')\n",
" plt.tight_layout()\n",
" plt.show();\n",
" pass;\n",
" \n",
" \n",
" def log(self,a,b=None):\n",
" if(self.log_enabled):\n",
" if(b!=None):\n",
" print(a,b);\n",
" else:\n",
" print(a);\n",
" pass; \n",
" \n",
" def estimate_tempo(self,oenv,sample_rate):\n",
" return librosa.beat.tempo(oenv,sr=sample_rate)\n",
"\n",
" def tempogram_analysis(self,signal, sample_rate, max_tempo = 320.0,hop_length = 512):\n",
" tempogram = librosa.feature.tempogram(y=signal, sr = sample_rate)\n",
" bpms = librosa.core.tempo_frequencies(tempogram.shape[0], hop_length=hop_length, sr=sample_rate)\n",
" means_over_time = np.mean(tempogram, axis = 1)\n",
" #account for max_tempo\n",
" if max_tempo is not None:\n",
" max_idx = np.argmax(bpms < max_tempo)\n",
" means_over_time[:max_idx] = 0 \n",
" top_five_tempos = np.argpartition(means_over_time, -3)[-3:-1]\n",
" top_five_tempo_values = means_over_time[top_five_tempos]\n",
" return bpms[top_five_tempos], top_five_tempo_values\n",
" \n",
" def getRhythm_features(self):\n",
" oenv = librosa.onset.onset_strength(y=self.y, sr=self.sr)\n",
" tempo = self.estimate_tempo(oenv,self.sr)\n",
" top_five_tempos, top_five_tempo_values = self.tempogram_analysis(self.y, self.sr)\n",
" tempos = np.append(top_five_tempos, top_five_tempo_values)\n",
" return np.append(tempos, tempo)\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"class ProcessDataset:\n",
" columns = [\"id\",\"type\",\"y_index\",\"y\",\"centroid mean\",\"rolloff mean\",\"zero mean\",\"rms mean\",\"rms var\",\"contrast mean\",\"contrast var\", \"mfcc1 mean\",\"mfcc1 var\",\n",
" \"mfcc2 mean\",\"mfcc2 var\",\"mfcc3 mean\",\"mfcc3 var\",\"mfcc4 mean\",\"mfcc4 var\",\"mfcc5 mean\",\"mfcc5 var\",\n",
" \"mel1 mean\",\"mel1 var\",\"mel2 mean\",\"mel2 var\",\"mel3 mean\",\"mel3 var\",\"mel4 mean\",\"mel4 var\",\"mel5 mean\", \"mel5 var\"]+[\"chroma_mean_\"+str(i) for i in range(1,7)]+ [\"chroma_var_\"+str(i) for i in range(1,7)]+[\"bpm_second\", \"bm_first\", \"tempo_strength_second\"] \n",
" #columns = [\"id\",\"type\",\"y_index\",\"y\",\"centroid mean\",\"centroid var\",\"rolloff mean\",\"rolloff var\",\"zero mean\",\n",
" # \"zero var\",\"rms mean\",\"rms var\",\"contrast mean\",\"contrast var\",\"mfcc1 mean\",\"mfcc1 var\",\n",
" # \"mfcc2 mean\",\"mfcc2 var\",\"mfcc3 mean\",\"mfcc3 var\",\"mfcc4 mean\",\"mfcc4 var\",\"mfcc5 mean\",\"mfcc5 var\",\n",
" # \"mfcc6 mean\",\"mfcc6 var\",\"mfcc7 mean\",\"mfcc7 var\",\"mfcc8 mean\",\"mfcc8 var\",\"mfcc9 mean\",\"mfcc9 var\",\n",
" # \"mfcc10 mean\",\"mfcc10 var\",\"mfcc11 mean\",\"mfcc11 var\",\"mfcc12 mean\",\"mfcc12 var\",\"mfcc13 mean\",\"mfcc13 var\"];\n",
"# +[\"chroma_mean_\"+str(i) for i in range(1,13)]+ [\"chroma_var_\"+str(i) for i in range(1,13)]+[\"bpm_second\", \"bm_first\", \"tempo_strength_second\"]\n",
" genre_out={\"blues\":[1,0,0,0,0,0,0,0,0,0],\"classical\":[0,1,0,0,0,0,0,0,0,0],\"country\":[0,0,1,0,0,0,0,0,0,0],\"disco\":[0,0,0,1,0,0,0,0,0,0],\"hiphop\":[0,0,0,0,1,0,0,0,0,0],\"jazz\":[0,0,0,0,0,1,0,0,0,0],\"metal\":[0,0,0,0,0,0,1,0,0,0],\"pop\":[0,0,0,0,0,0,0,1,0,0],\"reggae\":[0,0,0,0,0,0,0,0,1,0],\"rock\":[0,0,0,0,0,0,0,0,0,1]}; \n",
" genre_out_index={\"blues\":0,\"classical\":1,\"country\":2,\"disco\":3,\"hiphop\":4,\"jazz\":5,\"metal\":6,\"pop\":7,\"reggae\":8,\"rock\":9}; \n",
" dataframe=None;\n",
" mfcc_features=5;\n",
" mel_features=5;\n",
" chroma_features=6;\n",
" dir=\"../genres\";\n",
" genre_dir={\"blues\":\"blues\",\"classical\":\"classical\",\"country\":\"country\",\"disco\":\"disco\",\"hiphop\":\"hiphop\",\"jazz\":\"jazz\",\"metal\":\"metal\",\"pop\":\"pop\",\"reggae\":\"reggae\",\"rock\":\"rock\"};\n",
" def __init__(self):\n",
" self.dataframe = pandas.DataFrame(columns=self.columns);\n",
" print(\"Colums\",len(self.columns))\n",
" pass;\n",
"\n",
" def extractTimberalFeatures(self,genre,audio_number,filename):\n",
" features=[];\n",
" pp=PreProcessing(filename); \n",
" centroid=pp.getCentroid()[0];\n",
" rolloff=pp.getSpectralRolloff()[0]; \n",
" zero=pp.getZeroCrossing()[0]; \n",
" contrast=pp.getSpectralContrast()[0]; \n",
" rms=pp.getRMS()[0];\n",
" mfcc=pp.getMFCC();\n",
" mel=pp.getMelSpec();\n",
" chroma = pp.getChroma();\n",
" rhythm = pp.getRhythm_features();\n",
" \n",
" features.append(audio_number);\n",
" features.append(genre); \n",
" features.append(self.genre_out_index[genre]); \n",
" features.append(self.genre_out[genre]);\n",
" features.append(centroid.mean());\n",
"# features.append(centroid.var()); \n",
" features.append(rolloff.mean());\n",
"# features.append(rolloff.var()); \n",
" features.append(zero.mean());\n",
"# features.append(zero.var()); \n",
" features.append(rms.mean());\n",
" features.append(rms.var()); \n",
" features.append(contrast.mean());\n",
" features.append(contrast.var()); \n",
" for i in range(self.mfcc_features):\n",
" features.append(mfcc[i].mean());\n",
" features.append(mfcc[i].var()); \n",
" for i in range(self.mel_features):\n",
" features.append(mel[i].mean());\n",
" features.append(mel[i].var());\n",
" for i in range(self.chroma_features):\n",
" features.append(chroma[i].mean());\n",
" features.append(chroma[i].var());\n",
" #features.append(np.mean(chroma,axis=1).reshape(1,12));\n",
" #features.append(np.var(chroma,axis=1).reshape(1,12));\n",
" #print(np.mean(chroma,axis=1).shape);\n",
" #print(\"Df\",self.dataframe.size)\n",
" #print(\"Features\",np.array(features).shape)\n",
" #print(rhythm.shape)\n",
" for i in range(3):\n",
" features.append(rhythm[i]);\n",
" self.dataframe.loc[self.dataframe.size]=features;\n",
" \n",
" def saveDataFrame(self):\n",
" filename=\"audiofeatures_numpy_matrix\";\n",
" arr=self.dataframe.as_matrix(columns=None);\n",
" np.save(filename,arr); \n",
" self.dataframe.to_csv(\"audiofeatures.csv\",sep=\",\")\n",
" print(\"Written successfully..\");\n",
" pass;\n",
" \n",
" def extractFeatures(self):\n",
" print(\"Extracting Features...\");\n",
" percent_completed=0; \n",
" for k in self.genre_dir: \n",
" genre=k;\n",
" print(\"-------------------[\"+genre+\"]-----------------------\")\n",
" for i in range(100):\n",
" audio_number=\"%0.5d\"%i;\n",
" filename=self.dir+\"/\"+self.genre_dir[genre]+\"/\"+self.genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
" self.extractTimberalFeatures(genre,audio_number,filename); \n",
" percent_completed=i;\n",
" if(percent_completed%10==0):\n",
" print(\"Percent completed:\",percent_completed); \n",
" self.saveDataFrame();\n",
" print(\"Extraction done\");\n",
" pass;\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Colums 46\n",
"Extracting Features...\n",
"-------------------[blues]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n"
]
}
],
"source": [
"p1=ProcessDataset();\n",
"p1.extractFeatures();\n",
"p1.dataframe"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dir=\"../genres\";\n",
"genre_dir={\"blues\":\"blues\",\"classical\":\"classical\",\"country\":\"country\",\"disco\":\"disco\",\"hiphop\":\"hiphop\",\"jazz\":\"jazz\",\"metal\":\"metal\",\"pop\":\"pop\",\"reggae\":\"reggae\",\"rock\":\"rock\"};"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"genre=\"disco\"\n",
"\n",
"audio_number=\"%0.5d\"%0;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"\n",
"pp=PreProcessing(filename); \n",
"s,p=pp.getSpectrogram();\n",
"len(s)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"genre=\"disco\"\n",
"audio_number=\"%0.5d\"%0;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"\n",
"pp=PreProcessing(filename); \n",
"a=librosa.feature.melspectrogram(y=pp.y, sr=pp.sr,n_mels=10)\n",
"len(a[0])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"genre=\"disco\"\n",
"pds=ProcessDataset();\n",
"\n",
"audio_number=\"%0.5d\"%98;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"pds.extractTimberalFeatures(genre,audio_number,filename);\n",
"\n",
"audio_number=\"%0.5d\"%99;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"pds.extractTimberalFeatures(genre,audio_number,filename);\n",
"\n",
"audio_number=\"%0.5d\"%0;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"pds.extractTimberalFeatures(genre,audio_number,filename);\n",
"\n",
"#pds.extractFeatures();\n",
"pds.dataframe"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def partitionDataFrame(df,ratio):\n",
" df = df.sample(frac=1).reset_index(drop=True)#shuffling rows\n",
" df = df.sample(frac=1).reset_index(drop=True)#again shuffling\n",
" size=df[\"id\"].count();\n",
" limit=int(ratio*size);\n",
" train_ds=df.loc[0:limit]; \n",
" test_ds=df.loc[limit:size];\n",
" train_ds.to_csv(\"train.csv\",sep=\",\");\n",
" test_ds.to_csv(\"test.csv\",sep=\",\");\n",
" print(\"Partitioning done\");"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df=readCSVFile(\"audiofeatures.csv\");\n",
"partitionDataFrame(df,0.9);\n"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas;\n",
"import numpy as np;\n",
"import ast;\n",
"import sklearn.tree as tree;\n",
"from sklearn.metrics import roc_auc_score\n",
"from sklearn.multiclass import OneVsRestClassifier\n",
"from sklearn.svm import LinearSVC\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.naive_bayes import GaussianNB, MultinomialNB, BernoulliNB\n",
"from sklearn.tree import DecisionTreeClassifier\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, AdaBoostClassifier\n",
"from sklearn.neural_network import MLPClassifier\n",
"from sklearn import datasets"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def readCSVFile(file):\n",
" data=pandas.read_csv(file,\",\",header=0, na_values='?', skipinitialspace=True);\n",
" return data;\n",
" pass;\n",
"def readTrainData(dataset): \n",
" return dataset.iloc[:,6:], dataset.iloc[:,4:5].astype(int),dataset.iloc[:,5:6];\n",
" pass;\n",
"\n",
"def readTestData(dataset): \n",
" return dataset.iloc[:,6:], dataset.iloc[:,4:5].astype(int),dataset.iloc[:,5:6];\n",
" pass;\n",
"\n",
"def normalizePhi(unNormalizedPhi,last_col_bias=False): \n",
" #assuming last column as bias column\n",
" no_of_column=len(unNormalizedPhi[0]);\n",
" phi=np.array(unNormalizedPhi);\n",
" std=phi.std(0);\n",
" mean=phi.mean(0); \n",
" #std[no_of_column-1]=1;\n",
" #mean[no_of_column-1]=0;\n",
" #phi_normalize=(phi-mean)/std; \n",
" \n",
" max_vector=phi.max(axis=0)\n",
" phi_normalize=phi/max_vector; \n",
" \n",
" return phi_normalize;\n",
" pass;\n",
"\n",
"def categoryToNumber(dataset,categoryList):\n",
" for c in categoryList:\n",
" if (c in dataset): \n",
" dataset[c]=pandas.get_dummies(dataset[c]).values.argmax(1); \n",
" return dataset;\n",
" pass;\n",
" \n",
"\n",
"def handleCategoryData(dataset,categoryList): \n",
" return categoryToNumber(dataset,categoryList)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2,\n",
" 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"iris = datasets.load_iris()\n",
"X, y = iris.data, iris.target\n",
"OneVsRestClassifier(LinearSVC(random_state=0,max_iter=4000)).fit(X, y).predict(X)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:9: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
" if __name__ == '__main__':\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:10: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
" # Remove the CWD from sys.path while we load stuff.\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:11: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
" # This is added back by InteractiveShellApp.init_path()\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:17: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:18: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:19: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n"
]
}
],
"source": [
"dir=\"./\"\n",
"trainFile=dir+\"train.csv\";\n",
"testFile=dir+\"test.csv\";\n",
"trained_dataset=readCSVFile(trainFile);\n",
"test_dataset=readCSVFile(testFile);\n",
"trained_data,trained_y,trained_y_vector=readTrainData(trained_dataset);\n",
"test_data,test_y,test_y_vector=readTestData(test_dataset);\n",
"\n",
"mtx_train =trained_data.as_matrix(columns=None)\n",
"mtx_train_y =trained_y.as_matrix(columns=None)\n",
"mtx_trained_y_vector=trained_y_vector.as_matrix(columns=None);\n",
"\n",
"mtx_train_norm=normalizePhi(mtx_train);\n",
"mtx_train_y=np.array(list((e[0] for e in mtx_train_y)));\n",
"mtx_trained_y_vector=np.array(list((ast.literal_eval(e[0]) for e in mtx_trained_y_vector)));\n",
"\n",
"mtx_test=test_data.as_matrix(columns=None);\n",
"mtx_test_y=test_y.as_matrix(columns=None);\n",
"mtx_test_y_vector=test_y_vector.as_matrix(columns=None);\n",
"\n",
"mtx_test_norm=normalizePhi(mtx_test);\n",
"mtx_test_y=np.array(list((e[0] for e in mtx_test_y)));\n",
"mtx_test_y_vector=np.array(list((ast.literal_eval(e[0]) for e in mtx_test_y_vector)));"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[5 9 7 9 8 6 6 9 1 9 9 8 7 7 9 1 9 9 7 6 9 6 2 9 9 5 1 1 9 9 6 9 9 0 7 9 9\n",
" 5 9 0 7 7 9 7 1 9 5 8 8 1 9 7 6 9 6 9 7 7 1 9 9 9 7 1 9 9 1 8 7 8 9 9 7 5\n",
" 9 9 7 9 7 7 1 0 6 7 9 9 9 1 5 0 7 9 9 9 1 7 9 1 7 9 5 0 9 6 7 6 9 1 5 6 1\n",
" 5 8 0 9 9 6 9 5 7 1 9 1 9 7 9 9 9 1 8 9 1 9 7 5 5 7 1 9 6 9 1 5 7 7 8 1 5\n",
" 9 8 7 9 9 1 7 9 6 7 0 0 1 5 7 7 9 2 5 7 7 9 7 0 6 1 9 9 1 1 9 1 9 7 1 5 4\n",
" 1 6 8 9 7 1 8 1 6 0 9 9 9 9 9 9 9 6 6 4 8 9 9 8 6 7 6 8 1 7 1 9 5 6 6 1 1\n",
" 9 9 7 7 7 9 5 6 7 7 9 0 0 1 9 8 5 2 7 9 9 7 1 7 7 0 9 5 9 7 9 7 6 8 5 7 1\n",
" 1 9 9 9 7 6 7 5 7 1 7 7 9 4 1 9 7 1 9 6 9 1 9 6 7 1 7 1 9 7 1 1 6 5 6 1 6\n",
" 9 1 9 9 1 0 5 7 9 9 7 4 1 9 6 7 7 9 5 9 6 9 9 7 8 5 8 0 9 9 9 7 5 9 1 9 5\n",
" 7 9 1 9 9 9 7 9 9 8 0 9 7 9 9 9 9 9 1 9 9 9 7 9 5 9 9 7 4 1 9 9 1 9 6 1 9\n",
" 1 9 6 1 7 9 7 1 8 9 1 1 7 6 9 7 9 7 6 7 9 9 7 9 9 5 9 7 7 9 8 6 6 7 7 5 9\n",
" 9 8 9 1 9 0 9 7 0 7 9 4 7 8 1 2 7 7 0 6 6 5 9 9 7 9 9 9 2 9 7 9 5 6 9 9 7\n",
" 9 9 6 8 5 6 9 7 9 9 9 1 6 7 6 5 9 9 9 7 7 7 0 8 9 9 9 9 5 6 9 5 9 6 7 9 7\n",
" 5 6 9 0 6 6 7 0 9 8 6 6 9 5 1 7 7 0 9 9 0 0 1 1 9 9 9 6 9 5 8 9 9 9 9 7 9\n",
" 9 9 9 0 7 5 9 5 6 9 0 1 7 7 6 5 7 9 1 1 8 7 7 1 0 5 9 7 5 9 7 7 8 5 9 5 6\n",
" 6 6 9 9 1 1 8 1 9 9 9 7 7 4 7 0 9 7 5 9 0 1 7 2 9 1 5 9 1 9 9 7 1 7 1 0 9\n",
" 8 9 1 9 9 7 9 9 9 9 7 1 7 1 9 1 6 9 9 5 7 7 9 7 9 6 5 6 7 6 6 6 8 1 1 7 9\n",
" 6 6 7 1 1 9 7 9 1 1 9 5 9 7 0 1 8 0 1 7 7 5 9 7 6 1 5 8 9 7 9 9 9 7 7 8 7\n",
" 9 7 7 0 7 8 9 9 1 9 9 7 6 9 0 5 9 7 7 9 5 1 9 7 9 6 5 1 9 1 6 7 7 9 8 5 8\n",
" 7 0 7 6 7 9 5 9 9 1 7 9 1 9 9 6 1 4 9 9 7 2 6 9 5 1 5 9 0 7 7 5 1 9 9 6 9\n",
" 7 9 6 9 9 9 9 9 1 1 1 0 7 9 9 7 0 8 7 8 6 7 1 1 1 1 1 7 1 1 5 7 1 9 7 9 9\n",
" 8 6 9 9 7 9 8 6 9 5 4 6 0 9 7 9 9 0 9 7 0 5 9 1 7 7 9 8 9 5 9 1 9 6 9 6 9\n",
" 0 7 1 9 9 7 0 9 9 7 5 6 1 5 5 7 9 1 9 8 0 9 5 5 6 5 9 5 5 9 9 5 6 5 1 9 7\n",
" 7 1 9 1 7 6 1 7 9 7 8 6 1 9 5 9 7 8 5 9 7 0 6 7 7 9 0 9 9 1 8 8 6 8 9 7 8\n",
" 1 1 9 5 1 7 0 6 7 1 9 5 9]\n",
"done\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/svm/base.py:929: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
" \"the number of iterations.\", ConvergenceWarning)\n"
]
}
],
"source": [
"# #trainedModel=OneVsRestClassifier(LinearSVC()).fit(mtx_train, mtx_train_y);\n",
"# trainedModel=LinearSVC(max_iter=12000).fit(mtx_train, mtx_train_y);\n",
"# y_predict=trainedModel.predict(mtx_train);\n",
"# print(y_predict);\n",
"# print(\"done\");"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[9 8 5 8 7 8 6 9 5 0 7 1 7 9 9 5 9 9 9 6 5 6 1 7 1 7 1 1 6 9 9 0 6 9 9 8 9\n",
" 9 9 9 9 5 8 7 6 0 9 1 7 9 0 5 9 9 9 9 7 1 1 5 0 9 7 9 5 6 9 6 9 9 0 9 9 5\n",
" 9 9 9 1 6 1 6 0 9 7 6 6 6 0 1 9 7 7 6 9 1 7 9 9 0 1]\n"
]
}
],
"source": [
"y_predict=trainedModel.predict(mtx_test);\n",
"print(y_predict);"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(901, 42)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
" FutureWarning)\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:469: FutureWarning: Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
" \"this warning.\", FutureWarning)\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/svm/base.py:929: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
" \"the number of iterations.\", ConvergenceWarning)\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/ensemble/forest.py:245: FutureWarning: The default value of n_estimators will change from 10 in version 0.20 to 100 in 0.22.\n",
" \"10 in version 0.20 to 100 in 0.22.\", FutureWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Done\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Trained Misclassified Points</th>\n",
" <th>Trained Accuracy</th>\n",
" <th>Test Misclassified Points</th>\n",
" <th>Test Accuracy</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>Decision Tree</td>\n",
" <td>191</td>\n",
" <td>78.8013</td>\n",
" <td>58</td>\n",
" <td>42</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Random Forest</td>\n",
" <td>50</td>\n",
" <td>94.4506</td>\n",
" <td>38</td>\n",
" <td>62</td>\n",
" </tr>\n",
" <tr>\n",
" <td>K-Neighbors</td>\n",
" <td>323</td>\n",
" <td>64.1509</td>\n",
" <td>61</td>\n",
" <td>39</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Logistic Regression</td>\n",
" <td>279</td>\n",
" <td>69.0344</td>\n",
" <td>35</td>\n",
" <td>65</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Support Vector</td>\n",
" <td>433</td>\n",
" <td>51.9423</td>\n",
" <td>49</td>\n",
" <td>51</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Bernoulli NB</td>\n",
" <td>711</td>\n",
" <td>21.0877</td>\n",
" <td>81</td>\n",
" <td>19</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Gaussian NB</td>\n",
" <td>413</td>\n",
" <td>54.162</td>\n",
" <td>48</td>\n",
" <td>52</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Trained Misclassified Points Trained Accuracy \\\n",
"Decision Tree 191 78.8013 \n",
"Random Forest 50 94.4506 \n",
"K-Neighbors 323 64.1509 \n",
"Logistic Regression 279 69.0344 \n",
"Support Vector 433 51.9423 \n",
"Bernoulli NB 711 21.0877 \n",
"Gaussian NB 413 54.162 \n",
"\n",
" Test Misclassified Points Test Accuracy \n",
"Decision Tree 58 42 \n",
"Random Forest 38 62 \n",
"K-Neighbors 61 39 \n",
"Logistic Regression 35 65 \n",
"Support Vector 49 51 \n",
"Bernoulli NB 81 19 \n",
"Gaussian NB 48 52 "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = trained_data\n",
"print(x.shape)\n",
"y = np.ravel(trained_y)\n",
"y_test=np.ravel(test_y);\n",
"\n",
"index = [\"Decision Tree\", \"Random Forest\", \"K-Neighbors\",\n",
" \"Logistic Regression\", \"Support Vector\", \"Bernoulli NB\", \"Gaussian NB\"]\n",
"columns = [\"Trained Misclassified Points\", \"Trained Accuracy\", \"Test Misclassified Points\", \"Test Accuracy\",]\n",
"modelComparision = pandas.DataFrame(index=index, columns=columns)\n",
"\n",
"dtc = 0, DecisionTreeClassifier(min_samples_split=20)\n",
"rfc = 1, RandomForestClassifier(min_samples_split=10)\n",
"knn = 2, KNeighborsClassifier()\n",
"lgr = 3, LogisticRegression(max_iter=20000)\n",
"svc = 4, LinearSVC(max_iter=15000)\n",
"bnb = 5, BernoulliNB()\n",
"gnb = 6, GaussianNB()\n",
"\n",
"tr_size=len(x.index);\n",
"tt_size=len(y_test);\n",
"for i in lgr, gnb, bnb, dtc, svc, knn, rfc: \n",
" model=i[1].fit(x, y);\n",
" y_pred = model.predict(x)\n",
" tr_misclassifedPoints = (y_pred != y).sum() \n",
" tr_accuracy = ((tr_size - tr_misclassifedPoints)*100) / tr_size;\n",
" \n",
" y_pred = model.predict(test_data)\n",
" tt_misclassifedPoints = (y_pred != y_test).sum() \n",
" tt_accuracy = ((tt_size - tt_misclassifedPoints)*100) / tt_size;\n",
" if(i[0]==0):\n",
" tree.export_graphviz(model,out_file='tree.dot'); \n",
" #print(misclassifedPoints,\":\",size - misclassifedPoints,':',accuracy); \n",
" modelComparision.ix[i[0]] = [tr_misclassifedPoints, tr_accuracy, tt_misclassifedPoints, tt_accuracy,];\n",
" \n",
"print(\"Done\");\n",
"modelComparision"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import scipy.io as sp\n",
"from scipy.fftpack import fft\n",
"from scipy.io import wavfile # get the api\n",
"import sunau;\n",
"import librosa\n",
"import librosa.display\n",
"import pandas\n",
"import os\n",
"np.set_printoptions(suppress=True)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def writeMatrixToFile(self,filename,matrix):\n",
" np.save(filename, matrix);\n",
" os.rename(filename+\".npy\", filename+\".txt\");\n",
" print(\"Written successfully..\");\n",
" pass;\n",
" \n",
"def loadMatrixFromFile(self,filename): \n",
" matrix=None;\n",
" if(os.path.isfile(filename)):\n",
" matrix=np.load(filename); \n",
" return matrix;\n",
"\n",
"def readCSVFile(file):\n",
" data=pandas.read_csv(file,\",\",header=0, na_values='?', skipinitialspace=True);\n",
" return data;\n",
" pass;"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"class PreProcessing:\n",
" filename=None;\n",
" y=None;\n",
" sr=None;\n",
" log_enabled=True;\n",
" centroid=None;\n",
" spectro=None;\n",
" spectro_phase=None;\n",
" max_sample_vector_size=660000; \n",
" duration=30;\n",
" def __init__(self,filename,duration=30):\n",
" #self.log(filename);\n",
" self.filename=filename;\n",
" self.reloadAudioFile(duration);\n",
" self.duration=duration;\n",
" pass;\n",
" \n",
" def reloadAudioFile(self,duration=30):\n",
" self.y, self.sr = librosa.load(self.filename,duration=duration);\n",
" self.y=self.y[:self.max_sample_vector_size];\n",
" pass;\n",
" \n",
" #Short-Term-Fourier trasform\n",
" def getSTFT(self):\n",
" self.stft=librosa.stft(y=self.y);\n",
" return self.stft;\n",
" pass;\n",
" \n",
" #spectro graph\n",
" def getSpectrogram(self):\n",
" stft=self.getSTFT();\n",
" self.spectro, self.spectro_phase = librosa.magphase(stft); \n",
" return self.spectro, self.spectro_phase;\n",
" pass;\n",
" \n",
" def getCentroid(self):\n",
" self.centroid=librosa.feature.spectral_centroid(y=self.y,sr=self.sr);\n",
" return self.centroid; \n",
"\n",
" def getSpectralRolloff(self):\n",
" self.rolloff=librosa.feature.spectral_rolloff(y=self.y, sr=self.sr);\n",
" return self.rolloff;\n",
" \n",
" def getZeroCrossing(self):\n",
" self.zero_crossing_rate=librosa.feature.zero_crossing_rate(self.y);\n",
" return self.zero_crossing_rate;\n",
" \n",
" def getSpectralContrast(self):\n",
" #Jiang, Dan-Ning, Lie Lu, Hong-Jiang Zhang, Jian-Hua Tao, and Lian-Hong Cai. “Music type classification by spectral contrast feature.” In Multimedia and Expo, 2002. ICME‘02. Proceedings. 2002 IEEE International Conference on, vol. 1, pp. 113-116. IEEE, 2002.\n",
" S = np.abs(self.getSTFT());\n",
" self.contrast = librosa.feature.spectral_contrast(S=S, sr=self.sr);\n",
" return self.contrast;\n",
" \n",
" def getMFCC(self):\n",
" self.mfcc = librosa.feature.mfcc(y=self.y, sr=self.sr, hop_length=512, n_mfcc=13);\n",
" return self.mfcc;\n",
" \n",
" def getChroma(self):\n",
" self.chroma = librosa.feature.chroma_stft(y=self.y,sr=self.sr,hop_length=512)\n",
" return self.chroma\n",
" \n",
" def getMelSpec(self):\n",
" self.mel=librosa.feature.melspectrogram(y=self.y, sr=self.sr,n_mels=10);\n",
" return self.mel;\n",
" \n",
" def getRMS(self):\n",
" self.rms=librosa.feature.rms(y=self.y);\n",
" return self.rms;\n",
"\n",
" def drawRMS(self):\n",
" rms=self.getRMS();\n",
" S,phase=self.getSpectrogram();\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" plt.semilogy(rms.T, label='RMS Energy')\n",
" plt.xticks([])\n",
" plt.xlim([0, rms.shape[-1]])\n",
" plt.legend(loc='best')\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),y_axis='log', x_axis='time')\n",
" plt.title('log Power spectrogram')\n",
" plt.tight_layout()\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawSpectrogramWithCentroid(self):\n",
" centroid=self.getCentroid();\n",
" S,phase=self.getSpectrogram();\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" plt.semilogy(centroid.T, label='Spectral centroid')\n",
" plt.ylabel('Hz')\n",
" plt.xticks([])\n",
" plt.xlim([0, centroid.shape[-1]])\n",
" plt.legend()\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),y_axis='log', x_axis='time')\n",
" plt.title('log Power spectrogram')\n",
" plt.tight_layout();\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawSpectralRolloff(self):\n",
" rolloff=self.getSpectralRolloff();\n",
" S,phase=self.getSpectrogram();\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" plt.semilogy(rolloff.T, label='Roll-off frequency')\n",
" plt.ylabel('Hz')\n",
" plt.xticks([])\n",
" plt.xlim([0, rolloff.shape[-1]])\n",
" plt.legend()\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),y_axis='log', x_axis='time')\n",
" plt.title('log Power spectrogram')\n",
" plt.tight_layout();\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawSpectralContrast(self):\n",
" contrast=self.getSpectralContrast();\n",
" S,phase=self.getSpectrogram();\n",
" S = np.abs(self.getSTFT());\n",
" plt.figure()\n",
" plt.subplot(2, 1, 1)\n",
" librosa.display.specshow(librosa.amplitude_to_db(S,ref=np.max),y_axis='log')\n",
" plt.colorbar(format='%+2.0f dB')\n",
" plt.title('Power spectrogram')\n",
" plt.subplot(2, 1, 2)\n",
" librosa.display.specshow(contrast, x_axis='time')\n",
" plt.colorbar()\n",
" plt.ylabel('Frequency bands')\n",
" plt.title('Spectral contrast')\n",
" plt.tight_layout();\n",
" plt.show();\n",
" pass;\n",
" \n",
" def drawMFCC(self):\n",
" mfccs=self.getMFCC();\n",
" plt.figure(figsize=(6, 4))\n",
" librosa.display.specshow(mfccs, x_axis='time')\n",
" #plt.colorbar()\n",
" plt.title('MFCC')\n",
" plt.tight_layout()\n",
" plt.show();\n",
" pass;\n",
" \n",
" \n",
" def log(self,a,b=None):\n",
" if(self.log_enabled):\n",
" if(b!=None):\n",
" print(a,b);\n",
" else:\n",
" print(a);\n",
" pass; \n",
" \n",
" def estimate_tempo(self,oenv,sample_rate):\n",
" return librosa.beat.tempo(oenv,sr=sample_rate)\n",
"\n",
" def tempogram_analysis(self,signal, sample_rate, max_tempo = 320.0,hop_length = 512):\n",
" tempogram = librosa.feature.tempogram(y=signal, sr = sample_rate)\n",
" bpms = librosa.core.tempo_frequencies(tempogram.shape[0], hop_length=hop_length, sr=sample_rate)\n",
" means_over_time = np.mean(tempogram, axis = 1)\n",
" #account for max_tempo\n",
" if max_tempo is not None:\n",
" max_idx = np.argmax(bpms < max_tempo)\n",
" means_over_time[:max_idx] = 0 \n",
" top_five_tempos = np.argpartition(means_over_time, -3)[-3:-1]\n",
" top_five_tempo_values = means_over_time[top_five_tempos]\n",
" return bpms[top_five_tempos], top_five_tempo_values\n",
" \n",
" def getRhythm_features(self):\n",
" oenv = librosa.onset.onset_strength(y=self.y, sr=self.sr)\n",
" tempo = self.estimate_tempo(oenv,self.sr)\n",
" top_five_tempos, top_five_tempo_values = self.tempogram_analysis(self.y, self.sr)\n",
" tempos = np.append(top_five_tempos, top_five_tempo_values)\n",
" return np.append(tempos, tempo)\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"class ProcessDataset:\n",
" columns = [\"id\",\"type\",\"y_index\",\"y\",\"centroid mean\",\"rolloff mean\",\"zero mean\",\"rms mean\",\"rms var\",\"contrast mean\",\"contrast var\", \"mfcc1 mean\",\"mfcc1 var\",\n",
" \"mfcc2 mean\",\"mfcc2 var\",\"mfcc3 mean\",\"mfcc3 var\",\"mfcc4 mean\",\"mfcc4 var\",\"mfcc5 mean\",\"mfcc5 var\",\n",
" \"mel1 mean\",\"mel1 var\",\"mel2 mean\",\"mel2 var\",\"mel3 mean\",\"mel3 var\",\"mel4 mean\",\"mel4 var\",\"mel5 mean\", \"mel5 var\"]+[\"chroma_mean_\"+str(i) for i in range(1,7)]+ [\"chroma_var_\"+str(i) for i in range(1,7)]+[\"bpm_second\", \"bm_first\", \"tempo_strength_second\"] \n",
" #columns = [\"id\",\"type\",\"y_index\",\"y\",\"centroid mean\",\"centroid var\",\"rolloff mean\",\"rolloff var\",\"zero mean\",\n",
" # \"zero var\",\"rms mean\",\"rms var\",\"contrast mean\",\"contrast var\",\"mfcc1 mean\",\"mfcc1 var\",\n",
" # \"mfcc2 mean\",\"mfcc2 var\",\"mfcc3 mean\",\"mfcc3 var\",\"mfcc4 mean\",\"mfcc4 var\",\"mfcc5 mean\",\"mfcc5 var\",\n",
" # \"mfcc6 mean\",\"mfcc6 var\",\"mfcc7 mean\",\"mfcc7 var\",\"mfcc8 mean\",\"mfcc8 var\",\"mfcc9 mean\",\"mfcc9 var\",\n",
" # \"mfcc10 mean\",\"mfcc10 var\",\"mfcc11 mean\",\"mfcc11 var\",\"mfcc12 mean\",\"mfcc12 var\",\"mfcc13 mean\",\"mfcc13 var\"];\n",
"# +[\"chroma_mean_\"+str(i) for i in range(1,13)]+ [\"chroma_var_\"+str(i) for i in range(1,13)]+[\"bpm_second\", \"bm_first\", \"tempo_strength_second\"]\n",
" genre_out={\"blues\":[1,0,0,0,0,0,0,0,0,0],\"classical\":[0,1,0,0,0,0,0,0,0,0],\"country\":[0,0,1,0,0,0,0,0,0,0],\"disco\":[0,0,0,1,0,0,0,0,0,0],\"hiphop\":[0,0,0,0,1,0,0,0,0,0],\"jazz\":[0,0,0,0,0,1,0,0,0,0],\"metal\":[0,0,0,0,0,0,1,0,0,0],\"pop\":[0,0,0,0,0,0,0,1,0,0],\"reggae\":[0,0,0,0,0,0,0,0,1,0],\"rock\":[0,0,0,0,0,0,0,0,0,1]}; \n",
" genre_out_index={\"blues\":0,\"classical\":1,\"country\":2,\"disco\":3,\"hiphop\":4,\"jazz\":5,\"metal\":6,\"pop\":7,\"reggae\":8,\"rock\":9}; \n",
" dataframe=None;\n",
" mfcc_features=5;\n",
" mel_features=5;\n",
" chroma_features=6;\n",
" dir=\"../genres\";\n",
" genre_dir={\"blues\":\"blues\",\"classical\":\"classical\",\"country\":\"country\",\"disco\":\"disco\",\"hiphop\":\"hiphop\",\"jazz\":\"jazz\",\"metal\":\"metal\",\"pop\":\"pop\",\"reggae\":\"reggae\",\"rock\":\"rock\"};\n",
" def __init__(self):\n",
" self.dataframe = pandas.DataFrame(columns=self.columns);\n",
" print(\"Colums\",len(self.columns))\n",
" pass;\n",
"\n",
" def extractTimberalFeatures(self,genre,audio_number,filename):\n",
" features=[];\n",
" pp=PreProcessing(filename); \n",
" centroid=pp.getCentroid()[0];\n",
" rolloff=pp.getSpectralRolloff()[0]; \n",
" zero=pp.getZeroCrossing()[0]; \n",
" contrast=pp.getSpectralContrast()[0]; \n",
" rms=pp.getRMS()[0];\n",
" mfcc=pp.getMFCC();\n",
" mel=pp.getMelSpec();\n",
" chroma = pp.getChroma();\n",
" rhythm = pp.getRhythm_features();\n",
" \n",
" features.append(audio_number);\n",
" features.append(genre); \n",
" features.append(self.genre_out_index[genre]); \n",
" features.append(self.genre_out[genre]);\n",
" features.append(centroid.mean());\n",
"# features.append(centroid.var()); \n",
" features.append(rolloff.mean());\n",
"# features.append(rolloff.var()); \n",
" features.append(zero.mean());\n",
"# features.append(zero.var()); \n",
" features.append(rms.mean());\n",
" features.append(rms.var()); \n",
" features.append(contrast.mean());\n",
" features.append(contrast.var()); \n",
" for i in range(self.mfcc_features):\n",
" features.append(mfcc[i].mean());\n",
" features.append(mfcc[i].var()); \n",
" for i in range(self.mel_features):\n",
" features.append(mel[i].mean());\n",
" features.append(mel[i].var());\n",
" for i in range(self.chroma_features):\n",
" features.append(chroma[i].mean());\n",
" features.append(chroma[i].var());\n",
" #features.append(np.mean(chroma,axis=1).reshape(1,12));\n",
" #features.append(np.var(chroma,axis=1).reshape(1,12));\n",
" #print(np.mean(chroma,axis=1).shape);\n",
" #print(\"Df\",self.dataframe.size)\n",
" #print(\"Features\",np.array(features).shape)\n",
" #print(rhythm.shape)\n",
" for i in range(3):\n",
" features.append(rhythm[i]);\n",
" self.dataframe.loc[self.dataframe.size]=features;\n",
" \n",
" def saveDataFrame(self):\n",
" filename=\"audiofeatures_numpy_matrix\";\n",
" arr=self.dataframe.as_matrix(columns=None);\n",
" np.save(filename,arr); \n",
" self.dataframe.to_csv(\"audiofeatures.csv\",sep=\",\")\n",
" print(\"Written successfully..\");\n",
" pass;\n",
" \n",
" def extractFeatures(self):\n",
" print(\"Extracting Features...\");\n",
" percent_completed=0; \n",
" for k in self.genre_dir: \n",
" genre=k;\n",
" print(\"-------------------[\"+genre+\"]-----------------------\")\n",
" for i in range(100):\n",
" audio_number=\"%0.5d\"%i;\n",
" filename=self.dir+\"/\"+self.genre_dir[genre]+\"/\"+self.genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
" self.extractTimberalFeatures(genre,audio_number,filename); \n",
" percent_completed=i;\n",
" if(percent_completed%10==0):\n",
" print(\"Percent completed:\",percent_completed); \n",
" self.saveDataFrame();\n",
" print(\"Extraction done\");\n",
" pass;\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Colums 46\n",
"Extracting Features...\n",
"-------------------[blues]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[classical]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[country]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[disco]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[hiphop]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[jazz]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[metal]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[pop]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[reggae]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n",
"-------------------[rock]-----------------------\n",
"Percent completed: 0\n",
"Percent completed: 10\n",
"Percent completed: 20\n",
"Percent completed: 30\n",
"Percent completed: 40\n",
"Percent completed: 50\n",
"Percent completed: 60\n",
"Percent completed: 70\n",
"Percent completed: 80\n",
"Percent completed: 90\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:72: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Written successfully..\n",
"Extraction done\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>type</th>\n",
" <th>y_index</th>\n",
" <th>y</th>\n",
" <th>centroid mean</th>\n",
" <th>rolloff mean</th>\n",
" <th>zero mean</th>\n",
" <th>rms mean</th>\n",
" <th>rms var</th>\n",
" <th>contrast mean</th>\n",
" <th>...</th>\n",
" <th>chroma_mean_6</th>\n",
" <th>chroma_var_1</th>\n",
" <th>chroma_var_2</th>\n",
" <th>chroma_var_3</th>\n",
" <th>chroma_var_4</th>\n",
" <th>chroma_var_5</th>\n",
" <th>chroma_var_6</th>\n",
" <th>bpm_second</th>\n",
" <th>bm_first</th>\n",
" <th>tempo_strength_second</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>00000</td>\n",
" <td>blues</td>\n",
" <td>0</td>\n",
" <td>[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>1784.808293</td>\n",
" <td>3808.046818</td>\n",
" <td>0.083024</td>\n",
" <td>0.130224</td>\n",
" <td>0.002833</td>\n",
" <td>15.995900</td>\n",
" <td>...</td>\n",
" <td>0.100146</td>\n",
" <td>0.244700</td>\n",
" <td>0.044746</td>\n",
" <td>0.247899</td>\n",
" <td>0.065782</td>\n",
" <td>0.335636</td>\n",
" <td>0.083699</td>\n",
" <td>129.199219</td>\n",
" <td>123.046875</td>\n",
" <td>0.697285</td>\n",
" </tr>\n",
" <tr>\n",
" <td>46</td>\n",
" <td>00001</td>\n",
" <td>blues</td>\n",
" <td>0</td>\n",
" <td>[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>1529.004413</td>\n",
" <td>3545.433548</td>\n",
" <td>0.055998</td>\n",
" <td>0.095860</td>\n",
" <td>0.002375</td>\n",
" <td>15.976383</td>\n",
" <td>...</td>\n",
" <td>0.095222</td>\n",
" <td>0.211930</td>\n",
" <td>0.052394</td>\n",
" <td>0.201273</td>\n",
" <td>0.043756</td>\n",
" <td>0.331534</td>\n",
" <td>0.096766</td>\n",
" <td>69.837416</td>\n",
" <td>66.256010</td>\n",
" <td>0.535636</td>\n",
" </tr>\n",
" <tr>\n",
" <td>92</td>\n",
" <td>00002</td>\n",
" <td>blues</td>\n",
" <td>0</td>\n",
" <td>[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>1552.846406</td>\n",
" <td>3041.990598</td>\n",
" <td>0.076251</td>\n",
" <td>0.175608</td>\n",
" <td>0.002753</td>\n",
" <td>26.343662</td>\n",
" <td>...</td>\n",
" <td>0.073941</td>\n",
" <td>0.408669</td>\n",
" <td>0.073894</td>\n",
" <td>0.547632</td>\n",
" <td>0.122644</td>\n",
" <td>0.322317</td>\n",
" <td>0.055691</td>\n",
" <td>78.302557</td>\n",
" <td>151.999081</td>\n",
" <td>0.604331</td>\n",
" </tr>\n",
" <tr>\n",
" <td>138</td>\n",
" <td>00003</td>\n",
" <td>blues</td>\n",
" <td>0</td>\n",
" <td>[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>1070.101734</td>\n",
" <td>2185.494924</td>\n",
" <td>0.033294</td>\n",
" <td>0.141386</td>\n",
" <td>0.006324</td>\n",
" <td>29.793587</td>\n",
" <td>...</td>\n",
" <td>0.106601</td>\n",
" <td>0.547292</td>\n",
" <td>0.092144</td>\n",
" <td>0.657226</td>\n",
" <td>0.119275</td>\n",
" <td>0.511363</td>\n",
" <td>0.092011</td>\n",
" <td>64.599609</td>\n",
" <td>63.024009</td>\n",
" <td>0.547889</td>\n",
" </tr>\n",
" <tr>\n",
" <td>184</td>\n",
" <td>00004</td>\n",
" <td>blues</td>\n",
" <td>0</td>\n",
" <td>[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>1836.253062</td>\n",
" <td>3582.540766</td>\n",
" <td>0.101533</td>\n",
" <td>0.091636</td>\n",
" <td>0.002304</td>\n",
" <td>17.063747</td>\n",
" <td>...</td>\n",
" <td>0.096787</td>\n",
" <td>0.255970</td>\n",
" <td>0.075524</td>\n",
" <td>0.193062</td>\n",
" <td>0.032114</td>\n",
" <td>0.531243</td>\n",
" <td>0.131189</td>\n",
" <td>66.256010</td>\n",
" <td>129.199219</td>\n",
" <td>0.544492</td>\n",
" </tr>\n",
" <tr>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <td>45770</td>\n",
" <td>00095</td>\n",
" <td>rock</td>\n",
" <td>9</td>\n",
" <td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]</td>\n",
" <td>2009.139574</td>\n",
" <td>4254.785667</td>\n",
" <td>0.089293</td>\n",
" <td>0.079451</td>\n",
" <td>0.000346</td>\n",
" <td>29.623115</td>\n",
" <td>...</td>\n",
" <td>0.084771</td>\n",
" <td>0.406211</td>\n",
" <td>0.035509</td>\n",
" <td>0.330961</td>\n",
" <td>0.093065</td>\n",
" <td>0.217626</td>\n",
" <td>0.026933</td>\n",
" <td>198.768029</td>\n",
" <td>215.332031</td>\n",
" <td>0.775188</td>\n",
" </tr>\n",
" <tr>\n",
" <td>45816</td>\n",
" <td>00096</td>\n",
" <td>rock</td>\n",
" <td>9</td>\n",
" <td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]</td>\n",
" <td>2005.279224</td>\n",
" <td>4144.849484</td>\n",
" <td>0.097594</td>\n",
" <td>0.076443</td>\n",
" <td>0.000590</td>\n",
" <td>29.228484</td>\n",
" <td>...</td>\n",
" <td>0.055166</td>\n",
" <td>0.347186</td>\n",
" <td>0.037476</td>\n",
" <td>0.562132</td>\n",
" <td>0.088365</td>\n",
" <td>0.298203</td>\n",
" <td>0.030091</td>\n",
" <td>78.302557</td>\n",
" <td>234.907670</td>\n",
" <td>0.745270</td>\n",
" </tr>\n",
" <tr>\n",
" <td>45862</td>\n",
" <td>00097</td>\n",
" <td>rock</td>\n",
" <td>9</td>\n",
" <td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]</td>\n",
" <td>2076.527225</td>\n",
" <td>4029.196153</td>\n",
" <td>0.121735</td>\n",
" <td>0.081619</td>\n",
" <td>0.000322</td>\n",
" <td>28.829981</td>\n",
" <td>...</td>\n",
" <td>0.097083</td>\n",
" <td>0.409299</td>\n",
" <td>0.044416</td>\n",
" <td>0.457064</td>\n",
" <td>0.087882</td>\n",
" <td>0.341546</td>\n",
" <td>0.039950</td>\n",
" <td>123.046875</td>\n",
" <td>258.398438</td>\n",
" <td>0.787496</td>\n",
" </tr>\n",
" <tr>\n",
" <td>45908</td>\n",
" <td>00098</td>\n",
" <td>rock</td>\n",
" <td>9</td>\n",
" <td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]</td>\n",
" <td>1398.990121</td>\n",
" <td>3014.656784</td>\n",
" <td>0.048738</td>\n",
" <td>0.083942</td>\n",
" <td>0.001211</td>\n",
" <td>28.549530</td>\n",
" <td>...</td>\n",
" <td>0.066175</td>\n",
" <td>0.226563</td>\n",
" <td>0.040740</td>\n",
" <td>0.334850</td>\n",
" <td>0.086914</td>\n",
" <td>0.379064</td>\n",
" <td>0.116438</td>\n",
" <td>234.907670</td>\n",
" <td>215.332031</td>\n",
" <td>0.669523</td>\n",
" </tr>\n",
" <tr>\n",
" <td>45954</td>\n",
" <td>00099</td>\n",
" <td>rock</td>\n",
" <td>9</td>\n",
" <td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]</td>\n",
" <td>1608.559699</td>\n",
" <td>3244.653093</td>\n",
" <td>0.076161</td>\n",
" <td>0.054475</td>\n",
" <td>0.000337</td>\n",
" <td>29.670431</td>\n",
" <td>...</td>\n",
" <td>0.026997</td>\n",
" <td>0.422365</td>\n",
" <td>0.063259</td>\n",
" <td>0.672558</td>\n",
" <td>0.127945</td>\n",
" <td>0.428266</td>\n",
" <td>0.070846</td>\n",
" <td>258.398438</td>\n",
" <td>129.199219</td>\n",
" <td>0.638906</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1000 rows × 46 columns</p>\n",
"</div>"
],
"text/plain": [
" id type y_index y centroid mean \\\n",
"0 00000 blues 0 [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] 1784.808293 \n",
"46 00001 blues 0 [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] 1529.004413 \n",
"92 00002 blues 0 [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] 1552.846406 \n",
"138 00003 blues 0 [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] 1070.101734 \n",
"184 00004 blues 0 [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] 1836.253062 \n",
"... ... ... ... ... ... \n",
"45770 00095 rock 9 [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] 2009.139574 \n",
"45816 00096 rock 9 [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] 2005.279224 \n",
"45862 00097 rock 9 [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] 2076.527225 \n",
"45908 00098 rock 9 [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] 1398.990121 \n",
"45954 00099 rock 9 [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] 1608.559699 \n",
"\n",
" rolloff mean zero mean rms mean rms var contrast mean ... \\\n",
"0 3808.046818 0.083024 0.130224 0.002833 15.995900 ... \n",
"46 3545.433548 0.055998 0.095860 0.002375 15.976383 ... \n",
"92 3041.990598 0.076251 0.175608 0.002753 26.343662 ... \n",
"138 2185.494924 0.033294 0.141386 0.006324 29.793587 ... \n",
"184 3582.540766 0.101533 0.091636 0.002304 17.063747 ... \n",
"... ... ... ... ... ... ... \n",
"45770 4254.785667 0.089293 0.079451 0.000346 29.623115 ... \n",
"45816 4144.849484 0.097594 0.076443 0.000590 29.228484 ... \n",
"45862 4029.196153 0.121735 0.081619 0.000322 28.829981 ... \n",
"45908 3014.656784 0.048738 0.083942 0.001211 28.549530 ... \n",
"45954 3244.653093 0.076161 0.054475 0.000337 29.670431 ... \n",
"\n",
" chroma_mean_6 chroma_var_1 chroma_var_2 chroma_var_3 chroma_var_4 \\\n",
"0 0.100146 0.244700 0.044746 0.247899 0.065782 \n",
"46 0.095222 0.211930 0.052394 0.201273 0.043756 \n",
"92 0.073941 0.408669 0.073894 0.547632 0.122644 \n",
"138 0.106601 0.547292 0.092144 0.657226 0.119275 \n",
"184 0.096787 0.255970 0.075524 0.193062 0.032114 \n",
"... ... ... ... ... ... \n",
"45770 0.084771 0.406211 0.035509 0.330961 0.093065 \n",
"45816 0.055166 0.347186 0.037476 0.562132 0.088365 \n",
"45862 0.097083 0.409299 0.044416 0.457064 0.087882 \n",
"45908 0.066175 0.226563 0.040740 0.334850 0.086914 \n",
"45954 0.026997 0.422365 0.063259 0.672558 0.127945 \n",
"\n",
" chroma_var_5 chroma_var_6 bpm_second bm_first \\\n",
"0 0.335636 0.083699 129.199219 123.046875 \n",
"46 0.331534 0.096766 69.837416 66.256010 \n",
"92 0.322317 0.055691 78.302557 151.999081 \n",
"138 0.511363 0.092011 64.599609 63.024009 \n",
"184 0.531243 0.131189 66.256010 129.199219 \n",
"... ... ... ... ... \n",
"45770 0.217626 0.026933 198.768029 215.332031 \n",
"45816 0.298203 0.030091 78.302557 234.907670 \n",
"45862 0.341546 0.039950 123.046875 258.398438 \n",
"45908 0.379064 0.116438 234.907670 215.332031 \n",
"45954 0.428266 0.070846 258.398438 129.199219 \n",
"\n",
" tempo_strength_second \n",
"0 0.697285 \n",
"46 0.535636 \n",
"92 0.604331 \n",
"138 0.547889 \n",
"184 0.544492 \n",
"... ... \n",
"45770 0.775188 \n",
"45816 0.745270 \n",
"45862 0.787496 \n",
"45908 0.669523 \n",
"45954 0.638906 \n",
"\n",
"[1000 rows x 46 columns]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p1=ProcessDataset();\n",
"p1.extractFeatures();\n",
"p1.dataframe"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"dir=\"../genres\";\n",
"genre_dir={\"blues\":\"blues\",\"classical\":\"classical\",\"country\":\"country\",\"disco\":\"disco\",\"hiphop\":\"hiphop\",\"jazz\":\"jazz\",\"metal\":\"metal\",\"pop\":\"pop\",\"reggae\":\"reggae\",\"rock\":\"rock\"};"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1025"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"genre=\"disco\"\n",
"\n",
"audio_number=\"%0.5d\"%0;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"\n",
"pp=PreProcessing(filename); \n",
"s,p=pp.getSpectrogram();\n",
"len(s)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1290"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"genre=\"disco\"\n",
"audio_number=\"%0.5d\"%0;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"\n",
"pp=PreProcessing(filename); \n",
"a=librosa.feature.melspectrogram(y=pp.y, sr=pp.sr,n_mels=10)\n",
"len(a[0])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Colums 46\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>type</th>\n",
" <th>y_index</th>\n",
" <th>y</th>\n",
" <th>centroid mean</th>\n",
" <th>rolloff mean</th>\n",
" <th>zero mean</th>\n",
" <th>rms mean</th>\n",
" <th>rms var</th>\n",
" <th>contrast mean</th>\n",
" <th>...</th>\n",
" <th>chroma_mean_6</th>\n",
" <th>chroma_var_1</th>\n",
" <th>chroma_var_2</th>\n",
" <th>chroma_var_3</th>\n",
" <th>chroma_var_4</th>\n",
" <th>chroma_var_5</th>\n",
" <th>chroma_var_6</th>\n",
" <th>bpm_second</th>\n",
" <th>bm_first</th>\n",
" <th>tempo_strength_second</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>00098</td>\n",
" <td>disco</td>\n",
" <td>3</td>\n",
" <td>[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>2417.547068</td>\n",
" <td>5384.369095</td>\n",
" <td>0.112626</td>\n",
" <td>0.122804</td>\n",
" <td>0.001554</td>\n",
" <td>24.266525</td>\n",
" <td>...</td>\n",
" <td>0.078891</td>\n",
" <td>0.428091</td>\n",
" <td>0.064880</td>\n",
" <td>0.515520</td>\n",
" <td>0.116679</td>\n",
" <td>0.484060</td>\n",
" <td>0.057560</td>\n",
" <td>161.499023</td>\n",
" <td>61.523438</td>\n",
" <td>0.767122</td>\n",
" </tr>\n",
" <tr>\n",
" <td>46</td>\n",
" <td>00099</td>\n",
" <td>disco</td>\n",
" <td>3</td>\n",
" <td>[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>2417.547068</td>\n",
" <td>5384.369095</td>\n",
" <td>0.112626</td>\n",
" <td>0.122804</td>\n",
" <td>0.001554</td>\n",
" <td>24.266525</td>\n",
" <td>...</td>\n",
" <td>0.078891</td>\n",
" <td>0.428091</td>\n",
" <td>0.064880</td>\n",
" <td>0.515520</td>\n",
" <td>0.116679</td>\n",
" <td>0.484060</td>\n",
" <td>0.057560</td>\n",
" <td>161.499023</td>\n",
" <td>61.523438</td>\n",
" <td>0.767122</td>\n",
" </tr>\n",
" <tr>\n",
" <td>92</td>\n",
" <td>00000</td>\n",
" <td>disco</td>\n",
" <td>3</td>\n",
" <td>[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]</td>\n",
" <td>2295.772581</td>\n",
" <td>4884.139433</td>\n",
" <td>0.096195</td>\n",
" <td>0.142213</td>\n",
" <td>0.004145</td>\n",
" <td>18.022094</td>\n",
" <td>...</td>\n",
" <td>0.091744</td>\n",
" <td>0.433943</td>\n",
" <td>0.064803</td>\n",
" <td>0.492812</td>\n",
" <td>0.125874</td>\n",
" <td>0.481689</td>\n",
" <td>0.089429</td>\n",
" <td>57.421875</td>\n",
" <td>112.347147</td>\n",
" <td>0.708882</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>3 rows × 46 columns</p>\n",
"</div>"
],
"text/plain": [
" id type y_index y centroid mean \\\n",
"0 00098 disco 3 [0, 0, 0, 1, 0, 0, 0, 0, 0, 0] 2417.547068 \n",
"46 00099 disco 3 [0, 0, 0, 1, 0, 0, 0, 0, 0, 0] 2417.547068 \n",
"92 00000 disco 3 [0, 0, 0, 1, 0, 0, 0, 0, 0, 0] 2295.772581 \n",
"\n",
" rolloff mean zero mean rms mean rms var contrast mean ... \\\n",
"0 5384.369095 0.112626 0.122804 0.001554 24.266525 ... \n",
"46 5384.369095 0.112626 0.122804 0.001554 24.266525 ... \n",
"92 4884.139433 0.096195 0.142213 0.004145 18.022094 ... \n",
"\n",
" chroma_mean_6 chroma_var_1 chroma_var_2 chroma_var_3 chroma_var_4 \\\n",
"0 0.078891 0.428091 0.064880 0.515520 0.116679 \n",
"46 0.078891 0.428091 0.064880 0.515520 0.116679 \n",
"92 0.091744 0.433943 0.064803 0.492812 0.125874 \n",
"\n",
" chroma_var_5 chroma_var_6 bpm_second bm_first tempo_strength_second \n",
"0 0.484060 0.057560 161.499023 61.523438 0.767122 \n",
"46 0.484060 0.057560 161.499023 61.523438 0.767122 \n",
"92 0.481689 0.089429 57.421875 112.347147 0.708882 \n",
"\n",
"[3 rows x 46 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"genre=\"disco\"\n",
"pds=ProcessDataset();\n",
"\n",
"audio_number=\"%0.5d\"%98;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"pds.extractTimberalFeatures(genre,audio_number,filename);\n",
"\n",
"audio_number=\"%0.5d\"%99;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"pds.extractTimberalFeatures(genre,audio_number,filename);\n",
"\n",
"audio_number=\"%0.5d\"%0;\n",
"filename=dir+\"/\"+genre_dir[genre]+\"/\"+genre_dir[genre]+\".\"+audio_number+\".wav\"; \n",
"pds.extractTimberalFeatures(genre,audio_number,filename);\n",
"\n",
"#pds.extractFeatures();\n",
"pds.dataframe"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def partitionDataFrame(df,ratio):\n",
" df = df.sample(frac=1).reset_index(drop=True)#shuffling rows\n",
" df = df.sample(frac=1).reset_index(drop=True)#again shuffling\n",
" size=df[\"id\"].count();\n",
" limit=int(ratio*size);\n",
" train_ds=df.loc[0:limit]; \n",
" test_ds=df.loc[limit:size];\n",
" train_ds.to_csv(\"train.csv\",sep=\",\");\n",
" test_ds.to_csv(\"test.csv\",sep=\",\");\n",
" print(\"Partitioning done\");"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Partitioning done\n"
]
}
],
"source": [
"df=readCSVFile(\"audiofeatures.csv\");\n",
"partitionDataFrame(df,0.9);\n"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
This code is submitted as a part of the Project in the course CS725 in the autumn semester 2019.
The GTZAN dataset(with the name: genres) is required to be kept at the location "../code" . The link to download the dataset is :
http://marsyas.info/downloads/datasets.html
(Approximately 1.2GB)
To run :
Use jupyter notebook.
First run the "preprocess.ipynb", then "trainNtest.ipynb"
Team Details:
193050003 : Suraj Kumar
193050067 : Yadnyesh Patil
193059002 : Rajershi Gupta
193050022 : Aman Kumar Singh
\ No newline at end of file
,Unnamed: 0,id,type,y_index,y,centroid mean,rolloff mean,zero mean,rms mean,rms var,contrast mean,contrast var,mfcc1 mean,mfcc1 var,mfcc2 mean,mfcc2 var,mfcc3 mean,mfcc3 var,mfcc4 mean,mfcc4 var,mfcc5 mean,mfcc5 var,mel1 mean,mel1 var,mel2 mean,mel2 var,mel3 mean,mel3 var,mel4 mean,mel4 var,mel5 mean,mel5 var,chroma_mean_1,chroma_mean_2,chroma_mean_3,chroma_mean_4,chroma_mean_5,chroma_mean_6,chroma_var_1,chroma_var_2,chroma_var_3,chroma_var_4,chroma_var_5,chroma_var_6,bpm_second,bm_first,tempo_strength_second
900,32476,6,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",2124.8964478867483,4978.025867550872,0.06762089692344961,0.09396819025278093,0.001463073189370334,23.45123500094369,26.480354999476987,-169.18728637695312,4911.0078125,94.65843963623048,579.417236328125,24.54653549194336,352.8388977050781,27.451528549194336,180.11016845703125,11.634444236755373,62.0421371459961,10.076539993286133,82.4892807006836,1.0731030702590942,2.263891696929932,1.3365746736526491,7.020498752593994,0.3260074257850647,0.4545958042144776,0.1829150766134262,0.07699296623468399,0.5539796948432922,0.12931060791015625,0.3808411657810211,0.06823572516441345,0.3234788179397583,0.06779558956623077,0.2583819627761841,0.04783359542489052,0.27921700477600103,0.049788329750299454,0.35297074913978577,0.1194651499390602,61.5234375,184.5703125,0.7486772208367113
901,10258,23,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1496.6587872379525,3056.062295603197,0.03550599563953488,0.03877818211913109,0.00046465219929814333,26.927971057556555,27.269813692003346,-353.2105712890625,6483.01025390625,110.63567352294922,801.042236328125,32.833740234375,701.8229370117188,24.165679931640625,275.96588134765625,18.756874084472656,232.31011962890625,2.354298591613769,7.2848472595214835,0.4918922185897827,1.9117369651794436,0.1708715409040451,0.5034690499305725,0.06651458889245987,0.12720222771167755,0.03676969558000565,0.06028443574905396,0.3056666254997253,0.10488881915807724,0.2293792963027954,0.06093376874923706,0.2528017461299896,0.10385967046022417,0.2468795478343964,0.07019539177417755,0.3372190296649933,0.0728430449962616,0.5535060167312622,0.17295707762241366,172.265625,80.74951171875,0.5242828427676084
902,26864,84,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",2872.304374690372,6132.990098110465,0.1181250757025194,0.051622334867715836,0.00046380978892557323,21.310290169948487,23.129727509921747,-178.22836303710938,2495.433837890625,61.9981460571289,369.87396240234375,1.4360841512680054,320.8524169921875,36.07133483886719,108.30149841308594,7.565858840942383,91.6313247680664,1.7936381101608276,2.211169958114624,1.021234154701233,1.881957769393921,0.5251045823097229,0.8102635741233826,0.4186612367630005,0.9022169709205629,0.2385928630828857,0.1809653043746948,0.47040963172912603,0.11741020530462265,0.4164496958255768,0.06510397791862488,0.4475269019603729,0.09835229068994522,0.3864865899085999,0.07085903733968735,0.3669869303703308,0.06634718179702759,0.3298816680908203,0.06687972694635391,63.024009146341456,123.046875,0.5968846339987611
903,23460,10,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",828.5158499128612,1552.1349813771806,0.03306686046511628,0.06413640826940536,0.0016535212052986026,24.240456913794173,20.98650433260248,-318.7840576171875,11668.16015625,162.79043579101562,553.2947387695311,-16.419504165649414,2928.466064453125,39.10525131225586,268.85720825195307,31.488971710205078,199.7197265625,6.1772727966308585,42.44692993164063,0.8561108708381653,2.2517194747924805,0.2356383502483368,0.15707871317863464,0.7284728288650513,1.6824476718902588,0.6643171310424805,1.8585070371627808,0.2653049230575561,0.08573822677135468,0.2647178471088409,0.04678025469183922,0.4398587942123413,0.12813591957092285,0.3810545802116394,0.10429853200912476,0.3588166832923889,0.07918273657560349,0.2461797147989273,0.058385353535413735,161.4990234375,117.45383522727272,0.3903696591899212
904,36662,97,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",3512.2924402843737,7589.869867369186,0.13742656855620156,0.2040589302778244,0.01963871531188488,20.57897473758914,26.806870539163498,-125.5443344116211,5416.26904296875,51.14413070678711,1156.39501953125,38.53379821777344,1129.285888671875,14.475336074829102,492.0675964355469,16.201366424560547,272.51229858398443,33.46435546875,1876.7352294921875,2.9598603248596187,21.363374710083008,1.3225435018539429,3.830956220626831,0.7698804140090942,2.4658844470977783,0.6602984070777893,2.6089131832122803,0.4468372762203217,0.08848461508750917,0.42452239990234375,0.07063424587249756,0.4915040135383606,0.11016535758972168,0.4218857884407044,0.0772789865732193,0.4403286278247833,0.08156415075063705,0.4220324754714966,0.07972027361392975,198.76802884615384,99.38401442307692,0.6982929946619664
905,38226,31,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",1576.9127914898706,3538.197390534157,0.05848171027131782,0.09219224005937576,0.0018863707082346077,27.603891250717115,30.60474304308737,-226.328857421875,8562.89453125,103.4830322265625,646.3579711914062,0.2701510787010193,985.3954467773438,44.01379776000977,353.2588806152344,10.727282524108887,517.4627075195311,7.970878601074219,105.83350372314452,0.5202570557594299,1.2595683336257937,0.4642479717731476,2.1668448448181152,0.5767558813095093,2.694655179977417,0.16260527074337006,0.13777032494544986,0.6478978991508484,0.11289604008197784,0.5218036770820618,0.04802216589450836,0.5439463853836061,0.0728226751089096,0.397508442401886,0.048051558434963226,0.4156799912452698,0.08691543340682982,0.3967621922492981,0.06444734334945679,52.734375,80.74951171875,0.6603538654416371
906,28474,19,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2700.647462528509,5386.973110465116,0.16150337633236433,0.10085272043943404,0.0009691770537756382,15.183970319822269,16.071322404985832,-89.31684875488281,3157.326416015625,82.32291412353516,376.2969665527344,-23.261905670166016,210.69859313964844,68.09683990478516,139.68887329101562,-13.098339080810547,83.45713806152344,9.73676300048828,60.50719451904297,1.5674368143081665,2.599796772003174,0.8706703186035156,1.8138788938522337,0.5419857501983643,1.1713584661483765,0.6229020357131958,0.9303933382034302,0.4593130052089691,0.05250740796327591,0.4582765698432922,0.05538154393434525,0.4939363300800324,0.05201875045895577,0.5468605160713196,0.06472524255514145,0.5874320268630981,0.05918702110648155,0.5678079724311829,0.051189221441745765,112.34714673913044,107.666015625,0.7022088636886886
907,44942,77,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2188.620574204777,4994.117346475291,0.1062935289486434,0.12876585125923154,0.0019139201613143086,17.735840760236407,23.671518133833818,-103.8831024169922,2909.5634765625,101.88799285888672,351.39215087890625,-10.35607624053955,427.8530883789063,43.67078018188477,158.20645141601562,-11.544981002807615,134.73138427734378,16.080528259277347,195.6978454589844,3.314534902572632,19.18746566772461,3.066410779953003,23.01833915710449,1.5794744491577148,9.026198387145996,0.7742032408714294,1.8316625356674197,0.3886460065841675,0.06081227585673332,0.4260536730289459,0.07736101746559143,0.3877261579036713,0.05323388054966927,0.5444072484970093,0.09776517003774644,0.4789472222328186,0.0640333890914917,0.4867457151412964,0.07007323205471039,215.33203125,53.8330078125,0.6763846506054311
908,27462,97,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",1175.1869624736114,2340.993027797965,0.03987251695736434,0.021218478679656986,0.00018388759053777903,20.76920795654405,28.346583215033675,-413.6007690429688,2118.906494140625,118.30582427978516,534.1683349609375,31.173622131347656,807.3428955078125,40.15095520019531,169.4828338623047,13.11996078491211,148.06040954589844,0.6402610540390015,0.8494895696640015,0.23275141417980194,0.10915809869766237,0.04983975365757942,0.012028771452605723,0.020265540108084682,0.0031494677532464266,0.0065352190285921105,0.000774556421674788,0.1757855862379074,0.05391702428460121,0.23242759704589844,0.11619378626346588,0.1922404915094376,0.07096368074417114,0.22960011661052704,0.1244485080242157,0.1949043869972229,0.07140867412090303,0.1989830732345581,0.08264843374490738,54.97839095744681,198.76802884615384,0.5054011246925231
909,1288,28,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",1115.660646203261,2289.3968023255816,0.047986312984496134,0.0997576341032982,0.0041530714370310315,15.088748278749025,20.099145893752166,-248.9816131591797,4978.76708984375,139.06259155273438,399.2952575683594,-16.255664825439453,1165.5279541015625,57.04351425170898,328.7342529296875,20.20447540283203,158.43019104003906,14.673212051391602,235.8189849853516,4.968308448791504,109.48518371582031,1.8627793788909912,32.892765045166016,3.7309861183166495,338.3106384277344,2.3739287853240967,105.22175598144531,0.2905121147632599,0.08497443050146103,0.2203947603702545,0.06670602411031723,0.25772103667259216,0.10017769038677216,0.17737622559070587,0.051497992128133774,0.21067187190055847,0.06919437646865845,0.3078413009643555,0.11358974128961564,103.359375,198.76802884615384,0.6619229836192929
910,34316,46,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",2836.9072471508625,6483.33865143532,0.1220203488372093,0.20339107513427732,0.005568280816078186,23.29691699094829,36.64697108801462,-72.28729248046875,5425.70556640625,81.3790054321289,1087.34521484375,16.795759201049805,1011.3702392578124,8.66297721862793,405.15557861328125,14.12635612487793,247.68638610839844,38.457313537597656,1560.0589599609375,7.368675231933594,41.892845153808594,5.3872647285461435,40.39888000488281,3.329366445541382,21.956762313842773,2.4446187019348145,17.508920669555664,0.4276010990142822,0.11234140396118164,0.405032217502594,0.09414894133806227,0.3616273403167725,0.07074276357889175,0.4078534841537476,0.08966249227523804,0.39189064502716064,0.07319419831037521,0.4999436438083649,0.10475707799196243,172.265625,117.45383522727272,0.6933703776436985
911,7452,62,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1475.154232379175,2810.450240734011,0.0740226804748062,0.03899567574262619,0.001311509171500802,29.364362476280032,20.377147783883075,-305.31573486328125,19565.29296875,135.90338134765622,1056.6259765625,-11.741782188415527,461.6817932128906,18.203176498413086,108.4419937133789,10.39816188812256,148.40110778808594,1.7783067226409912,10.464824676513672,1.2222553491592407,5.687466144561768,0.8059856295585632,4.1435227394103995,0.7535573840141296,3.5402824878692627,0.4864453673362732,2.5866858959198,0.4345586597919464,0.13452929258346558,0.2599126398563385,0.036280617117881775,0.33320632576942444,0.10639648139476776,0.21809355914592746,0.059493675827980035,0.24328374862670896,0.0395021103322506,0.4542883634567261,0.1273147016763687,89.10290948275862,172.265625,0.6881952436255491
912,34960,60,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",3498.7501500586377,7665.945505541425,0.13586028343023254,0.2740567922592163,0.015130908228456976,18.8464407209014,33.185277498093,-46.35695266723633,4335.12109375,55.8851318359375,946.797119140625,26.181718826293945,559.8524780273439,16.538450241088867,245.9687957763672,7.1011924743652335,213.04937744140625,48.87765502929688,2383.119873046875,18.28315544128418,551.5888061523439,10.337197303771973,250.5611724853516,3.63270115852356,74.05972290039062,2.3230252265930176,31.85644340515137,0.4983810186386109,0.11939310282468794,0.41653650999069214,0.08934042602777481,0.36059141159057617,0.07195419073104857,0.4528666734695434,0.12284477055072784,0.4139856696128845,0.11300843954086305,0.4173034727573395,0.1373659074306488,64.599609375,78.30255681818181,0.5426753892481895
913,37490,15,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",1924.8072253525927,4496.266351744186,0.06827988735465118,0.13209307193756106,0.0029715970158576965,18.81330221266457,14.526086643787167,-157.55178833007812,3851.56982421875,109.80972290039062,845.4383544921875,8.477041244506836,521.0712280273439,41.79124069213867,275.97836303710943,5.096587181091309,201.5833282470703,20.843297958374023,412.5670471191406,3.4247827529907227,39.3358154296875,1.061726450920105,6.051980972290039,0.5782095789909363,3.5075695514678955,0.3721153140068054,0.5855040550231934,0.32880595326423645,0.08196521550416946,0.34560859203338623,0.0795675590634346,0.4473603963851929,0.12525300681591034,0.4189053177833557,0.11476296186447145,0.329593300819397,0.061430051922798164,0.41550663113594055,0.11702095717191695,123.046875,63.024009146341456,0.708137446101194
914,20240,40,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",2429.75140581165,5271.84558957122,0.10139179081879847,0.13064056634902954,0.010919202119112015,25.033259387757663,29.477530020905032,-185.4112091064453,9968.783203125,96.80635833740234,2127.042724609375,44.62500762939453,740.9881591796875,13.899332046508787,308.9228210449219,5.999122619628906,247.4444732666016,20.746788024902344,1739.03955078125,6.507495880126952,34.649253845214844,2.4012997150421143,27.558218002319336,1.6932607889175415,21.157352447509766,0.4359277486801148,1.1548539400100708,0.24397164583206174,0.041726909577846534,0.41622447967529297,0.12836946547031405,0.3342703878879547,0.0617963932454586,0.5283083915710449,0.13816528022289276,0.324966698884964,0.06805851310491562,0.3364435136318207,0.0833204835653305,78.30255681818181,80.74951171875,0.5858607773135753
915,10488,28,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1472.8321115131307,2922.9069767441856,0.05978682170542635,0.09421531856060028,0.0009501975728198887,27.65887566741971,36.63772420098112,-169.12982177734375,1607.350341796875,132.87136840820312,334.7182312011719,-13.480005264282227,267.8920288085937,31.19780158996582,161.5392608642578,6.3390254974365225,162.08226013183594,10.843610763549805,59.78014755249024,4.5686869621276855,33.474205017089844,1.3451681137084959,4.523875236511231,0.5695623159408569,0.935800075531006,0.4983722567558289,0.72385573387146,0.2249640375375748,0.06489972025156021,0.3447352647781372,0.08728556334972383,0.41399285197258,0.10739099979400636,0.27135857939720154,0.05544046312570572,0.3381713926792145,0.11281485110521315,0.3250252306461334,0.07661531120538713,172.265625,89.10290948275862,0.7201640190962383
916,18814,9,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",2199.6943269775334,4790.7704623909885,0.0982978288517442,0.2159680724143982,0.00996615830808878,16.359612673606616,13.7767714424869,-94.84095001220705,5000.23388671875,94.21648406982422,1625.7972412109375,-2.4802076816558842,660.3566284179688,49.6192626953125,289.4857177734375,-6.618143081665039,229.7904815673828,45.50046157836914,2139.087890625,4.2221126556396475,45.76997756958008,2.0756938457489014,17.259336471557614,1.248685002326965,6.077511787414551,0.9052414298057556,2.838468313217163,0.6240606307983398,0.07632151991128923,0.5315296053886414,0.05995650589466095,0.5408739447593689,0.0694112703204155,0.5950061082839966,0.08219311386346817,0.6407185196876526,0.07884441316127777,0.6365951895713806,0.06616812944412231,198.76802884615384,215.33203125,0.5806391828721261
917,16146,51,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2652.1969453642473,5374.245151253634,0.1578121214874031,0.10648034512996674,0.0012398331891745329,18.279462451803397,15.285075267725404,-77.08245849609375,1655.1707763671875,89.32469177246094,318.6979064941406,-34.209972381591804,288.7418518066406,38.68795394897461,146.86070251464844,-22.28695106506348,113.01470184326172,7.232938289642334,77.33460235595703,3.8271362781524663,19.299997329711914,2.8592724800109863,12.21214771270752,2.2969167232513428,7.097402095794678,1.5521793365478516,3.4047563076019287,0.6296006441116333,0.09054650366306304,0.3567074239253998,0.041037358343601234,0.3904575407505035,0.04533094167709351,0.5559771060943604,0.08318356424570084,0.3926851153373718,0.03564475104212761,0.42093485593795776,0.07515402883291245,112.34714673913044,215.33203125,0.7580352514740546
918,45494,89,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",1611.2328620084254,3383.7175236191856,0.07333378754844963,0.1052665263414383,0.001384591800160706,27.77800418823349,28.015345505190314,-156.16943359375,2890.17431640625,130.70120239257812,677.866943359375,-25.256765365600586,211.7228240966797,43.49602890014648,182.6109313964844,-12.136853218078613,130.75486755371094,10.896059036254883,111.27261352539062,4.949889659881592,67.63881683349611,2.446239948272705,17.326942443847653,1.5700591802597046,8.345260620117188,0.6653796434402466,2.5388944149017334,0.3040643632411957,0.08326394855976105,0.2580731511116028,0.04468932747840881,0.4110622107982636,0.1028805524110794,0.2931769788265228,0.059978634119033813,0.3340417742729187,0.1090688332915306,0.25351130962371826,0.04755786433815956,112.34714673913044,54.97839095744681,0.6690185116154203
919,29624,44,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2760.89532833908,5262.147301962209,0.17119897650193802,0.09537798166275024,0.0005899276584386827,21.692925340970763,11.970268826361055,-86.26968383789062,882.7426147460938,76.71849822998047,385.3562927246094,-42.29021072387695,284.1974182128906,54.01255416870117,96.89482879638672,-8.308841705322267,76.78397369384766,6.610039710998535,29.52856063842773,0.9287550449371338,1.482842206954956,1.763253092765808,9.8767728805542,1.4671469926834106,3.91616439819336,0.9793763756752014,0.803864061832428,0.43129807710647583,0.07562868297100067,0.3540743589401245,0.04674159362912178,0.42657670378685,0.06993362307548523,0.43061307072639465,0.05172043293714523,0.4859161078929901,0.07862479984760284,0.4904286563396454,0.07833019644021988,58.72691761363637,234.90767045454547,0.7220812191854528
920,17066,71,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2809.023526576844,6001.746059683866,0.15583363614341084,0.09825751185417177,0.0015632490394636989,20.82697175543533,33.29585404629082,-105.49476623535156,1589.6016845703125,79.2432861328125,316.9864196777344,-15.17329216003418,364.7824096679688,40.84367370605469,136.03672790527344,-12.265158653259276,130.79084777832028,7.858724117279053,83.6683349609375,2.3294203281402592,9.061062812805176,1.457860827445984,3.027313709259033,0.9155572652816772,1.7868710756301882,0.8826656341552734,1.5777451992034912,0.4911768734455109,0.10081200301647186,0.3526676297187805,0.0726340264081955,0.3816590905189514,0.07069975882768631,0.5722726583480835,0.09807781875133514,0.5569587349891663,0.0649198666214943,0.6481313109397888,0.1019667387008667,215.33203125,112.34714673913044,0.7094845666958416
921,30958,73,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2641.095797210522,5564.146302688952,0.12135303112887595,0.29333803057670593,0.002211449900642037,20.954231530025613,26.212541020007592,2.7178800106048584,1021.2662963867188,77.11536407470703,422.3346862792969,-17.604856491088867,270.58984375,58.02186965942383,206.26670837402344,0.6837030649185181,144.8165283203125,79.9072036743164,1420.3577880859375,12.43594455718994,289.452880859375,6.066581726074219,73.57818603515625,4.016221523284912,21.47496795654297,3.450713396072388,11.513875007629395,0.34073907136917114,0.052821587771177285,0.4462661147117615,0.09252356737852097,0.5493535995483398,0.056708604097366326,0.6889656782150269,0.10280723869800568,0.4812867045402527,0.05357817932963371,0.3282478153705597,0.04365945979952812,73.828125,71.77734375,0.6466407874270219
922,8970,95,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1800.2026289804553,3425.0729583030525,0.12421382933624033,0.013569661416113377,0.0002298067265655845,17.972565046606096,12.360227978572773,-422.6913757324219,6861.56689453125,89.84625244140625,1016.0383911132812,-18.687679290771484,438.3485412597656,37.81205368041992,108.8748779296875,6.021198749542236,139.33914184570312,0.343342661857605,1.4599937200546265,0.24398013949394226,0.5939095616340637,0.10322099924087524,0.07309049367904663,0.01920829527080059,0.002402630401775241,0.023993656039237976,0.003081220900639892,0.29392197728157043,0.12291678786277772,0.1585114300251007,0.024220369756221768,0.3564905822277069,0.14182117581367493,0.16835057735443115,0.054738935083150864,0.12503455579280853,0.02126895077526569,0.33690643310546875,0.15338730812072754,86.1328125,184.5703125,0.7387083089448376
923,33948,38,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",3266.6226965172564,6920.662983739099,0.14627505753391473,0.22215387225151065,0.0061198300682008275,24.189491213567035,27.996460378640233,-15.558849334716795,3988.326416015625,59.30199813842773,555.0645141601561,-1.5291845798492432,342.6094055175781,12.580965042114258,157.17347717285156,8.791238784790039,122.00727081298828,34.782520294189446,1365.9951171875,13.524537086486815,184.89093017578125,10.710164070129396,169.72865295410156,5.375289916992188,52.29078674316406,4.0749778747558585,19.51620483398437,0.32070833444595337,0.05765242874622345,0.4465368986129761,0.10399463027715684,0.3372121155261993,0.06671414524316788,0.41012293100357056,0.08563259989023209,0.4887939393520355,0.11297387629747392,0.3604299426078797,0.07026723772287369,95.703125,92.28515625,0.6739523251144669
924,4922,7,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1358.864758980256,2667.9638671875,0.07310403040213179,0.04080136865377426,0.0007707675686106086,18.62549086165623,21.879015606210963,-287.0156555175781,7845.33154296875,135.89675903320312,531.6629638671875,-24.41484069824219,524.9478149414061,36.62717819213867,143.34384155273438,-6.2320003509521475,155.35455322265625,2.472736120223999,17.061872482299805,1.0826431512832642,2.406569004058838,0.5562506914138794,0.9613990187644958,0.31016752123832697,0.3780970871448517,0.15527787804603574,0.06931576877832413,0.18931004405021667,0.08420521765947342,0.1412128359079361,0.031161271035671238,0.34060534834861755,0.1009291335940361,0.3950320780277252,0.13340619206428528,0.20457197725772855,0.02329749427735805,0.3896222114562988,0.12826336920261386,234.90767045454547,215.33203125,0.7385006165257914
925,11270,45,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",2775.9782803860053,5619.423203579215,0.13284088844476746,0.1466774344444275,0.0017799517372623086,23.26253718004049,35.612528221376955,-61.25669860839844,2351.36669921875,71.30781555175781,650.878173828125,-17.017440795898438,469.406005859375,17.152019500732422,400.6258850097656,5.077998161315918,193.39236450195312,12.294464111328125,112.1452407836914,13.809263229370115,300.7709655761719,5.924283027648926,70.80567932128906,2.824601650238037,22.654579162597656,2.8153104782104488,21.32497787475586,0.31147462129592896,0.09288699179887773,0.2898118495941162,0.08625596016645433,0.32359692454338074,0.0689166784286499,0.5432246327400208,0.12606200575828552,0.3043608367443085,0.058032143861055374,0.2921864688396454,0.08732107281684875,151.9990808823529,161.4990234375,0.6622494101850307
926,21482,67,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",3052.9717703083306,6667.639500817587,0.12664842235949614,0.21786125004291532,0.01939043216407299,24.464006357393927,37.723368009945936,-74.9818344116211,3453.0712890625,58.73681640625,794.879150390625,9.991755485534668,671.9239501953125,21.602270126342773,293.5630798339844,15.12047290802002,271.47280883789057,39.55341720581055,2892.55126953125,5.090165138244629,71.44720458984375,2.302685499191284,24.243202209472656,1.2515846490859983,5.069212913513184,1.1057870388031006,3.72117018699646,0.5523151755332947,0.08226776123046875,0.4836123883724213,0.06220018118619919,0.5033392906188965,0.07765718549489975,0.4420806169509888,0.07055960595607758,0.40502408146858215,0.06698998063802719,0.4291722476482392,0.0926215797662735,95.703125,198.76802884615384,0.6593373172886924
927,17986,91,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2035.1227602245056,4199.141533430233,0.09147476078003876,0.17295916378498075,0.010132350027561188,20.864292764119195,20.001223116067,-117.21009826660156,8428.87890625,98.53964233398438,944.962890625,-19.028789520263672,822.6848754882812,44.802207946777344,184.0479431152344,3.847917318344116,166.08168029785156,31.22455406188965,2771.650634765625,2.7696564197540283,10.491948127746582,3.4103870391845703,61.796669006347656,5.32816743850708,220.37261962890625,3.919244289398194,111.43269348144531,0.5555213689804077,0.12662732601165771,0.5281449556350708,0.07080895453691483,0.5072224140167236,0.08795379102230072,0.4788079261779785,0.1275063306093216,0.32296067476272583,0.06934140622615814,0.32266727089881897,0.08585580438375473,49.69200721153846,99.38401442307692,0.5944856664138917
928,28658,23,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2577.7103765992497,5060.828545148983,0.1318855226501938,0.19548331201076508,0.001251972746104002,21.621302986675676,23.49651149802685,-43.53426742553711,852.4859619140625,82.7026138305664,238.4517974853516,-29.68454551696777,256.2916259765625,70.44929504394531,128.29031372070312,-21.660533905029297,53.12083435058594,28.0319766998291,223.8537139892578,2.517036437988281,3.558234214782715,1.98824942111969,2.3587422370910645,1.2107923030853271,0.5846032500267029,0.7385110259056091,0.2496947795152664,0.6534085273742676,0.09238360822200777,0.5584855675697327,0.05891243368387222,0.5541695952415466,0.05115154758095741,0.5491652488708496,0.07606439292430878,0.5477023124694824,0.07598117738962172,0.5130674839019775,0.08776142448186874,73.828125,71.77734375,0.7794750372523348
929,42872,32,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2345.3794786149665,4735.234829215116,0.11539902797965115,0.2222426235675812,0.0024446779862046237,19.170571915667416,18.03628722000071,-26.449769973754886,1051.6470947265623,85.80229949951172,494.7423400878906,-16.958152770996097,232.02621459960938,35.25905990600586,128.24624633789062,10.018539428710938,154.7495574951172,38.97169494628906,555.4937133789061,16.55836296081543,355.9454345703125,5.418302536010742,38.32572555541992,5.19159460067749,33.372142791748054,4.756459712982178,18.08973503112793,0.4307180047035217,0.09216244518756866,0.3451519012451172,0.06354134529829025,0.4467923045158386,0.11620407551527025,0.33298301696777344,0.05833481252193451,0.4169210195541382,0.09966988861560823,0.3680044710636139,0.0920850709080696,89.10290948275862,92.28515625,0.6976644094992366
930,42228,18,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2210.0769889321855,4595.369163335757,0.11578397529069767,0.1409025490283966,0.002161622978746891,19.145793678431577,9.824994986660805,-67.37349700927734,1390.0657958984375,109.0892333984375,456.6671447753906,-32.721622467041016,349.9079284667969,45.65694046020508,173.28604125976562,-11.694968223571776,92.1014633178711,17.300251007080078,203.41580200195312,6.249817848205566,77.77704620361328,3.63565731048584,51.51400375366211,2.261918306350708,20.022724151611328,1.6982711553573608,5.558644771575928,0.43436142802238464,0.0771682858467102,0.4237699210643768,0.06046750396490098,0.4320299327373505,0.06991136819124223,0.4607990980148315,0.06526973843574524,0.5624731779098511,0.10217901319265366,0.5100486874580383,0.07274683564901352,112.34714673913044,58.72691761363637,0.6408037341577348
931,11776,56,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1468.9209011761234,3213.421602470931,0.054928991036821716,0.13622723519802096,0.0020326089579612017,24.46121863316665,19.91878798344753,-164.83349609375,4761.39599609375,123.3907699584961,562.322509765625,4.265435695648193,485.0005798339844,48.76637268066406,124.23973846435548,-5.15083646774292,241.3891906738281,16.24212646484375,127.54178619384766,9.237177848815918,191.34152221679688,5.3887786865234375,88.1509780883789,0.9554132223129272,2.7811717987060547,1.0759224891662598,3.62859845161438,0.3600854277610779,0.10272929817438126,0.24797089397907254,0.059543259441852577,0.20854751765728,0.0597054585814476,0.1555888205766678,0.019801555201411247,0.2721309959888458,0.04726669564843178,0.6055071949958801,0.13890478014945984,129.19921875,83.35433467741936,0.6177526417790253
932,3266,71,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",2429.271065820559,5064.167026253634,0.1346736464389535,0.12054172158241272,0.0003268377622589469,23.095098059596467,16.150337278388502,-89.34941864013672,697.4180297851562,93.79451751708984,192.9856109619141,-14.621312141418455,132.20973205566406,54.39927291870117,99.4599838256836,-33.51990127563477,64.56536865234375,11.939398765563965,46.358314514160156,8.927248001098633,39.97028732299805,3.793842315673828,13.80022144317627,0.6067375540733337,0.22550642490386966,0.4789100885391235,0.22155041992664334,0.4833068251609802,0.1282867044210434,0.2423747479915619,0.032582823187112815,0.25094074010849,0.060112614184618,0.23530155420303345,0.062037475407123566,0.31457868218421936,0.03203025460243225,0.6123110055923462,0.1630873680114746,151.9990808823529,73.828125,0.7843303337356531
933,32660,10,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",1903.300551513091,4197.0549827398245,0.06629269622093023,0.184013232588768,0.0031826617196202282,24.41504937726512,25.907257147240863,-110.96826171875,4657.830078125,102.99583435058594,1110.301025390625,10.910284996032717,263.3701171875,34.30783843994141,256.27304077148443,22.333438873291016,124.40885162353516,33.54323959350586,504.5343017578125,9.101655960083008,331.4078063964844,4.526503562927246,154.1333770751953,2.139488220214844,26.4965934753418,1.0664784908294678,2.81447172164917,0.3094800114631653,0.06006716191768646,0.4197258949279785,0.10794484615325928,0.3180567622184753,0.08251506090164185,0.31816259026527405,0.039888203144073486,0.4958904087543488,0.0938604548573494,0.3825682699680328,0.06295865029096602,107.666015625,215.33203125,0.6198335294862612
934,11224,44,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1731.7767171190326,3363.052325581395,0.06652169634205428,0.11373868584632875,0.001415559439919889,22.742325773773604,14.069967274509395,-162.62667846679688,5083.251953125,119.6906280517578,1132.9898681640625,-2.8503448963165283,414.682861328125,20.49009704589844,316.526123046875,27.801471710205078,258.41152954101557,9.51937198638916,51.96957397460938,6.653388500213622,88.6846694946289,2.6349871158599854,19.1140193939209,2.0239720344543457,11.591437339782715,1.2124212980270386,3.9509530067443848,0.2959602177143097,0.05739995837211609,0.3609985709190369,0.10686295479536057,0.2692955434322357,0.04560637474060058,0.4453769326210022,0.1121903732419014,0.393209308385849,0.08851296454668045,0.25747859477996826,0.03842763230204582,151.9990808823529,161.4990234375,0.6521145124293416
935,21206,61,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",1810.659675170898,3805.0588776344484,0.06714662063953489,0.15567269921302795,0.003208283800631761,25.62771167627685,27.471274456201844,-127.38150787353516,3163.587890625,95.79016876220705,504.7765502929688,-12.70615005493164,549.0945434570311,38.04822540283203,340.6086730957031,20.635692596435547,357.6742248535156,21.72462272644043,496.8443908691406,1.875123381614685,4.380354404449463,1.68066668510437,7.1224141120910645,1.8952733278274536,12.174489974975586,1.593718409538269,10.12104320526123,0.5900960564613342,0.10171633213758467,0.482163816690445,0.08520030975341797,0.40176737308502203,0.0633791834115982,0.3589986264705658,0.04787509888410568,0.458911120891571,0.07121071964502335,0.5015008449554443,0.09280610829591752,61.5234375,92.28515625,0.6214444747563089
936,44850,75,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2302.3113489363536,5092.468999818314,0.11155144743217056,0.1266840696334839,0.0017625725595280528,16.461878395003463,22.88811931403725,-113.8080825805664,3614.5791015625,94.89476776123048,629.2637329101562,-4.0834102630615225,401.9394226074219,51.727882385253906,165.49258422851562,-13.771384239196776,151.94781494140625,15.24770450592041,176.86196899414062,4.835638046264648,58.53818893432617,2.730054378509521,27.406496047973636,1.3445123434066772,7.078306674957275,1.1743913888931274,3.7176702022552486,0.3589963912963867,0.08483222126960754,0.3504213094711304,0.07985705137252808,0.3645446002483368,0.08980291336774826,0.3911469280719757,0.07896876335144043,0.4789230823516846,0.10769222676753998,0.3871644139289856,0.07638341933488846,117.45383522727272,60.092659883720934,0.5849567173597094
937,6946,51,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1527.7305520698826,3221.200263444768,0.060080925993217064,0.08059366792440414,0.003171972464770079,17.513847072238985,19.76614982334232,-230.3049468994141,28284.607421875,119.11062622070312,1155.7398681640625,-1.0106165409088137,1083.821533203125,28.384435653686523,96.20307159423828,10.027673721313477,138.42633056640622,8.712245941162111,77.56275177001953,2.746853828430176,11.215487480163574,1.4959557056427002,3.6138706207275386,1.1922041177749634,3.7114043235778813,0.7026355862617493,1.26016104221344,0.3752615451812744,0.08445341140031815,0.3980236351490021,0.07110477983951569,0.4909560978412628,0.1283784806728363,0.4103218913078308,0.06612905114889145,0.45227196812629705,0.10756920278072356,0.3232525587081909,0.03936266526579857,287.109375,258.3984375,0.7184627529638334
938,10442,27,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",2013.3218676780084,3910.2043400254356,0.09745298873546512,0.11664170771837234,0.0010390690295025706,29.74135866828712,23.88142471304852,-100.60416412353516,1933.6744384765625,106.90573120117188,445.16351318359375,-27.17163848876953,572.6624145507812,29.079545974731445,236.40733337402344,5.042586326599121,222.4169158935547,12.1437349319458,65.24390411376953,5.416051864624023,26.296884536743164,3.1254124641418457,17.289295196533207,1.9984852075576784,8.437442779541017,1.858520746231079,6.823991775512695,0.2673497796058655,0.05175939574837685,0.3644699454307556,0.08760906755924225,0.3317526578903198,0.07045065611600876,0.4008731245994568,0.047158397734165185,0.5937950015068054,0.10718673467636107,0.39396122097969055,0.05980497971177101,95.703125,184.5703125,0.7041604728165044
939,41492,2,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",1874.081675501923,3930.4188431140983,0.07650383054748063,0.14856287837028506,0.006566631607711315,20.07556597302763,23.564266518809163,-120.56072998046876,8105.82470703125,117.61126708984376,856.9244384765625,-27.530702590942386,546.1229858398439,42.813270568847656,194.3345184326172,-6.713432788848878,296.5418701171875,22.86515045166016,665.9428100585938,10.188684463500977,303.69085693359375,5.569652557373047,171.97789001464844,2.3758273124694824,13.648791313171387,1.6511913537979126,14.940119743347168,0.5074145793914795,0.08801102638244629,0.4845831692218781,0.04774662479758263,0.7306382060050964,0.09645573794841766,0.3970604836940765,0.032545488327741616,0.28871697187423706,0.04895377531647682,0.2744816243648529,0.0546894446015358,52.734375,103.359375,0.567649121129069
940,26128,68,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",1382.8698500222965,2832.9182185683144,0.061262263808139525,0.09958875924348833,0.003942895680665971,15.884770289658075,17.35431619940289,-204.30194091796875,4921.236328125,138.59242248535156,693.9564208984375,-10.844313621520996,443.1589050292969,46.55894470214844,123.82059478759766,-22.33910179138184,145.79505920410156,14.6957426071167,275.03033447265625,10.286147117614746,329.1253356933594,2.0069684982299805,23.49201965332031,1.4970805644989014,6.348833560943604,1.0269649028778076,4.0501766204833975,0.23579174280166626,0.09194092452526093,0.18808506429195404,0.04975984618067741,0.27187910676002497,0.09341178834438324,0.2846668362617493,0.08137154579162598,0.2764779031276703,0.06784486770629883,0.37342768907547,0.1225866749882698,75.99954044117645,71.77734375,0.5232737125165259
941,24610,35,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",844.0832306354117,1609.248046875,0.037718023255813964,0.09158013761043547,0.0012306493008509278,16.89140535892518,16.10464099638537,-261.773681640625,2607.228759765625,182.56704711914062,460.0680236816406,-16.90477180480957,653.1490478515625,49.90273666381836,227.9740753173828,-1.1805568933486938,91.24283599853516,14.901339530944824,115.41128540039062,3.626157522201538,19.14691734313965,0.4568453133106232,0.2723375558853149,0.5073347687721252,0.8542929291725159,0.15822753310203552,0.06316797435283661,0.4028065800666809,0.14257332682609558,0.2371043860912323,0.053352486342191696,0.3237728476524353,0.1474648118019104,0.2085338532924652,0.040067102760076516,0.2747386395931244,0.09839379042387007,0.2045033574104309,0.06577428430318832,69.83741554054055,73.828125,0.5969045303204011
942,37950,25,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",1708.7658388923808,3582.640920239825,0.07367407037306202,0.12675757706165314,0.0029818238690495487,20.64752959881901,23.174438900292692,-177.45849609375,8154.5859375,110.97771453857422,1005.1522216796876,-15.617277145385742,996.8001708984376,36.79109191894531,301.03411865234375,0.10515231639146803,362.6679382324219,12.457873344421387,179.99151611328125,4.939981460571289,113.02339935302734,2.9959418773651123,33.382984161376946,1.7897323369979858,9.244873046875,1.4144054651260376,6.396420955657959,0.3651035726070404,0.1116722896695137,0.29969412088394165,0.062207378447055824,0.4175257980823517,0.11644211411476135,0.3667084574699402,0.07741611450910567,0.4441927671432495,0.11736240983009337,0.38082101941108704,0.10767649859189987,60.092659883720934,117.45383522727272,0.5333958051294897
943,44160,60,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2798.5088571152082,6209.0323514716565,0.13466266957364342,0.1033713072538376,0.000598921615164727,15.958852785946796,16.135132140396344,-82.58525085449219,1411.1470947265625,83.4460220336914,527.08447265625,-0.5422784090042114,224.9756317138672,10.46358871459961,232.89181518554688,10.416486740112305,76.96280670166016,7.492655277252197,23.33138084411621,3.855425119400024,14.01517105102539,2.5841495990753174,6.317984580993652,2.5235397815704346,14.623157501220705,1.1653692722320557,1.738080978393555,0.4086273908615112,0.09281209111213684,0.294694185256958,0.0403878390789032,0.4276531934738159,0.10788913816213608,0.3756563365459442,0.04558873176574707,0.5997008085250854,0.10042332112789154,0.38426858186721796,0.06436147540807724,184.5703125,89.10290948275862,0.6832401740163128
944,28520,20,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2658.094745905577,5359.163562863372,0.15232595990794573,0.11730121076107025,0.0008672555559314787,14.859968551615117,12.48413235546536,-75.02699279785156,1277.194580078125,81.1655044555664,298.4375915527344,-20.169677734375,109.54600524902344,68.2874755859375,96.57893371582031,-11.308504104614258,61.95248794555664,13.296243667602539,112.1702651977539,2.551121234893799,9.527674674987793,0.9488166570663452,1.6776845455169678,0.4849285781383514,0.7992407083511353,0.6498367190361023,0.679377019405365,0.3998102247714996,0.04700880870223045,0.4064939022064209,0.05948792770504952,0.44936174154281616,0.0680767223238945,0.4547044932842255,0.06239260733127594,0.4791873395442962,0.059332512319087975,0.487208366394043,0.05606909468770027,234.90767045454547,123.046875,0.6994326152621723
945,3542,77,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",2206.596752585708,4656.9057162972385,0.11141858951065893,0.24332819879055026,0.005089746322482824,20.13352886330661,27.37345834747481,-28.99103736877441,1957.18408203125,104.54033660888672,307.7263488769531,-30.97092056274414,308.2872009277344,38.13065719604492,108.98340606689452,-7.9947638511657715,133.69615173339844,46.39175033569336,1470.8974609375,20.176267623901367,1141.4720458984375,12.018080711364744,383.59417724609375,9.503890991210938,235.40158081054688,8.91183853149414,130.84300231933594,0.5557027459144592,0.10607920587062836,0.34016501903533936,0.04959835857152939,0.3529828190803528,0.06984595209360123,0.3438380062580109,0.0641012117266655,0.3973088562488556,0.07438506931066513,0.4462471306324005,0.10438653826713562,73.828125,99.38401442307692,0.7811892374774567
946,42366,21,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2158.4845662366124,4245.588151798692,0.12164372880329458,0.16164393723011014,0.002531080041080713,16.572796452300988,9.312984495316758,-55.21538925170898,1245.1556396484375,114.40499114990234,420.4141845703125,-34.06509017944336,272.64828491210943,37.97905349731445,158.53651428222656,-22.33112335205078,185.39321899414062,20.76218032836914,296.1866149902344,15.732008934020994,362.255859375,7.573953628540039,157.11766052246094,5.539941310882568,68.10340118408203,2.919295310974121,16.018867492675778,0.3014639317989349,0.048488780856132514,0.4310301840305328,0.08967869728803635,0.35490334033966064,0.06082310527563095,0.42277178168296814,0.09027188271284103,0.4030251204967499,0.06725796312093735,0.5355218648910522,0.1001436933875084,95.703125,198.76802884615384,0.7084401438153336
947,7360,60,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1803.5066649901385,3366.758039607558,0.10392290455426356,0.06881147623062134,0.0007268624030984937,30.78343319801272,16.648578719682387,-166.3182373046875,3272.134765625,122.12904357910156,696.3850708007812,-32.09272003173828,223.7686462402344,16.679567337036133,59.58564758300781,-5.4000444412231445,43.3008918762207,3.6034255027771,9.543567657470703,2.9620673656463623,10.034867286682127,1.7552719116210938,4.360382556915283,1.1861649751663208,2.348410129547119,0.8610680103302002,1.054625153541565,0.4103052914142609,0.11473991721868515,0.2301839888095856,0.03843503072857857,0.2824036478996277,0.08442525565624237,0.21560898423194885,0.038801033049821854,0.3187234997749329,0.08949486911296843,0.33883136510849,0.11558790504932405,117.45383522727272,123.046875,0.7499941796278186
948,35512,72,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",2570.0684702152544,5353.972224745639,0.13166333575581396,0.2348034977912903,0.004828306380659342,21.813851888070502,25.852050563621408,9.867471694946287,2140.1318359375,88.78568267822266,806.0266723632812,-20.271196365356445,293.6134338378906,5.095838069915772,188.3652801513672,-2.910284280776977,119.41995239257812,39.765079498291016,1233.3643798828125,24.428340911865234,694.690673828125,20.5273551940918,331.41241455078125,10.70902156829834,87.65509033203125,5.74423360824585,21.911502838134766,0.5035601854324341,0.07398797571659088,0.4219026267528534,0.07021408528089522,0.4582680761814117,0.07708150148391724,0.4501936137676239,0.06844662129878998,0.4272819459438324,0.06203121319413185,0.466491311788559,0.07616908103227615,112.34714673913044,57.421875,0.6761932438664503
949,17756,86,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",1867.2152704293105,3803.506483920785,0.09434653585271316,0.1652505248785019,0.002905488712713123,23.310315255269565,24.8737065937722,-95.9538116455078,3557.732666015625,122.07901763916016,852.5076293945312,-29.30411148071289,815.5557861328125,50.32371139526367,207.7669982910156,-11.946255683898926,212.0702972412109,23.53158187866211,356.4422607421875,6.4342403411865225,59.24321746826172,6.253201484680176,81.80824279785156,4.8889498710632315,68.322998046875,3.5933101177215576,52.68197631835938,0.4678283631801605,0.1043444499373436,0.3482306003570557,0.06813604384660721,0.3944157660007477,0.09027867764234544,0.4292430281639099,0.10639026015996933,0.3991639018058777,0.0766986608505249,0.3331546187400818,0.07431706041097641,129.19921875,123.046875,0.7368429684343031
950,13248,88,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1622.86755751461,3527.055209847384,0.06603644319282946,0.15270258486270905,0.0027241960633546114,24.92490428613289,26.76151226825272,-121.905029296875,3054.0537109375,123.25271606445312,478.0637512207031,-8.48027515411377,517.768798828125,51.60987854003906,221.43621826171875,-0.0634973794221878,182.7110137939453,23.03063774108887,301.7087707519531,13.831600189208984,472.20294189453125,4.639244079589844,151.84413146972656,2.1265709400176998,18.995838165283203,1.4345655441284182,7.600841999053955,0.2728487253189087,0.04776996746659279,0.33247897028923035,0.08584298938512802,0.2608803808689117,0.05094926059246063,0.3833237886428833,0.08522536605596542,0.4624906182289124,0.11412107199430464,0.315134197473526,0.05127329379320145,107.666015625,52.734375,0.6922518604166219
951,25622,57,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",1376.0827686639834,2581.4638217659885,0.06155939619670544,0.07821870595216751,0.002285389229655266,20.627860188782968,15.487667598904158,-248.21502685546875,3234.658203125,126.0680694580078,396.5943908691406,-12.507761001586914,493.6255187988281,30.2762393951416,142.3840789794922,-1.0547696352005005,102.73377227783205,9.741999626159668,125.87533569335938,6.8449907302856445,205.78797912597656,1.5670934915542605,16.171958923339847,0.26483628153800964,0.1496596485376358,0.2177628129720688,0.24491511285305026,0.3513396084308624,0.13789793848991394,0.31017428636550903,0.11694669723510742,0.2554355263710022,0.08502025157213211,0.2412054091691971,0.10818695276975633,0.13498347997665405,0.04477817565202713,0.15656882524490354,0.0640975758433342,99.38401442307692,92.28515625,0.6826549924090947
952,14536,16,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2524.5365049258553,5346.143486555233,0.11452087875484496,0.205700159072876,0.0019369549117982388,20.740470457529216,20.027347426846443,-35.91160202026367,1880.61474609375,83.5926513671875,739.3388671875,-2.7266945838928223,313.7895812988281,32.36589813232422,162.90379333496094,9.19110107421875,75.9862060546875,29.583675384521484,368.7321166992188,11.064157485961914,108.80743408203124,5.8973450660705575,60.549232482910156,3.621094465255737,49.44071578979492,2.7900404930114746,15.550451278686525,0.4533050656318665,0.07738184928894043,0.5059336423873901,0.09167468547821044,0.4463075995445252,0.07825098186731339,0.4607753157615662,0.08130329102277756,0.5219705700874329,0.09132296591997148,0.3950503468513489,0.07324954867362976,234.90767045454547,61.5234375,0.7564550054313344
953,37582,17,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",1802.7163727814848,3775.029240098111,0.07797321644864341,0.1396522969007492,0.0035999193787574772,18.885574161660916,16.20642233692287,-155.06129455566406,4667.19091796875,110.05072784423828,1399.3145751953125,-18.424606323242188,609.0626220703125,36.57239151000977,344.85931396484375,0.5619094967842102,429.5450134277344,14.112796783447266,208.9703063964844,3.6157386302948,29.13494110107422,2.433358192443848,15.252219200134276,1.6184784173965454,6.9155235290527335,1.305609941482544,4.08490800857544,0.4117561876773834,0.08899062871932982,0.44363313913345337,0.08556567132472992,0.3660114705562592,0.072085902094841,0.3039092421531677,0.0470205619931221,0.4129238426685333,0.10741513222455977,0.35646292567253113,0.07055430114269258,63.024009146341456,123.046875,0.5890816926805582
954,32154,99,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2376.089587908887,4899.0374046148245,0.10802787366763568,0.1702350229024887,0.003785256762057543,24.55432822016144,27.363296543956604,-66.64421844482422,2118.406005859375,88.33397674560547,423.9482421875,-27.528179168701172,411.35626220703125,53.15675735473633,193.0318145751953,-9.216288566589355,165.04917907714844,20.09474372863769,453.0747985839844,3.9749360084533687,79.45979309082031,3.388422727584839,69.56691741943361,1.8586766719818115,11.997236251831055,1.1241589784622192,3.3695485591888428,0.5567068457603455,0.07797036319971085,0.5556488037109375,0.053569693118333817,0.6466332077980042,0.08839239925146103,0.5243421196937561,0.053646672517061234,0.5089718699455261,0.06477055698633194,0.5017806887626648,0.09581291675567627,151.9990808823529,143.5546875,0.5387039204126653
955,37168,8,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",1692.90752414302,3660.1604514898254,0.06951762354651163,0.1017349809408188,0.002284850925207138,27.711146355515698,30.32860530463493,-194.69776916503903,5911.16259765625,118.49063873291016,1136.642333984375,-6.393299579620361,594.0518188476562,40.7774543762207,506.1163330078125,-3.292876005172729,323.944091796875,10.373011589050293,112.26383209228516,3.11061954498291,21.874271392822266,1.6197091341018677,13.538763999938965,0.6578847765922546,3.1185905933380127,0.5012685060501099,1.0540039539337158,0.3579966425895691,0.09654369205236436,0.4100410044193268,0.0927245169878006,0.5433742403984071,0.1380264163017273,0.4267411530017853,0.10873878002166748,0.28573575615882874,0.055496737360954285,0.2931141555309296,0.07186012715101242,184.5703125,95.703125,0.6196921494772474
956,40848,88,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",3882.785530001032,8251.848939407704,0.18950838783914728,0.12000775337219237,0.0017382688820362089,24.874876352401863,26.76629972254281,-75.11689758300781,2526.344482421875,44.82406234741211,503.3330383300781,10.065093994140623,322.39312744140625,1.138014554977417,325.017333984375,1.1473184823989868,186.1934051513672,10.452617645263672,132.42219543457028,7.775259494781494,112.15695190429688,4.135890483856201,42.15262985229492,1.646614909172058,6.2624268531799325,0.958665370941162,1.7239549160003662,0.3716732263565064,0.09507698565721512,0.4412540495395661,0.11726059764623642,0.3355321884155273,0.07715247571468352,0.3808947801589966,0.09574676305055617,0.3485015034675598,0.07315968722105026,0.4362606406211853,0.1074674054980278,53.8330078125,215.33203125,0.7605479317600875
957,39790,65,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",2078.174702612835,4359.346895439679,0.08267888505329457,0.298156201839447,0.01460340805351734,18.959958704540806,23.31589575404887,-66.33589172363281,6969.939453125,97.96873474121094,1803.06884765625,-18.82431411743164,569.9556884765625,26.98919486999512,305.2890319824219,14.02822208404541,250.4816436767578,67.09415435791016,3933.453369140625,18.473878860473636,1404.3013916015625,10.606471061706543,301.5523376464844,6.606312274932861,92.07835388183594,4.262988090515137,65.4285888671875,0.4690155386924744,0.1282295435667038,0.3448421359062195,0.07204052060842514,0.24683724343776706,0.04401015117764473,0.28737419843673706,0.0581824965775013,0.3841676115989685,0.0868561714887619,0.5558476448059082,0.14457327127456665,44.55145474137931,86.1328125,0.6269798200737577
958,8280,80,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",972.7123541714143,1909.3274209665694,0.031513066254844964,0.005272406153380871,2.9846412871847857e-05,16.00101251236115,14.163529050484414,-549.7750244140625,7702.0048828125,157.000732421875,1523.2470703125,6.533668518066406,544.1436767578125,34.462310791015625,74.59114837646484,13.291333198547365,64.86936187744139,0.06536167860031128,0.019706636667251587,0.02230672910809517,0.0012364578433334827,0.002244550501927733,1.695771970844362e-05,0.0008528746548108758,3.1786235012987163e-06,0.0004940078943036497,1.098651864595013e-06,0.3674499392509461,0.07130888849496841,0.3349561989307404,0.07311055064201355,0.3955148160457611,0.07017480581998825,0.4819319248199463,0.08973509073257446,0.4937836825847626,0.11759713292121887,0.38587555289268494,0.1037689447402954,258.3984375,287.109375,0.9349468306886352
959,2070,45,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",1738.8143508229211,4550.633516533429,0.04802643531976744,0.14839525520801544,0.0007092110463418068,24.18709704110416,13.173078222851956,-163.179931640625,669.0369873046875,89.7996826171875,208.0749053955078,12.97461986541748,135.07308959960938,80.67724609375,43.40538024902344,3.658170223236084,32.92569732666016,28.73896789550781,218.3348846435547,0.6424894332885742,0.2506236433982849,0.0804833397269249,0.003223458305001259,0.058810945600271225,0.0013209887547418475,0.07565679401159286,0.0028131341096013784,0.4118378758430481,0.08723792433738707,0.3765901029109955,0.07417373359203339,0.3273025453090668,0.04755978658795357,0.3772006630897522,0.09327410161495207,0.3161452114582062,0.052974417805671685,0.28816285729408264,0.05072561278939247,66.25600961538461,129.19921875,0.7979682533704592
960,4416,96,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",1132.5281524625955,2065.5599904614824,0.04834627846414729,0.05124899744987488,0.0008499008836224675,23.054407628668546,20.573318271953227,-314.651611328125,5286.33056640625,139.95591735839844,681.149658203125,11.823827743530273,527.7921752929689,30.08004570007324,488.8467102050781,-7.555692195892334,265.05245971679693,4.21951961517334,21.12109375,1.1983988285064695,7.633729457855225,0.5321191549301147,1.87332284450531,0.2911313474178314,1.5971128940582275,0.03930436819791794,0.0272075179964304,0.18353724479675293,0.04591159150004387,0.2131287157535553,0.08972587436437607,0.17059294879436493,0.04143328964710236,0.3560698330402374,0.08855511248111725,0.5367147922515869,0.13308925926685333,0.2986975908279419,0.056537788361310966,215.33203125,123.046875,0.4881895481208499
961,16928,68,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2956.153838783475,6130.945278433866,0.16258402979651165,0.10690397769212724,0.0016908693360164762,23.023665839766803,24.433731003937773,-93.29137420654295,1932.2410888671875,77.84587860107422,451.8146362304688,-8.794252395629883,385.3652038574219,42.0654296875,167.83807373046875,-11.241074562072754,75.97607421875,11.83291721343994,200.68592834472656,2.3413448333740234,5.24178409576416,1.5543067455291748,5.609261512756348,0.8832159042358398,1.9241296052932741,0.6651228666305542,0.6917388439178467,0.3838835060596466,0.0464637354016304,0.6057862043380737,0.09339401125907898,0.3665712773799896,0.04087316617369652,0.35216647386550903,0.06848812848329544,0.39034146070480347,0.08483531326055528,0.4417034685611725,0.07987169176340103,71.77734375,107.666015625,0.7405430378270488
962,36524,94,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",2804.3647667520836,6097.735737645349,0.1284187257751938,0.19847293198108676,0.007007440086454153,19.375427754205294,29.856456568703173,-42.36041641235352,2738.3369140625,82.24099731445312,894.7994995117188,-2.291213274002075,386.895263671875,19.911691665649414,192.7237701416016,13.840513229370115,120.19477081298828,32.31293487548828,844.952880859375,14.785902976989744,326.1634826660156,16.663707733154293,707.89453125,7.299506187438965,183.0591583251953,3.923877239227295,33.111923217773445,0.4010224640369415,0.10665104538202286,0.2616733014583588,0.06476906687021255,0.28482139110565186,0.05335838720202446,0.3716066479682921,0.10441474616527556,0.22056733071804047,0.032887838780879974,0.3377894163131714,0.10631410777568816,75.99954044117645,151.9990808823529,0.7041479766540828
963,16422,57,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",1938.5319000788306,4165.297681231831,0.09248387536337208,0.0761871188879013,0.0005369005375541747,18.98270420217066,11.364255115005024,-143.18362426757812,2049.502685546875,122.55339050292969,231.9723052978516,-23.935888290405273,305.27020263671875,28.147520065307614,184.4089813232422,-23.69038200378418,150.38291931152344,4.447378635406494,13.625283241271973,3.30733585357666,8.67408561706543,2.238439083099365,5.345688819885254,1.2830350399017334,3.2137539386749268,0.4039520025253296,0.19513636827468872,0.4124966263771057,0.0989106297492981,0.2784544825553894,0.060625262558460236,0.33735790848731995,0.05036105215549469,0.581845760345459,0.11626160889863968,0.34668782353401184,0.04373444616794586,0.3512795865535736,0.10329218208789824,234.90767045454547,58.72691761363637,0.7080104394656022
964,24472,32,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",1522.0143177819311,3250.028047783431,0.0614269167877907,0.04052823781967163,0.0005702186026610434,22.014918751732555,28.85854804411991,-305.48779296875,3654.52685546875,121.9618911743164,738.1486206054688,2.571255683898926,187.2146148681641,36.89791488647461,84.8703384399414,-8.569708824157715,77.33915710449219,2.357050657272339,10.544534683227539,0.7619388103485107,1.2170976400375366,0.5774068832397461,0.7734114527702332,0.2466630786657333,0.21541133522987368,0.0480474941432476,0.01457333192229271,0.2462298721075058,0.09431759268045424,0.24325846135616305,0.0668884664773941,0.30660513043403625,0.118226520717144,0.22938357293605804,0.05830255523324013,0.2694234549999237,0.102078415453434,0.2633411586284637,0.08171913027763368,64.599609375,129.19921875,0.4717131375209567
965,17848,88,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2238.8919518452576,4385.069892351017,0.1314513687015504,0.11913078278303145,0.0029590539634227753,22.025299887172093,20.71359909671672,-97.86467742919922,1428.213623046875,100.99327087402344,380.69189453125,-40.54409790039063,144.16574096679688,51.05273056030274,124.45378112792969,-11.7138032913208,66.15760803222656,12.035980224609375,407.27581787109375,2.498873472213745,2.536229372024536,1.7143542766571045,2.7406110763549805,1.6918566226959229,3.4903156757354736,1.5922790765762331,4.570690155029297,0.497821182012558,0.10399401932954787,0.34216946363449097,0.049233946949243546,0.4763507843017578,0.11422566324472427,0.3107283115386963,0.05499210953712464,0.3587712645530701,0.07917317003011702,0.4029462337493897,0.08597273379564285,83.35433467741936,61.5234375,0.7178477141005029
966,23138,3,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",813.8635561364862,1417.9363871729654,0.04469968810562015,0.05955369397997856,0.001297745038755238,23.19271076470145,23.5311631543718,-297.00543212890625,9854.9052734375,193.0933380126953,875.745849609375,10.063127517700195,1124.592041015625,-1.608478307723999,254.96278381347656,3.443267107009888,145.65184020996094,4.672760009765625,25.44312858581543,3.902660846710205,39.66313552856445,0.8735582232475281,1.7066512107849119,0.3623727262020111,0.3687064051628113,0.1070108562707901,0.032253589481115334,0.2254590690135956,0.031712058931589134,0.3238094747066498,0.07391797751188277,0.4938147366046906,0.14792893826961515,0.2396330535411835,0.029012298211455345,0.27319037914276123,0.0727289468050003,0.3532849848270416,0.08584719896316527,234.90767045454547,198.76802884615384,0.5813208334362251
967,27784,4,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",3403.6207223129604,6903.645076308138,0.1923748637354651,0.06348211318254471,0.0001070643265848048,19.554315450407863,22.389142564370804,-107.10245513916016,1128.5682373046875,47.64348983764648,322.7771911621094,-8.61146068572998,182.6904296875,38.38475799560547,182.88796997070312,8.438407897949219,102.6877899169922,2.256373882293701,1.362115740776062,0.4344782829284668,0.14777489006519318,0.33810603618621826,0.1490616798400879,0.20388613641262052,0.05057195574045181,0.23193177580833435,0.03096148744225502,0.5879418849945068,0.04662574455142021,0.6254162788391113,0.047015175223350525,0.6553653478622437,0.05754175037145615,0.5918722152709961,0.05021076649427414,0.5844768285751343,0.03483754023909569,0.6586605906486511,0.04866834729909897,258.3984375,135.99917763157896,0.792040323174381
968,41722,7,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",1282.134162166998,2675.659066133721,0.04717743156492248,0.15710283815860748,0.003640384413301945,25.81354711732184,23.525827940702484,-140.38290405273438,2940.623046875,149.3271484375,557.8265380859375,-10.024887084960938,273.54345703125,38.70523071289063,135.45477294921878,1.5296844244003296,163.01980590820312,37.3706169128418,978.981689453125,6.9840087890625,61.9587516784668,1.8856300115585327,9.126073837280273,0.9843379259109496,2.3967411518096924,0.4346207976341248,0.2310914099216461,0.4094462692737579,0.0947532206773758,0.34289637207984924,0.06676068902015686,0.3681800663471222,0.10462690144777298,0.2904309630393982,0.044500619173049934,0.5180691480636597,0.10756892710924147,0.5211690664291382,0.12286938726902008,184.5703125,92.28515625,0.6178007607845982
969,43424,44,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",1652.5336774150285,3458.4076921329943,0.06892487281976745,0.14433477818965912,0.001232580398209393,26.88451357170861,18.891780201189565,-118.32909393310548,2395.068603515625,130.19998168945312,965.047607421875,-3.0286579132080083,468.6802673339844,15.745222091674805,243.70196533203125,3.928033828735352,118.69857025146484,20.12396812438965,364.2105712890625,8.448918342590332,88.400390625,7.732623100280763,48.82354736328125,2.7351055145263667,6.1801795959472665,1.186872124671936,1.865471124649048,0.5336101651191711,0.12058927863836287,0.24491335451602936,0.03560873121023178,0.2100260853767395,0.06420431286096573,0.19131533801555636,0.03252678364515305,0.35364365577697754,0.08188321441411972,0.34736016392707825,0.09585773199796677,46.98153409090909,95.703125,0.6157116443668629
970,22632,92,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",2332.175596941647,5841.03157930596,0.07271529796511628,0.12247297912836075,0.0015787006122991445,22.333147966033465,11.511538117984154,-144.93788146972656,1919.340087890625,84.02477264404297,280.25668334960943,10.851590156555176,446.329833984375,43.58724594116211,186.5053253173828,6.255435466766357,355.9554748535156,10.741445541381836,47.3580207824707,1.9600063562393188,6.198261737823486,0.7832300066947937,2.0752122402191158,0.5378136038780212,0.8486111164093018,0.3797189593315125,0.33636006712913513,0.4247373640537262,0.07133179157972336,0.4024435877799988,0.07348088920116425,0.3881071209907532,0.06711725890636444,0.4384941756725311,0.08079018443822861,0.4810801446437836,0.09650766849517822,0.4145600497722626,0.06951548159122467,75.99954044117645,112.34714673913044,0.6798128717036643
971,22540,90,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",2273.8368641680136,4967.55138308503,0.1045902222625969,0.10898103564977646,0.0017685986822471023,21.568823634289245,18.844432940286826,-109.52284240722656,947.2452392578124,97.3459701538086,248.2389068603516,-20.60468101501465,224.36802673339844,37.35104751586914,129.14836120605472,-3.131350040435791,122.92659759521484,7.646953582763673,59.39643478393555,2.98209547996521,12.891712188720705,1.4713301658630369,4.699260234832764,1.2176755666732788,2.9726157188415527,1.0918062925338743,3.199702024459839,0.5077036023139954,0.09349657595157623,0.436551034450531,0.07543041557073593,0.423631489276886,0.07863233983516693,0.4751095771789551,0.07361631840467453,0.5691710710525513,0.09427205473184586,0.5228512287139893,0.08911090344190598,117.45383522727272,151.9990808823529,0.7465377282899706
972,43516,46,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2426.852148692981,5030.214673419331,0.11798616157945735,0.12066169828176497,0.00137847987934947,26.9726270338899,25.11275428337769,-83.18434143066406,2535.196533203125,91.57740020751952,711.4134521484375,-13.710443496704102,437.1271362304688,16.166364669799805,84.87759399414062,10.351852416992188,81.7545166015625,11.305937767028807,198.768798828125,5.270247459411621,11.460269927978516,2.3265037536621094,7.809042453765869,3.209641456604004,13.658602714538574,2.937993049621582,10.308947563171387,0.26376599073410034,0.04213535785675049,0.3584284782409668,0.06967682391405106,0.3167393803596497,0.089799664914608,0.2596335113048553,0.03072549775242805,0.5882529020309448,0.128852978348732,0.2859162986278534,0.0511699952185154,215.33203125,103.359375,0.68620605085246
973,27094,89,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",1787.9733011871592,3904.8293854469484,0.06265405462693799,0.04502064362168312,0.0008142593433149159,21.47010242602422,23.579754498625217,-322.5901794433594,2503.966552734375,90.59627532958984,613.6546630859375,27.00746154785156,276.95217895507807,37.92257308959961,159.2119140625,19.71532249450684,62.74337387084961,2.2250783443450928,8.449256896972656,0.6545953154563904,0.4919038414955139,0.06652450561523438,0.015653155744075775,0.02007260359823704,0.0012644887901842596,0.10313337296247482,0.0713086947798729,0.3959408700466156,0.10548656433820723,0.3038220405578613,0.06505841761827469,0.4262191355228424,0.16206756234169006,0.2789994180202484,0.08470983058214188,0.25296005606651306,0.09718529880046843,0.15807710587978366,0.040381230413913734,258.3984375,287.109375,0.6853606579966405
974,22310,85,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",2607.726258943865,5535.744174691134,0.12718288214631782,0.1062660664319992,0.001950218458659947,21.28441010217504,18.87775749288721,-114.2340850830078,1592.3433837890625,80.88128662109375,367.0142517089844,-18.137903213500977,393.1202392578125,50.64165878295898,196.57858276367188,-14.937938690185547,197.42117309570312,7.789496898651122,79.8516616821289,3.656334400177002,28.77479362487793,1.3508081436157229,5.924915313720702,1.0499156713485718,3.370311737060547,0.690015435218811,1.0180175304412842,0.42878901958465576,0.07217395305633545,0.475813090801239,0.08424948900938034,0.4515540301799774,0.08063039183616638,0.4675330817699432,0.08218333125114441,0.4745564758777618,0.0802634209394455,0.4542551040649414,0.08176608383655548,112.34714673913044,215.33203125,0.7032792567191382
975,41262,97,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",2007.172587721449,4137.1209007085745,0.09403123485949612,0.11077599227428436,0.002606685273349285,15.762513121976585,11.565255940484919,-142.7301788330078,4068.683837890625,103.13282775878906,414.5031127929688,-15.232538223266602,535.5838012695311,38.27780532836914,313.04327392578125,-12.944328308105467,142.49334716796875,18.84835624694824,401.34088134765625,6.4039878845214835,53.12811279296875,3.149490594863892,33.691429138183594,1.7269690036773682,12.535965919494627,0.71672123670578,1.5308599472045898,0.4160760045051575,0.14564457535743713,0.24094119668006894,0.04754751920700073,0.22050762176513672,0.08329128473997116,0.20261916518211365,0.05254780501127243,0.2929617166519165,0.07680406421422957,0.3639143705368042,0.12777216732501984,172.265625,151.9990808823529,0.6634357993178494
976,45172,82,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2976.2085216988257,5927.197776617006,0.18351766896802327,0.09334133565425873,0.0010350134689360855,22.566484855322127,27.581033867904857,-95.4661865234375,2352.715087890625,78.30937194824219,298.1056823730469,-26.20032119750977,291.101318359375,44.23165130615234,115.41109466552734,-22.445362091064453,128.66838073730472,4.57190465927124,18.65612030029297,3.008051633834839,12.912487983703613,3.9788494110107417,37.69063568115234,1.3992233276367188,3.6385715007781982,1.0759931802749634,1.4752799272537231,0.4716247618198395,0.10642028599977492,0.3182825744152069,0.05036583170294762,0.33902040123939514,0.09256751835346222,0.28340211510658264,0.05452591553330421,0.4010960757732392,0.09235180914402008,0.3699260950088501,0.06927286833524704,48.75442216981133,99.38401442307692,0.6660937549741252
977,6394,39,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1633.2577266810058,3160.0309434047967,0.10891359314437984,0.012825021520256996,0.00021963792096357795,15.820946765628353,14.84665855418864,-409.58251953125,7032.06201171875,116.80388641357422,644.8819580078125,-16.125299453735348,357.0409851074219,11.712237358093262,126.84748077392578,0.751531183719635,270.4200439453125,0.5402832627296448,5.30557918548584,0.19381269812583926,0.304026335477829,0.07513783872127533,0.060999475419521325,0.034355174750089645,0.010387493297457695,0.029697537422180176,0.0030444988515228033,0.2961324453353882,0.11811298877000807,0.19664113223552704,0.05794501304626465,0.23550693690776825,0.07201574742794037,0.3269328773021698,0.11920033395290375,0.27877771854400635,0.09808389842510223,0.21629531681537628,0.06933404505252838,198.76802884615384,184.5703125,0.7931607311920702
978,27876,6,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",3238.004832733919,6231.099711573401,0.1980877543604651,0.05045206099748612,0.000102756341220811,20.282388930772267,26.718091597662767,-140.7401580810547,785.14501953125,55.920082092285156,432.4161682128906,-12.252534866333008,295.77069091796875,44.30029678344727,152.4076690673828,-10.616594314575195,153.26022338867188,1.3168635368347168,0.9564756155014038,0.7198323607444763,0.8055867552757263,0.5253361463546753,0.288337379693985,0.2319038361310959,0.06535501778125763,0.12625384330749512,0.011817090213298798,0.3466055989265442,0.06876461952924727,0.3542748987674713,0.07711099088191986,0.3399702906608581,0.05186587944626808,0.4638791978359222,0.09400510042905807,0.4317558705806732,0.06410682201385498,0.5914806127548218,0.09548730403184892,117.45383522727272,234.90767045454547,0.7626133206046684
979,8556,86,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1356.7836860259622,2497.601176417151,0.07687363735465116,0.03153574839234352,0.00035755813587456936,19.87952335459568,22.84000708258625,-283.30450439453125,5394.166015625,159.5782470703125,1290.632568359375,-29.524606704711914,164.7027587890625,18.562335968017575,101.0471649169922,-9.921102523803713,111.84113311767578,1.3029524087905884,6.133597373962402,0.9986076354980468,2.8264639377593994,0.3622724711894989,0.4954024851322174,0.1883028894662857,0.19456996023654935,0.10414989292621613,0.040505070239305496,0.191737100481987,0.04576496034860611,0.16664445400238034,0.03393697366118431,0.3488477468490601,0.08006703108549118,0.4629676640033722,0.12050788104534148,0.2337940335273743,0.026605499908328056,0.3996356427669525,0.12036828696727753,99.38401442307692,215.33203125,0.6740155405818881
980,42550,25,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2511.328351853317,4736.603606468023,0.15794952156007752,0.14915089309215546,0.0015451685758307574,20.07492543001985,14.923302407613864,-47.03206253051758,574.1513061523438,95.70198822021484,260.28289794921875,-43.90890884399414,252.77626037597656,52.065818786621094,270.12661743164057,-22.53727531433105,124.92446899414062,14.161900520324707,133.46620178222656,8.354628562927246,94.66622161865234,5.3401198387146,64.18951416015625,2.6788337230682373,11.517889976501465,2.737894058227539,7.738119125366211,0.3536811172962189,0.06953641772270203,0.2898961305618286,0.039177443832159035,0.31683212518692017,0.06171765550971031,0.38387778401374817,0.06816694885492325,0.4488059878349304,0.08383653312921524,0.3731845021247864,0.06978941708803177,99.38401442307692,107.666015625,0.780975151224675
981,1748,38,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",1512.3976909090827,3446.2222361010176,0.04436205486918605,0.1682857722043991,0.003916088491678238,34.81405263274809,24.623437472119413,-192.6542816162109,3225.89501953125,111.23936462402344,761.01171875,21.400054931640625,298.24627685546875,26.394649505615234,251.18539428710938,-0.6495190262794495,190.8009490966797,50.24590682983398,1630.10791015625,5.613790035247803,63.42901992797852,2.063983201980591,22.147369384765625,0.5270479321479797,2.1694157123565674,0.24499256908893585,0.2946560978889465,0.12112054973840715,0.0595104843378067,0.10089487582445143,0.037999488413333886,0.17631559073925018,0.04439547657966614,0.3543330132961273,0.1346430480480194,0.2648108303546905,0.07330342382192613,0.24518261849880216,0.06446647644042969,89.10290948275862,86.1328125,0.5704999445442089
982,37904,24,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",1812.1738223420825,3855.561750545058,0.07227016715116279,0.12371411919593812,0.002818719018250704,19.959166864902567,31.014288206008647,-169.1083984375,5888.5048828125,110.47080993652344,1216.5223388671875,-8.558326721191406,496.5824279785156,43.85440444946289,327.9468688964844,0.27436718344688416,247.93048095703125,16.254266738891598,349.6417236328125,4.747501850128174,34.30398941040039,1.2179476022720337,5.73907470703125,0.9062178134918212,4.421354293823242,0.8730047941207886,2.4363677501678467,0.4113495647907257,0.1195651963353157,0.3325275778770447,0.07861362397670746,0.3895567059516907,0.11211679130792618,0.3707073330879211,0.10480815172195436,0.3092949092388153,0.08012745529413222,0.3871937096118927,0.12965458631515506,143.5546875,69.83741554054055,0.6248185486637317
983,19734,29,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",3129.519428441031,6393.333200853925,0.115576171875,0.16632746160030365,0.003077995264902711,20.512804968411235,28.988182466060728,-72.61476135253906,2670.4189453125,57.09608840942383,1070.3541259765623,5.940471649169923,564.2863159179688,25.8936710357666,243.58526611328125,6.682819366455077,122.9502410888672,18.90167236328125,211.80528259277344,4.296711921691895,32.49423599243164,2.5943763256073,22.77265548706055,2.597705364227295,44.47453308105469,1.339133620262146,9.694475173950195,0.3640465140342712,0.07250763475894928,0.3824908435344696,0.09224776178598404,0.3609093427658081,0.07380618155002594,0.44794049859046936,0.08421218395233154,0.5141860246658325,0.11750289797782898,0.3789068758487701,0.06250817328691483,184.5703125,73.828125,0.6207061302574378
984,31418,83,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2339.899860607863,4714.043820403343,0.12277548146802325,0.2087622880935669,0.001065713353455067,26.62629989092432,23.49475288993739,-29.36374092102051,997.2040405273438,101.9475326538086,659.8759765625,-29.1523551940918,218.6392974853516,69.74643707275389,123.56703186035156,-16.204423904418945,61.38638687133789,44.72979736328125,537.3177490234375,10.799564361572266,62.36825180053711,4.108709812164307,20.43203353881836,1.265790939331055,1.064273476600647,1.3929985761642456,0.5791614055633545,0.3392154574394226,0.03612398356199265,0.3295567631721497,0.05888513475656509,0.4028786420822144,0.07464203983545302,0.4605526924133301,0.05217617377638817,0.6958984732627869,0.0784161314368248,0.5911985635757446,0.051529303193092346,58.72691761363637,123.046875,0.7184743769217808
985,31878,93,metal,6,"[0, 0, 0, 0, 0, 0, 1, 0, 0, 0]",2643.708384741568,5175.338447038517,0.14142404009205425,0.0921071469783783,0.0004207945021335036,17.7954872800438,16.028957457130648,-104.95455169677734,464.9228820800781,80.75245666503906,144.49928283691406,-28.56720542907715,97.94656372070312,66.81969451904297,68.21304321289061,-20.716991424560547,78.94578552246094,9.513797760009766,44.73893356323242,1.0526989698410034,3.2375495433807373,0.4840816557407379,0.1584727019071579,0.2988365590572357,0.06848900020122528,0.2299311608076096,0.04045529663562775,0.3695732057094574,0.06288309395313263,0.34619325399398804,0.05391018837690354,0.4186688959598541,0.07499288022518158,0.4498720765113831,0.061208367347717285,0.5512247085571289,0.12995998561382294,0.5103186368942261,0.060644056648015976,258.3984375,86.1328125,0.7747068439653534
986,42596,26,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2264.1980162771265,4604.950604106105,0.12297836421996125,0.15272065997123718,0.001176300342194736,19.334243478953262,9.35762190534344,-58.91859817504883,953.707763671875,106.52230834960938,382.21478271484375,-31.765825271606445,183.1717834472656,47.92063522338867,124.96717834472656,-17.412044525146484,123.71649932861328,18.817014694213867,134.83729553222656,7.562986850738525,60.33018493652344,4.930094242095947,38.979190826416016,3.74462890625,31.139686584472656,2.0876240730285645,8.303319931030272,0.4508945345878601,0.1184827908873558,0.3372890055179596,0.0395292192697525,0.5074365139007568,0.12977823615074158,0.2641269564628601,0.03243216127157211,0.3095378577709198,0.049411453306674964,0.4999524056911469,0.1298881769180298,117.45383522727272,56.17357336956522,0.6923996268659167
987,920,20,blues,0,"[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]",1389.3459159408221,3004.7331486191856,0.052451626090116284,0.07523981481790543,0.0024845818988978863,16.32444938889326,20.58906076633746,-230.5157470703125,2981.18212890625,127.13214874267578,397.8119812011719,7.203533172607423,600.0388793945312,39.809837341308594,175.02391052246094,2.0086140632629395,114.2379379272461,8.971630096435547,371.6929931640625,3.9024164676666264,78.90092468261719,1.393840789794922,23.41873550415039,0.7402742505073547,10.646291732788086,1.0283375978469849,22.287092208862305,0.25047096610069275,0.060501381754875176,0.17257922887802124,0.052131149917840965,0.21617451310157776,0.07710391283035277,0.2928265333175659,0.06600340455770493,0.4974049031734466,0.15676425397396088,0.2498631924390793,0.05239394307136536,287.109375,258.3984375,0.5905303230433114
988,8372,82,classical,1,"[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]",1414.6639526525116,2488.9545103561045,0.08727629905523256,0.04294489324092865,0.00021768087754026053,19.718618832582138,22.63863098757892,-264.17498779296875,2912.6162109375,142.1708526611328,1098.1009521484377,-51.341957092285156,347.7195739746094,5.044239044189453,119.15036010742188,-20.26741981506348,128.10957336425778,1.6132899522781372,1.7674161195755005,1.4570857286453247,1.3486926555633545,0.8465442657470703,1.336400032043457,0.3819494545459747,0.21489818394184115,0.2557592988014221,0.10573770850896837,0.22458623349666595,0.07193797826766968,0.1701948046684265,0.035934310406446464,0.270959347486496,0.0843091532588005,0.22445905208587646,0.05463757738471031,0.2902759611606598,0.08238882571458818,0.3173413574695587,0.09244054555892944,107.666015625,117.45383522727272,0.8164646492680133
989,12742,77,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1513.0274506778342,2922.439589389535,0.0878425539001938,0.13139708340168,0.001642600866034627,25.586141217042943,24.15002591627909,-118.28005981445312,1632.4261474609375,152.9661865234375,464.2674560546875,-46.5145263671875,248.06613159179688,31.136512756347656,133.33833312988278,-17.270072937011722,154.18641662597656,9.885448455810547,37.320556640625,11.02242660522461,114.5054168701172,10.474355697631836,131.23989868164062,4.603999614715576,23.429502487182614,1.8833465576171875,9.381071090698242,0.594255805015564,0.11223761737346648,0.2433518469333649,0.03631899505853653,0.2483975738286972,0.07895001769065857,0.208807036280632,0.03994686901569368,0.3533685505390167,0.059295576065778725,0.5148257613182068,0.11390464007854463,172.265625,92.28515625,0.7180033539041671
990,39744,64,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",3092.047510354526,6967.643759084303,0.10086792938468993,0.26799488067626953,0.0073178792372345924,28.01028774621116,28.786944832363186,-70.18149566650389,3143.44384765625,54.403053283691406,819.06201171875,15.581750869750975,750.3680419921875,19.837968826293945,273.38827514648443,26.98502349853516,203.0531311035156,53.30564498901367,954.283447265625,9.781288146972656,286.33880615234375,2.864891529083252,41.928035736083984,2.112232446670532,11.598817825317385,2.2612884044647217,8.79665756225586,0.4451463222503662,0.08777812868356705,0.4705819189548493,0.08665229380130768,0.3889967203140259,0.07295987010002136,0.4188258945941925,0.08738486468791963,0.4961836040019989,0.12535658478736875,0.422017902135849,0.12251392751932146,86.1328125,43.06640625,0.6295981403884507
991,19918,33,hiphop,4,"[0, 0, 0, 0, 1, 0, 0, 0, 0, 0]",2980.8207932066884,6159.130405159884,0.1521030159883721,0.21450631320476526,0.0030919052660465236,19.37754026332172,31.496335418443678,-31.931249618530273,2391.529052734375,59.97263717651367,1158.3447265625,-2.6740736961364746,603.080810546875,33.49276733398437,523.7821044921875,13.033105850219727,269.04156494140625,34.116592407226555,520.5388793945311,6.8819541931152335,62.1423454284668,3.4820947647094727,16.999433517456055,2.3244702816009517,12.49405002593994,2.9134645462036133,13.464627265930176,0.470894604921341,0.07746921479701996,0.5022589564323425,0.056876011192798615,0.5410325527191162,0.07139072567224503,0.5896297693252563,0.09930886328220367,0.5384659767150879,0.07827404886484146,0.5838853716850281,0.08632146567106247,95.703125,184.5703125,0.6823732794494034
992,45402,87,rock,9,"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1]",2335.00184239926,4821.000408793605,0.12852130268895348,0.16571880877017975,0.0010262237628921866,17.63299119622235,12.579977900619356,-42.64761734008789,770.7808837890625,102.96341705322266,165.9663848876953,-36.84616470336914,166.9609832763672,44.55023193359375,80.66880798339844,-11.965093612670898,93.1470184326172,20.327516555786133,186.50572204589844,8.385433197021483,46.77243041992188,6.611736297607423,52.20341491699219,4.585679531097412,42.85912322998047,3.194540739059448,6.013295650482178,0.3298227787017822,0.05215412005782128,0.35094940662384033,0.04827745258808136,0.5670100450515747,0.08286122977733612,0.3922626078128815,0.04620054364204407,0.4997852742671967,0.11314668506383894,0.2830912470817566,0.036313463002443314,135.99917763157896,129.19921875,0.778541459187173
993,41354,99,reggae,8,"[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]",2464.089399860297,4720.612281976743,0.1393051265746124,0.1801611036062241,0.0014860983937978745,27.488130758963127,26.66162751585061,-67.22486877441406,2817.108642578125,80.84088134765625,954.75048828125,-43.86160278320313,308.8691711425781,57.7374038696289,68.99593353271484,-12.8017578125,67.27556610107422,17.708995819091797,202.17955017089844,2.350933074951172,4.255814075469972,1.6723986864089966,2.5189366340637207,2.6176505088806152,3.967313528060913,6.067634582519531,39.7331428527832,0.387166827917099,0.07684330642223358,0.4305040538311005,0.04821324720978737,0.3960883915424347,0.06494176387786865,0.4814215004444122,0.08916788548231125,0.592174232006073,0.06731495261192323,0.5611976385116577,0.084441639482975,234.90767045454547,58.72691761363637,0.6574135810932803
994,16054,49,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2396.9590469670898,4920.378645076308,0.13524179384689922,0.2096385657787323,0.007227667607367039,21.487561106923746,28.247228611574375,-45.11177062988281,3622.4248046875,98.66394805908205,916.770263671875,-24.631750106811523,500.9403991699219,40.5150260925293,173.35348510742188,-18.095163345336914,151.77024841308594,47.52180099487305,3210.492919921875,10.665477752685547,121.7594985961914,8.034578323364258,93.40198516845705,5.399845600128174,55.2056999206543,3.83043384552002,23.92899513244629,0.437544047832489,0.06475897133350372,0.3668571710586548,0.0821184366941452,0.3421180546283722,0.056968629360198975,0.4461579918861389,0.0936102345585823,0.3503561913967133,0.08167720586061478,0.3557461500167847,0.0512436218559742,123.046875,234.90767045454547,0.6214014260736851
995,33074,19,pop,7,"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0]",3131.484497859523,6552.937636264535,0.156066042877907,0.2109151631593704,0.005837869830429554,20.290508583013587,35.44797001073114,-25.175575256347656,3884.39990234375,70.81665802001953,827.7432250976562,2.9709300994873047,464.24102783203125,7.569775104522705,298.29254150390625,1.458132266998291,199.1171722412109,41.06001281738281,1694.69384765625,15.232338905334473,190.9795379638672,10.948469161987305,162.94017028808594,7.208144664764403,78.30590057373047,3.5635945796966557,18.01097297668457,0.4877423048019409,0.12796396017074585,0.3874557614326477,0.07076069712638855,0.4963667094707489,0.09032317996025084,0.4991621673107147,0.09525786340236664,0.31809696555137634,0.061862967908382416,0.2857356667518616,0.06943061947822571,61.5234375,92.28515625,0.7431943218717292
996,11914,59,country,2,"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0]",1535.2036751756405,3508.376408066861,0.05250878149224806,0.145500510931015,0.002383771352469921,26.573950223547133,24.002397808096195,-185.15110778808597,7334.3544921875,120.51028442382812,1327.6246337890625,29.738975524902344,440.80499267578125,56.39657211303711,432.3341064453125,-3.0459864139556885,351.8257141113281,28.13326072692871,459.63604736328125,9.51590061187744,135.391845703125,3.5300750732421875,75.57317352294922,0.5468644499778748,1.3505241870880127,0.3822052180767059,0.6483800411224365,0.18826565146446228,0.07989737391471863,0.13481150567531586,0.035437095910310745,0.21525195240974426,0.04397259280085564,0.3955621719360352,0.12652398645877838,0.2580871284008026,0.04688839614391327,0.3188280761241913,0.12661486864089966,143.5546875,67.99958881578948,0.5044967048679893
997,16330,55,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",2107.9629549743076,4399.208359829215,0.11032203851744186,0.1215253248810768,0.0018636707682162523,17.39929988959753,12.621542469768515,-103.115478515625,2776.7314453125,107.5161361694336,449.90338134765625,-33.54215621948242,447.87835693359375,52.83587265014648,137.72676086425778,-9.150089263916016,98.47291564941406,10.881689071655273,124.77696228027344,2.272381544113159,5.339163780212402,1.9452000856399536,8.494630813598633,2.132672071456909,11.115416526794434,1.635367512702942,5.95103931427002,0.6197208166122437,0.11389651894569396,0.4463591873645783,0.053363095968961716,0.4568594098091126,0.06943228095769882,0.3882774710655213,0.06672471761703491,0.42602500319480896,0.06755044311285019,0.4381805658340454,0.07948364317417145,86.1328125,258.3984375,0.7783221811209085
998,23184,4,jazz,5,"[0, 0, 0, 0, 0, 1, 0, 0, 0, 0]",1040.1199252276074,1839.6199355014533,0.04775769137596899,0.10882686823606492,0.0021809048485010862,24.12663289112636,23.88163527822021,-270.21762084960943,2934.055419921875,137.52302551269528,545.416015625,5.632006168365479,342.54022216796875,42.51373672485352,221.5662841796875,-7.929525375366211,175.23446655273438,14.357900619506836,221.99224853515625,8.16191577911377,127.25515747070312,6.02827262878418,91.34847259521484,0.4946469366550446,0.7187138199806213,0.35687100887298584,0.627308189868927,0.08937001973390579,0.018954722210764885,0.07775937020778656,0.016975715756416317,0.18311212956905365,0.07394009083509445,0.2709288895130157,0.15306715667247772,0.13164764642715454,0.04183867573738098,0.1006229817867279,0.022607538849115368,64.599609375,63.024009146341456,0.5830825332793689
999,15962,47,disco,3,"[0, 0, 0, 1, 0, 0, 0, 0, 0, 0]",1710.728287632483,3238.9192519077037,0.08689210876937985,0.046973031014204025,0.0010769820073619485,20.719464343865425,35.73012663498969,-280.95455932617193,3970.7666015625,120.7935791015625,581.9614868164062,-37.56720352172852,709.4627685546875,28.76165199279785,268.69747924804693,-10.776864051818848,164.18942260742188,1.5284059047698977,4.66372013092041,1.3874952793121338,4.0537123680114755,2.466954708099365,50.84721374511719,0.44860878586769104,1.0496195554733276,0.729157567024231,3.932594537734986,0.2354009598493576,0.1052580252289772,0.1533432900905609,0.05183390527963638,0.1842724233865738,0.08643285185098648,0.15712690353393555,0.05320797860622406,0.2367454320192337,0.10702574998140336,0.22845108807086945,0.10480426996946336,234.90767045454547,215.33203125,0.7740540675912451
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas;\n",
"import numpy as np;\n",
"import ast;\n",
"import sklearn.tree as tree;\n",
"from sklearn.metrics import roc_auc_score\n",
"from sklearn.multiclass import OneVsRestClassifier\n",
"from sklearn.svm import LinearSVC\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.naive_bayes import GaussianNB, MultinomialNB, BernoulliNB\n",
"from sklearn.tree import DecisionTreeClassifier\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, AdaBoostClassifier\n",
"from sklearn.neural_network import MLPClassifier\n",
"from sklearn import datasets"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def readCSVFile(file):\n",
" data=pandas.read_csv(file,\",\",header=0, na_values='?', skipinitialspace=True);\n",
" return data;\n",
" pass;\n",
"def readTrainData(dataset): \n",
" return dataset.iloc[:,6:], dataset.iloc[:,4:5].astype(int),dataset.iloc[:,5:6];\n",
" pass;\n",
"\n",
"def readTestData(dataset): \n",
" return dataset.iloc[:,6:], dataset.iloc[:,4:5].astype(int),dataset.iloc[:,5:6];\n",
" pass;\n",
"\n",
"def normalizePhi(unNormalizedPhi,last_col_bias=False): \n",
" #assuming last column as bias column\n",
" no_of_column=len(unNormalizedPhi[0]);\n",
" phi=np.array(unNormalizedPhi);\n",
" std=phi.std(0);\n",
" mean=phi.mean(0); \n",
" #std[no_of_column-1]=1;\n",
" #mean[no_of_column-1]=0;\n",
" #phi_normalize=(phi-mean)/std; \n",
" \n",
" max_vector=phi.max(axis=0)\n",
" phi_normalize=phi/max_vector; \n",
" \n",
" return phi_normalize;\n",
" pass;\n",
"\n",
"def categoryToNumber(dataset,categoryList):\n",
" for c in categoryList:\n",
" if (c in dataset): \n",
" dataset[c]=pandas.get_dummies(dataset[c]).values.argmax(1); \n",
" return dataset;\n",
" pass;\n",
" \n",
"\n",
"def handleCategoryData(dataset,categoryList): \n",
" return categoryToNumber(dataset,categoryList)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2,\n",
" 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"iris = datasets.load_iris()\n",
"X, y = iris.data, iris.target\n",
"OneVsRestClassifier(LinearSVC(random_state=0,max_iter=4000)).fit(X, y).predict(X)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:9: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
" if __name__ == '__main__':\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:10: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
" # Remove the CWD from sys.path while we load stuff.\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:11: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
" # This is added back by InteractiveShellApp.init_path()\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:17: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:18: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:19: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n"
]
}
],
"source": [
"dir=\"./\"\n",
"trainFile=dir+\"train.csv\";\n",
"testFile=dir+\"test.csv\";\n",
"trained_dataset=readCSVFile(trainFile);\n",
"test_dataset=readCSVFile(testFile);\n",
"trained_data,trained_y,trained_y_vector=readTrainData(trained_dataset);\n",
"test_data,test_y,test_y_vector=readTestData(test_dataset);\n",
"\n",
"mtx_train =trained_data.as_matrix(columns=None)\n",
"mtx_train_y =trained_y.as_matrix(columns=None)\n",
"mtx_trained_y_vector=trained_y_vector.as_matrix(columns=None);\n",
"\n",
"mtx_train_norm=normalizePhi(mtx_train);\n",
"mtx_train_y=np.array(list((e[0] for e in mtx_train_y)));\n",
"mtx_trained_y_vector=np.array(list((ast.literal_eval(e[0]) for e in mtx_trained_y_vector)));\n",
"\n",
"mtx_test=test_data.as_matrix(columns=None);\n",
"mtx_test_y=test_y.as_matrix(columns=None);\n",
"mtx_test_y_vector=test_y_vector.as_matrix(columns=None);\n",
"\n",
"mtx_test_norm=normalizePhi(mtx_test);\n",
"mtx_test_y=np.array(list((e[0] for e in mtx_test_y)));\n",
"mtx_test_y_vector=np.array(list((ast.literal_eval(e[0]) for e in mtx_test_y_vector)));"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# #trainedModel=OneVsRestClassifier(LinearSVC()).fit(mtx_train, mtx_train_y);\n",
"# trainedModel=LinearSVC(max_iter=12000).fit(mtx_train, mtx_train_y);\n",
"# y_predict=trainedModel.predict(mtx_train);\n",
"# print(y_predict);\n",
"# print(\"done\");"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[9 8 5 8 7 8 6 9 5 0 7 1 7 9 9 5 9 9 9 6 5 6 1 7 1 7 1 1 6 9 9 0 6 9 9 8 9\n",
" 9 9 9 9 5 8 7 6 0 9 1 7 9 0 5 9 9 9 9 7 1 1 5 0 9 7 9 5 6 9 6 9 9 0 9 9 5\n",
" 9 9 9 1 6 1 6 0 9 7 6 6 6 0 1 9 7 7 6 9 1 7 9 9 0 1]\n"
]
}
],
"source": [
"y_predict=trainedModel.predict(mtx_test);\n",
"print(y_predict);"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(901, 42)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
" FutureWarning)\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:469: FutureWarning: Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
" \"this warning.\", FutureWarning)\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/svm/base.py:929: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
" \"the number of iterations.\", ConvergenceWarning)\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n",
"/home/yadnyesh/.local/lib/python3.6/site-packages/sklearn/ensemble/forest.py:245: FutureWarning: The default value of n_estimators will change from 10 in version 0.20 to 100 in 0.22.\n",
" \"10 in version 0.20 to 100 in 0.22.\", FutureWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Done\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/yadnyesh/.local/lib/python3.6/site-packages/ipykernel_launcher.py:35: FutureWarning: \n",
".ix is deprecated. Please use\n",
".loc for label based indexing or\n",
".iloc for positional indexing\n",
"\n",
"See the documentation here:\n",
"http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Trained Misclassified Points</th>\n",
" <th>Trained Accuracy</th>\n",
" <th>Test Misclassified Points</th>\n",
" <th>Test Accuracy</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>Decision Tree</td>\n",
" <td>191</td>\n",
" <td>78.8013</td>\n",
" <td>58</td>\n",
" <td>42</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Random Forest</td>\n",
" <td>50</td>\n",
" <td>94.4506</td>\n",
" <td>38</td>\n",
" <td>62</td>\n",
" </tr>\n",
" <tr>\n",
" <td>K-Neighbors</td>\n",
" <td>323</td>\n",
" <td>64.1509</td>\n",
" <td>61</td>\n",
" <td>39</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Logistic Regression</td>\n",
" <td>279</td>\n",
" <td>69.0344</td>\n",
" <td>35</td>\n",
" <td>65</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Support Vector</td>\n",
" <td>433</td>\n",
" <td>51.9423</td>\n",
" <td>49</td>\n",
" <td>51</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Bernoulli NB</td>\n",
" <td>711</td>\n",
" <td>21.0877</td>\n",
" <td>81</td>\n",
" <td>19</td>\n",
" </tr>\n",
" <tr>\n",
" <td>Gaussian NB</td>\n",
" <td>413</td>\n",
" <td>54.162</td>\n",
" <td>48</td>\n",
" <td>52</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Trained Misclassified Points Trained Accuracy \\\n",
"Decision Tree 191 78.8013 \n",
"Random Forest 50 94.4506 \n",
"K-Neighbors 323 64.1509 \n",
"Logistic Regression 279 69.0344 \n",
"Support Vector 433 51.9423 \n",
"Bernoulli NB 711 21.0877 \n",
"Gaussian NB 413 54.162 \n",
"\n",
" Test Misclassified Points Test Accuracy \n",
"Decision Tree 58 42 \n",
"Random Forest 38 62 \n",
"K-Neighbors 61 39 \n",
"Logistic Regression 35 65 \n",
"Support Vector 49 51 \n",
"Bernoulli NB 81 19 \n",
"Gaussian NB 48 52 "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = trained_data\n",
"print(x.shape)\n",
"y = np.ravel(trained_y)\n",
"y_test=np.ravel(test_y);\n",
"\n",
"index = [\"Decision Tree\", \"Random Forest\", \"K-Neighbors\",\n",
" \"Logistic Regression\", \"Support Vector\", \"Bernoulli NB\", \"Gaussian NB\"]\n",
"columns = [\"Trained Misclassified Points\", \"Trained Accuracy\", \"Test Misclassified Points\", \"Test Accuracy\",]\n",
"modelComparision = pandas.DataFrame(index=index, columns=columns)\n",
"\n",
"dtc = 0, DecisionTreeClassifier(min_samples_split=20)\n",
"rfc = 1, RandomForestClassifier(min_samples_split=10)\n",
"knn = 2, KNeighborsClassifier()\n",
"lgr = 3, LogisticRegression(max_iter=20000)\n",
"svc = 4, LinearSVC(max_iter=15000)\n",
"bnb = 5, BernoulliNB()\n",
"gnb = 6, GaussianNB()\n",
"\n",
"tr_size=len(x.index);\n",
"tt_size=len(y_test);\n",
"for i in lgr, gnb, bnb, dtc, svc, knn, rfc: \n",
" model=i[1].fit(x, y);\n",
" y_pred = model.predict(x)\n",
" tr_misclassifedPoints = (y_pred != y).sum() \n",
" tr_accuracy = ((tr_size - tr_misclassifedPoints)*100) / tr_size;\n",
" \n",
" y_pred = model.predict(test_data)\n",
" tt_misclassifedPoints = (y_pred != y_test).sum() \n",
" tt_accuracy = ((tt_size - tt_misclassifedPoints)*100) / tt_size;\n",
" if(i[0]==0):\n",
" tree.export_graphviz(model,out_file='tree.dot'); \n",
" #print(misclassifedPoints,\":\",size - misclassifedPoints,':',accuracy); \n",
" modelComparision.ix[i[0]] = [tr_misclassifedPoints, tr_accuracy, tt_misclassifedPoints, tt_accuracy,];\n",
" \n",
"print(\"Done\");\n",
"modelComparision"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
digraph Tree {
node [shape=box] ;
0 [label="X[3] <= 0.048\ngini = 0.9\nsamples = 901\nvalue = [93, 91, 91, 89, 91, 90, 90, 92, 89, 85]"] ;
1 [label="X[9] <= 122.686\ngini = 0.447\nsamples = 99\nvalue = [0, 71, 2, 0, 1, 19, 1, 1, 2, 2]"] ;
0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
2 [label="X[17] <= 1.02\ngini = 0.682\nsamples = 30\nvalue = [0, 7, 1, 0, 1, 15, 1, 1, 2, 2]"] ;
1 -> 2 ;
3 [label="gini = 0.48\nsamples = 10\nvalue = [0, 7, 1, 0, 0, 1, 0, 0, 1, 0]"] ;
2 -> 3 ;
4 [label="X[14] <= 275.982\ngini = 0.49\nsamples = 20\nvalue = [0, 0, 0, 0, 1, 14, 1, 1, 1, 2]"] ;
2 -> 4 ;
5 [label="gini = 0.227\nsamples = 16\nvalue = [0, 0, 0, 0, 0, 14, 0, 1, 0, 1]"] ;
4 -> 5 ;
6 [label="gini = 0.75\nsamples = 4\nvalue = [0, 0, 0, 0, 1, 0, 1, 0, 1, 1]"] ;
4 -> 6 ;
7 [label="X[39] <= 71.833\ngini = 0.136\nsamples = 69\nvalue = [0, 64, 1, 0, 0, 4, 0, 0, 0, 0]"] ;
1 -> 7 ;
8 [label="gini = 0.625\nsamples = 4\nvalue = [0, 1, 1, 0, 0, 2, 0, 0, 0, 0]"] ;
7 -> 8 ;
9 [label="X[4] <= 0.002\ngini = 0.06\nsamples = 65\nvalue = [0, 63, 0, 0, 0, 2, 0, 0, 0, 0]"] ;
7 -> 9 ;
10 [label="X[20] <= 37.19\ngini = 0.031\nsamples = 64\nvalue = [0, 63, 0, 0, 0, 1, 0, 0, 0, 0]"] ;
9 -> 10 ;
11 [label="gini = 0.0\nsamples = 62\nvalue = [0, 62, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
10 -> 11 ;
12 [label="gini = 0.5\nsamples = 2\nvalue = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0]"] ;
10 -> 12 ;
13 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0]"] ;
9 -> 13 ;
14 [label="X[4] <= 0.006\ngini = 0.893\nsamples = 802\nvalue = [93, 20, 89, 89, 90, 71, 89, 91, 87, 83]"] ;
0 -> 14 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
15 [label="X[8] <= 915.213\ngini = 0.887\nsamples = 674\nvalue = [86, 20, 89, 84, 44, 70, 87, 33, 78, 83]"] ;
14 -> 15 ;
16 [label="X[13] <= 39.691\ngini = 0.516\nsamples = 68\nvalue = [4, 2, 8, 0, 0, 2, 46, 0, 0, 6]"] ;
15 -> 16 ;
17 [label="gini = 0.597\nsamples = 12\nvalue = [0, 2, 7, 0, 0, 1, 0, 0, 0, 2]"] ;
16 -> 17 ;
18 [label="X[35] <= 0.385\ngini = 0.314\nsamples = 56\nvalue = [4, 0, 1, 0, 0, 1, 46, 0, 0, 4]"] ;
16 -> 18 ;
19 [label="gini = 0.656\nsamples = 8\nvalue = [4, 0, 0, 0, 0, 1, 1, 0, 0, 2]"] ;
18 -> 19 ;
20 [label="X[30] <= 0.041\ngini = 0.119\nsamples = 48\nvalue = [0, 0, 1, 0, 0, 0, 45, 0, 0, 2]"] ;
18 -> 20 ;
21 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 1, 0, 0, 0, 0, 0, 0, 0]"] ;
20 -> 21 ;
22 [label="X[12] <= 289.309\ngini = 0.081\nsamples = 47\nvalue = [0, 0, 0, 0, 0, 0, 45, 0, 0, 2]"] ;
20 -> 22 ;
23 [label="X[38] <= 0.093\ngini = 0.043\nsamples = 46\nvalue = [0, 0, 0, 0, 0, 0, 45, 0, 0, 1]"] ;
22 -> 23 ;
24 [label="gini = 0.0\nsamples = 44\nvalue = [0, 0, 0, 0, 0, 0, 44, 0, 0, 0]"] ;
23 -> 24 ;
25 [label="gini = 0.5\nsamples = 2\nvalue = [0, 0, 0, 0, 0, 0, 1, 0, 0, 1]"] ;
23 -> 25 ;
26 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"] ;
22 -> 26 ;
27 [label="X[1] <= 4353.914\ngini = 0.886\nsamples = 606\nvalue = [82, 18, 81, 84, 44, 68, 41, 33, 78, 77]"] ;
15 -> 27 ;
28 [label="X[16] <= 121.452\ngini = 0.842\nsamples = 279\nvalue = [58, 16, 59, 4, 10, 51, 8, 5, 40, 28]"] ;
27 -> 28 ;
29 [label="X[41] <= 0.651\ngini = 0.701\nsamples = 73\nvalue = [4, 12, 2, 2, 0, 36, 7, 0, 1, 9]"] ;
28 -> 29 ;
30 [label="X[13] <= 52.622\ngini = 0.368\nsamples = 42\nvalue = [2, 2, 1, 0, 0, 33, 4, 0, 0, 0]"] ;
29 -> 30 ;
31 [label="X[30] <= 0.027\ngini = 0.199\nsamples = 37\nvalue = [2, 2, 0, 0, 0, 33, 0, 0, 0, 0]"] ;
30 -> 31 ;
32 [label="gini = 0.0\nsamples = 2\nvalue = [0, 2, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
31 -> 32 ;
33 [label="X[29] <= 0.179\ngini = 0.108\nsamples = 35\nvalue = [2, 0, 0, 0, 0, 33, 0, 0, 0, 0]"] ;
31 -> 33 ;
34 [label="gini = 0.444\nsamples = 3\nvalue = [2, 0, 0, 0, 0, 1, 0, 0, 0, 0]"] ;
33 -> 34 ;
35 [label="gini = 0.0\nsamples = 32\nvalue = [0, 0, 0, 0, 0, 32, 0, 0, 0, 0]"] ;
33 -> 35 ;
36 [label="gini = 0.32\nsamples = 5\nvalue = [0, 0, 1, 0, 0, 0, 4, 0, 0, 0]"] ;
30 -> 36 ;
37 [label="X[1] <= 3252.549\ngini = 0.783\nsamples = 31\nvalue = [2, 10, 1, 2, 0, 3, 3, 0, 1, 9]"] ;
29 -> 37 ;
38 [label="gini = 0.0\nsamples = 10\nvalue = [0, 10, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
37 -> 38 ;
39 [label="X[29] <= 0.375\ngini = 0.753\nsamples = 21\nvalue = [2, 0, 1, 2, 0, 3, 3, 0, 1, 9]"] ;
37 -> 39 ;
40 [label="gini = 0.79\nsamples = 9\nvalue = [2, 0, 1, 1, 0, 3, 1, 0, 1, 0]"] ;
39 -> 40 ;
41 [label="gini = 0.403\nsamples = 12\nvalue = [0, 0, 0, 1, 0, 0, 2, 0, 0, 9]"] ;
39 -> 41 ;
42 [label="X[6] <= 32.971\ngini = 0.802\nsamples = 206\nvalue = [54, 4, 57, 2, 10, 15, 1, 5, 39, 19]"] ;
28 -> 42 ;
43 [label="X[5] <= 20.44\ngini = 0.791\nsamples = 180\nvalue = [51, 4, 56, 2, 9, 14, 1, 5, 19, 19]"] ;
42 -> 43 ;
44 [label="X[26] <= 6.131\ngini = 0.8\nsamples = 65\nvalue = [22, 4, 2, 0, 4, 10, 1, 2, 13, 7]"] ;
43 -> 44 ;
45 [label="X[29] <= 0.28\ngini = 0.821\nsamples = 45\nvalue = [4, 2, 2, 0, 4, 10, 1, 2, 13, 7]"] ;
44 -> 45 ;
46 [label="gini = 0.524\nsamples = 15\nvalue = [2, 1, 1, 0, 1, 10, 0, 0, 0, 0]"] ;
45 -> 46 ;
47 [label="X[39] <= 132.599\ngini = 0.736\nsamples = 30\nvalue = [2, 1, 1, 0, 3, 0, 1, 2, 13, 7]"] ;
45 -> 47 ;
48 [label="X[6] <= 19.811\ngini = 0.789\nsamples = 21\nvalue = [2, 0, 1, 0, 3, 0, 1, 2, 5, 7]"] ;
47 -> 48 ;
49 [label="gini = 0.75\nsamples = 8\nvalue = [2, 0, 0, 0, 3, 0, 1, 1, 1, 0]"] ;
48 -> 49 ;
50 [label="gini = 0.604\nsamples = 13\nvalue = [0, 0, 1, 0, 0, 0, 0, 1, 4, 7]"] ;
48 -> 50 ;
51 [label="gini = 0.198\nsamples = 9\nvalue = [0, 1, 0, 0, 0, 0, 0, 0, 8, 0]"] ;
47 -> 51 ;
52 [label="X[41] <= 0.733\ngini = 0.18\nsamples = 20\nvalue = [18, 2, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
44 -> 52 ;
53 [label="gini = 0.0\nsamples = 18\nvalue = [18, 0, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
52 -> 53 ;
54 [label="gini = 0.0\nsamples = 2\nvalue = [0, 2, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
52 -> 54 ;
55 [label="X[18] <= 341.295\ngini = 0.698\nsamples = 115\nvalue = [29, 0, 54, 2, 5, 4, 0, 3, 6, 12]"] ;
43 -> 55 ;
56 [label="X[20] <= 3.785\ngini = 0.601\nsamples = 77\nvalue = [7, 0, 47, 1, 3, 4, 0, 3, 6, 6]"] ;
55 -> 56 ;
57 [label="gini = 0.745\nsamples = 14\nvalue = [5, 0, 0, 0, 2, 1, 0, 0, 2, 4]"] ;
56 -> 57 ;
58 [label="X[36] <= 0.045\ngini = 0.432\nsamples = 63\nvalue = [2, 0, 47, 1, 1, 3, 0, 3, 4, 2]"] ;
56 -> 58 ;
59 [label="gini = 0.625\nsamples = 4\nvalue = [0, 0, 0, 0, 0, 1, 0, 2, 0, 1]"] ;
58 -> 59 ;
60 [label="X[40] <= 246.653\ngini = 0.357\nsamples = 59\nvalue = [2, 0, 47, 1, 1, 2, 0, 1, 4, 1]"] ;
58 -> 60 ;
61 [label="X[6] <= 15.691\ngini = 0.291\nsamples = 56\nvalue = [2, 0, 47, 1, 1, 2, 0, 0, 2, 1]"] ;
60 -> 61 ;
62 [label="gini = 0.5\nsamples = 2\nvalue = [0, 0, 0, 0, 1, 1, 0, 0, 0, 0]"] ;
61 -> 62 ;
63 [label="X[33] <= 0.418\ngini = 0.239\nsamples = 54\nvalue = [2, 0, 47, 1, 0, 1, 0, 0, 2, 1]"] ;
61 -> 63 ;
64 [label="X[38] <= 0.021\ngini = 0.125\nsamples = 46\nvalue = [0, 0, 43, 0, 0, 1, 0, 0, 1, 1]"] ;
63 -> 64 ;
65 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"] ;
64 -> 65 ;
66 [label="X[27] <= 0.594\ngini = 0.086\nsamples = 45\nvalue = [0, 0, 43, 0, 0, 1, 0, 0, 1, 0]"] ;
64 -> 66 ;
67 [label="X[29] <= 0.201\ngini = 0.044\nsamples = 44\nvalue = [0, 0, 43, 0, 0, 1, 0, 0, 0, 0]"] ;
66 -> 67 ;
68 [label="gini = 0.5\nsamples = 2\nvalue = [0, 0, 1, 0, 0, 1, 0, 0, 0, 0]"] ;
67 -> 68 ;
69 [label="gini = 0.0\nsamples = 42\nvalue = [0, 0, 42, 0, 0, 0, 0, 0, 0, 0]"] ;
67 -> 69 ;
70 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]"] ;
66 -> 70 ;
71 [label="gini = 0.656\nsamples = 8\nvalue = [2, 0, 4, 1, 0, 0, 0, 0, 1, 0]"] ;
63 -> 71 ;
72 [label="gini = 0.444\nsamples = 3\nvalue = [0, 0, 0, 0, 0, 0, 0, 1, 2, 0]"] ;
60 -> 72 ;
73 [label="X[30] <= 0.047\ngini = 0.602\nsamples = 38\nvalue = [22, 0, 7, 1, 2, 0, 0, 0, 0, 6]"] ;
55 -> 73 ;
74 [label="gini = 0.58\nsamples = 10\nvalue = [2, 0, 6, 0, 1, 0, 0, 0, 0, 1]"] ;
73 -> 74 ;
75 [label="X[19] <= 13.585\ngini = 0.454\nsamples = 28\nvalue = [20, 0, 1, 1, 1, 0, 0, 0, 0, 5]"] ;
73 -> 75 ;
76 [label="X[40] <= 49.331\ngini = 0.288\nsamples = 24\nvalue = [20, 0, 0, 0, 1, 0, 0, 0, 0, 3]"] ;
75 -> 76 ;
77 [label="gini = 0.0\nsamples = 2\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 2]"] ;
76 -> 77 ;
78 [label="X[36] <= 0.125\ngini = 0.169\nsamples = 22\nvalue = [20, 0, 0, 0, 1, 0, 0, 0, 0, 1]"] ;
76 -> 78 ;
79 [label="X[20] <= 4.194\ngini = 0.091\nsamples = 21\nvalue = [20, 0, 0, 0, 1, 0, 0, 0, 0, 0]"] ;
78 -> 79 ;
80 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 1, 0, 0, 0, 0, 0]"] ;
79 -> 80 ;
81 [label="gini = 0.0\nsamples = 20\nvalue = [20, 0, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
79 -> 81 ;
82 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"] ;
78 -> 82 ;
83 [label="gini = 0.625\nsamples = 4\nvalue = [0, 0, 1, 1, 0, 0, 0, 0, 0, 2]"] ;
75 -> 83 ;
84 [label="X[29] <= 0.308\ngini = 0.391\nsamples = 26\nvalue = [3, 0, 1, 0, 1, 1, 0, 0, 20, 0]"] ;
42 -> 84 ;
85 [label="gini = 0.667\nsamples = 6\nvalue = [3, 0, 1, 0, 0, 1, 0, 0, 1, 0]"] ;
84 -> 85 ;
86 [label="X[8] <= 2908.947\ngini = 0.095\nsamples = 20\nvalue = [0, 0, 0, 0, 1, 0, 0, 0, 19, 0]"] ;
84 -> 86 ;
87 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 1, 0, 0, 0, 0, 0]"] ;
86 -> 87 ;
88 [label="gini = 0.0\nsamples = 19\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 19, 0]"] ;
86 -> 88 ;
89 [label="X[13] <= 46.914\ngini = 0.863\nsamples = 327\nvalue = [24, 2, 22, 80, 34, 17, 33, 28, 38, 49]"] ;
27 -> 89 ;
90 [label="X[14] <= 127.242\ngini = 0.829\nsamples = 231\nvalue = [4, 2, 19, 71, 21, 17, 3, 28, 33, 33]"] ;
89 -> 90 ;
91 [label="X[11] <= -4.759\ngini = 0.733\nsamples = 36\nvalue = [1, 2, 2, 3, 1, 15, 1, 1, 0, 10]"] ;
90 -> 91 ;
92 [label="gini = 0.71\nsamples = 18\nvalue = [1, 2, 1, 2, 1, 0, 1, 1, 0, 9]"] ;
91 -> 92 ;
93 [label="gini = 0.296\nsamples = 18\nvalue = [0, 0, 1, 1, 0, 15, 0, 0, 0, 1]"] ;
91 -> 93 ;
94 [label="X[2] <= 0.089\ngini = 0.798\nsamples = 195\nvalue = [3, 0, 17, 68, 20, 2, 2, 27, 33, 23]"] ;
90 -> 94 ;
95 [label="X[35] <= 0.279\ngini = 0.711\nsamples = 38\nvalue = [0, 0, 3, 2, 6, 0, 0, 6, 18, 3]"] ;
94 -> 95 ;
96 [label="gini = 0.32\nsamples = 5\nvalue = [0, 0, 0, 0, 0, 0, 0, 4, 0, 1]"] ;
95 -> 96 ;
97 [label="X[22] <= 8.885\ngini = 0.65\nsamples = 33\nvalue = [0, 0, 3, 2, 6, 0, 0, 2, 18, 2]"] ;
95 -> 97 ;
98 [label="gini = 0.765\nsamples = 14\nvalue = [0, 0, 2, 2, 5, 0, 0, 0, 3, 2]"] ;
97 -> 98 ;
99 [label="gini = 0.36\nsamples = 19\nvalue = [0, 0, 1, 0, 1, 0, 0, 2, 15, 0]"] ;
97 -> 99 ;
100 [label="X[18] <= 53.272\ngini = 0.763\nsamples = 157\nvalue = [3, 0, 14, 66, 14, 2, 2, 21, 15, 20]"] ;
94 -> 100 ;
101 [label="X[39] <= 81.466\ngini = 0.775\nsamples = 26\nvalue = [1, 0, 7, 1, 1, 1, 1, 0, 7, 7]"] ;
100 -> 101 ;
102 [label="gini = 0.463\nsamples = 11\nvalue = [0, 0, 4, 0, 0, 0, 0, 0, 7, 0]"] ;
101 -> 102 ;
103 [label="gini = 0.72\nsamples = 15\nvalue = [1, 0, 3, 1, 1, 1, 1, 0, 0, 7]"] ;
101 -> 103 ;
104 [label="X[17] <= 32.282\ngini = 0.701\nsamples = 131\nvalue = [2, 0, 7, 65, 13, 1, 1, 21, 8, 13]"] ;
100 -> 104 ;
105 [label="X[41] <= 0.655\ngini = 0.652\nsamples = 112\nvalue = [0, 0, 5, 62, 12, 1, 0, 11, 8, 13]"] ;
104 -> 105 ;
106 [label="X[4] <= 0.002\ngini = 0.786\nsamples = 23\nvalue = [0, 0, 0, 5, 7, 1, 0, 2, 3, 5]"] ;
105 -> 106 ;
107 [label="gini = 0.0\nsamples = 4\nvalue = [0, 0, 0, 0, 4, 0, 0, 0, 0, 0]"] ;
106 -> 107 ;
108 [label="gini = 0.798\nsamples = 19\nvalue = [0, 0, 0, 5, 3, 1, 0, 2, 3, 5]"] ;
106 -> 108 ;
109 [label="X[5] <= 23.418\ngini = 0.562\nsamples = 89\nvalue = [0, 0, 5, 57, 5, 0, 0, 9, 5, 8]"] ;
105 -> 109 ;
110 [label="X[15] <= -7.83\ngini = 0.713\nsamples = 51\nvalue = [0, 0, 3, 24, 4, 0, 0, 9, 4, 7]"] ;
109 -> 110 ;
111 [label="gini = 0.124\nsamples = 15\nvalue = [0, 0, 1, 14, 0, 0, 0, 0, 0, 0]"] ;
110 -> 111 ;
112 [label="X[0] <= 3541.513\ngini = 0.795\nsamples = 36\nvalue = [0, 0, 2, 10, 4, 0, 0, 9, 4, 7]"] ;
110 -> 112 ;
113 [label="X[26] <= 2.516\ngini = 0.795\nsamples = 32\nvalue = [0, 0, 2, 10, 4, 0, 0, 5, 4, 7]"] ;
112 -> 113 ;
114 [label="gini = 0.645\nsamples = 11\nvalue = [0, 0, 1, 1, 1, 0, 0, 0, 2, 6]"] ;
113 -> 114 ;
115 [label="X[19] <= 5.718\ngini = 0.726\nsamples = 21\nvalue = [0, 0, 1, 9, 3, 0, 0, 5, 2, 1]"] ;
113 -> 115 ;
116 [label="gini = 0.0\nsamples = 7\nvalue = [0, 0, 0, 7, 0, 0, 0, 0, 0, 0]"] ;
115 -> 116 ;
117 [label="gini = 0.776\nsamples = 14\nvalue = [0, 0, 1, 2, 3, 0, 0, 5, 2, 1]"] ;
115 -> 117 ;
118 [label="gini = 0.0\nsamples = 4\nvalue = [0, 0, 0, 0, 0, 0, 0, 4, 0, 0]"] ;
112 -> 118 ;
119 [label="X[29] <= 0.506\ngini = 0.241\nsamples = 38\nvalue = [0, 0, 2, 33, 1, 0, 0, 0, 1, 1]"] ;
109 -> 119 ;
120 [label="X[6] <= 21.369\ngini = 0.156\nsamples = 36\nvalue = [0, 0, 2, 33, 0, 0, 0, 0, 0, 1]"] ;
119 -> 120 ;
121 [label="gini = 0.444\nsamples = 3\nvalue = [0, 0, 2, 1, 0, 0, 0, 0, 0, 0]"] ;
120 -> 121 ;
122 [label="X[25] <= 4.125\ngini = 0.059\nsamples = 33\nvalue = [0, 0, 0, 32, 0, 0, 0, 0, 0, 1]"] ;
120 -> 122 ;
123 [label="gini = 0.0\nsamples = 32\nvalue = [0, 0, 0, 32, 0, 0, 0, 0, 0, 0]"] ;
122 -> 123 ;
124 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"] ;
122 -> 124 ;
125 [label="gini = 0.5\nsamples = 2\nvalue = [0, 0, 0, 0, 1, 0, 0, 0, 1, 0]"] ;
119 -> 125 ;
126 [label="gini = 0.67\nsamples = 19\nvalue = [2, 0, 2, 3, 1, 0, 1, 10, 0, 0]"] ;
104 -> 126 ;
127 [label="X[11] <= -27.553\ngini = 0.8\nsamples = 96\nvalue = [20, 0, 3, 9, 13, 0, 30, 0, 5, 16]"] ;
89 -> 127 ;
128 [label="X[27] <= 0.356\ngini = 0.429\nsamples = 30\nvalue = [0, 0, 0, 1, 2, 0, 22, 0, 0, 5]"] ;
127 -> 128 ;
129 [label="gini = 0.32\nsamples = 5\nvalue = [0, 0, 0, 1, 0, 0, 0, 0, 0, 4]"] ;
128 -> 129 ;
130 [label="X[30] <= 0.084\ngini = 0.218\nsamples = 25\nvalue = [0, 0, 0, 0, 2, 0, 22, 0, 0, 1]"] ;
128 -> 130 ;
131 [label="X[32] <= 0.045\ngini = 0.153\nsamples = 24\nvalue = [0, 0, 0, 0, 2, 0, 22, 0, 0, 0]"] ;
130 -> 131 ;
132 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 1, 0, 0, 0, 0, 0]"] ;
131 -> 132 ;
133 [label="X[41] <= 0.784\ngini = 0.083\nsamples = 23\nvalue = [0, 0, 0, 0, 1, 0, 22, 0, 0, 0]"] ;
131 -> 133 ;
134 [label="gini = 0.0\nsamples = 21\nvalue = [0, 0, 0, 0, 0, 0, 21, 0, 0, 0]"] ;
133 -> 134 ;
135 [label="gini = 0.5\nsamples = 2\nvalue = [0, 0, 0, 0, 1, 0, 1, 0, 0, 0]"] ;
133 -> 135 ;
136 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"] ;
130 -> 136 ;
137 [label="X[10] <= 270.408\ngini = 0.815\nsamples = 66\nvalue = [20, 0, 3, 8, 11, 0, 8, 0, 5, 11]"] ;
127 -> 137 ;
138 [label="gini = 0.0\nsamples = 9\nvalue = [9, 0, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
137 -> 138 ;
139 [label="X[10] <= 899.257\ngini = 0.838\nsamples = 57\nvalue = [11, 0, 3, 8, 11, 0, 8, 0, 5, 11]"] ;
137 -> 139 ;
140 [label="X[29] <= 0.463\ngini = 0.815\nsamples = 52\nvalue = [11, 0, 3, 8, 11, 0, 8, 0, 0, 11]"] ;
139 -> 140 ;
141 [label="X[19] <= 3.387\ngini = 0.788\nsamples = 40\nvalue = [11, 0, 3, 8, 3, 0, 4, 0, 0, 11]"] ;
140 -> 141 ;
142 [label="gini = 0.672\nsamples = 16\nvalue = [1, 0, 0, 8, 1, 0, 3, 0, 0, 3]"] ;
141 -> 142 ;
143 [label="X[5] <= 18.78\ngini = 0.691\nsamples = 24\nvalue = [10, 0, 3, 0, 2, 0, 1, 0, 0, 8]"] ;
141 -> 143 ;
144 [label="gini = 0.0\nsamples = 5\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 5]"] ;
143 -> 144 ;
145 [label="gini = 0.659\nsamples = 19\nvalue = [10, 0, 3, 0, 2, 0, 1, 0, 0, 3]"] ;
143 -> 145 ;
146 [label="gini = 0.444\nsamples = 12\nvalue = [0, 0, 0, 0, 8, 0, 4, 0, 0, 0]"] ;
140 -> 146 ;
147 [label="gini = 0.0\nsamples = 5\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 5, 0]"] ;
139 -> 147 ;
148 [label="X[1] <= 6425.041\ngini = 0.656\nsamples = 128\nvalue = [7, 0, 0, 5, 46, 1, 2, 58, 9, 0]"] ;
14 -> 148 ;
149 [label="X[35] <= 0.331\ngini = 0.626\nsamples = 69\nvalue = [7, 0, 0, 5, 40, 1, 2, 8, 6, 0]"] ;
148 -> 149 ;
150 [label="gini = 0.742\nsamples = 19\nvalue = [3, 0, 0, 1, 1, 1, 1, 8, 4, 0]"] ;
149 -> 150 ;
151 [label="X[9] <= 116.612\ngini = 0.377\nsamples = 50\nvalue = [4, 0, 0, 4, 39, 0, 1, 0, 2, 0]"] ;
149 -> 151 ;
152 [label="X[41] <= 0.695\ngini = 0.301\nsamples = 47\nvalue = [1, 0, 0, 4, 39, 0, 1, 0, 2, 0]"] ;
151 -> 152 ;
153 [label="X[34] <= 0.051\ngini = 0.179\nsamples = 42\nvalue = [1, 0, 0, 1, 38, 0, 1, 0, 1, 0]"] ;
152 -> 153 ;
154 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]"] ;
153 -> 154 ;
155 [label="X[6] <= 15.523\ngini = 0.139\nsamples = 41\nvalue = [1, 0, 0, 1, 38, 0, 1, 0, 0, 0]"] ;
153 -> 155 ;
156 [label="gini = 0.0\nsamples = 1\nvalue = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
155 -> 156 ;
157 [label="X[24] <= 0.743\ngini = 0.096\nsamples = 40\nvalue = [0, 0, 0, 1, 38, 0, 1, 0, 0, 0]"] ;
155 -> 157 ;
158 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 1, 0, 0, 0]"] ;
157 -> 158 ;
159 [label="X[40] <= 207.05\ngini = 0.05\nsamples = 39\nvalue = [0, 0, 0, 1, 38, 0, 0, 0, 0, 0]"] ;
157 -> 159 ;
160 [label="gini = 0.0\nsamples = 37\nvalue = [0, 0, 0, 0, 37, 0, 0, 0, 0, 0]"] ;
159 -> 160 ;
161 [label="gini = 0.5\nsamples = 2\nvalue = [0, 0, 0, 1, 1, 0, 0, 0, 0, 0]"] ;
159 -> 161 ;
162 [label="gini = 0.56\nsamples = 5\nvalue = [0, 0, 0, 3, 1, 0, 0, 0, 1, 0]"] ;
152 -> 162 ;
163 [label="gini = 0.0\nsamples = 3\nvalue = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0]"] ;
151 -> 163 ;
164 [label="X[5] <= 26.587\ngini = 0.269\nsamples = 59\nvalue = [0, 0, 0, 0, 6, 0, 0, 50, 3, 0]"] ;
148 -> 164 ;
165 [label="X[9] <= 31.541\ngini = 0.169\nsamples = 55\nvalue = [0, 0, 0, 0, 2, 0, 0, 50, 3, 0]"] ;
164 -> 165 ;
166 [label="gini = 0.0\nsamples = 2\nvalue = [0, 0, 0, 0, 2, 0, 0, 0, 0, 0]"] ;
165 -> 166 ;
167 [label="X[35] <= 0.635\ngini = 0.107\nsamples = 53\nvalue = [0, 0, 0, 0, 0, 0, 0, 50, 3, 0]"] ;
165 -> 167 ;
168 [label="X[36] <= 0.129\ngini = 0.038\nsamples = 51\nvalue = [0, 0, 0, 0, 0, 0, 0, 50, 1, 0]"] ;
167 -> 168 ;
169 [label="gini = 0.0\nsamples = 50\nvalue = [0, 0, 0, 0, 0, 0, 0, 50, 0, 0]"] ;
168 -> 169 ;
170 [label="gini = 0.0\nsamples = 1\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]"] ;
168 -> 170 ;
171 [label="gini = 0.0\nsamples = 2\nvalue = [0, 0, 0, 0, 0, 0, 0, 0, 2, 0]"] ;
167 -> 171 ;
172 [label="gini = 0.0\nsamples = 4\nvalue = [0, 0, 0, 0, 4, 0, 0, 0, 0, 0]"] ;
164 -> 172 ;
}
\ No newline at end of file
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment