<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Getting started with scikit-multilearn
Scikit-multilearn is a BSD-licensed library for multi-label classification that is built on top of the well-known scikit-learn ecosystem.
To install it just run the command
Step1:  Let's load up some data. In this tutorial we will be working with the emotions data set introduced in emotions.
Step2:  The feature_names variable contains list of pairs (feature name, type) that were provided in the original data set. In the case of emotions data the authors write
Step3:  The label_names variable contains list of pairs (label name, type) of labels that were used to annotate the music. The paper states that
Step4:  On a side note, Binary Relevance trains a classifier per each of the labels, we can see that the classifier hasn't been trained yet
Step5:  Scikit-learn introduces a convention of how classifiers are organized. The typical usage of classifier is
Step6:  The base classifiers have been trained now
Step7:  Scikit-learn provides a set of metrics useful for evaluating the quality of the model. They are most often used by providing the true assignment matrix/array as the first argument, and the prediction matrix/array as the second argument.
<ASSISTANT_TASK:>
Python Code:
from skmultilearn.dataset import load_dataset
Explanation: Getting started with scikit-multilearn
Scikit-multilearn is a BSD-licensed library for multi-label classification that is built on top of the well-known scikit-learn ecosystem.
To install it just run the command:
bash
$ pip install scikit-multilearn
Scikit-multilearn works with Python 2 and 3 on Windows, Linux and OSX. The module name is skmultilearn.
End of explanation
X_train, y_train, feature_names, label_names = load_dataset('emotions', 'train')
X_test, y_test, _, _ = load_dataset('emotions', 'test')
Explanation: Let's load up some data. In this tutorial we will be working with the emotions data set introduced in emotions.
End of explanation
feature_names[:10]
Explanation: The feature_names variable contains list of pairs (feature name, type) that were provided in the original data set. In the case of emotions data the authors write: 
The extracted features fall into two categories: rhythmic and timbre. 
Let's take a look at the first few features:
End of explanation
label_names
from skmultilearn.problem_transform import BinaryRelevance
from sklearn.svm import SVC
clf = BinaryRelevance(
    classifier=SVC(),
    require_dense=[False, True]
)
Explanation: The label_names variable contains list of pairs (label name, type) of labels that were used to annotate the music. The paper states that:
The Tellegen-Watson-Clark model was employed for labeling
the data with emotions. The sound clips were annotated by three male experts of
age 20, 25 and 30 from the School of Music Studies 
The labels counts in the training data are as follows:
|Label|Description|# Examples|
|-----|-----------|----------|
|L1|amazed-surprised|173|
|L2|happy-pleased|166|
|L3|relaxing-calm|264|
|L4|quiet-still|148|
|L5|sad-lonely|168|
|L6|angry-fearful|189|
Let's see the contents of label_names:
End of explanation
clf.classifiers_
Explanation: On a side note, Binary Relevance trains a classifier per each of the labels, we can see that the classifier hasn't been trained yet:
End of explanation
clf.fit(X_train, y_train)
Explanation: Scikit-learn introduces a convention of how classifiers are organized. The typical usage of classifier is:
fit it to the data (trains the classifier and returns self)
predict results on new data (returns predicted results)
Scikit-multilearn follows these conventions, let's train a multi-label classifier:
End of explanation
clf.classifiers_
prediction = clf.predict(X_test)
prediction
## Measure the quality
import sklearn.metrics as metrics
Explanation: The base classifiers have been trained now:
End of explanation
metrics.hamming_loss(y_test, prediction)
metrics.accuracy_score(y_test, prediction)
Explanation: Scikit-learn provides a set of metrics useful for evaluating the quality of the model. They are most often used by providing the true assignment matrix/array as the first argument, and the prediction matrix/array as the second argument.
End of explanation
<END_TASK>