08.06.2015 Views

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Classification III – Music Genre Classification<br />

y_label_test = np.asarray(y_test==label, dtype=int)<br />

proba = clf.predict_proba(X_test)<br />

proba_label = proba[:,label]<br />

fpr, tpr, roc_thresholds = roc_curve(y_label_test, proba_<br />

label)<br />

# plot tpr over fpr<br />

# ...<br />

The outcome will be the six ROC plots shown in the following screenshot. As<br />

we have already found out, our first version of a classifier only performs well on<br />

classical songs. Looking at the individual ROC curves, however, tells us that we are<br />

really underperforming for most of the other genres. Only jazz and country provide<br />

some hope. The remaining genres are clearly not usable:<br />

[ 192 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!