Timbre analysis
Stroke Classification
Mridangam Stroke Classification
Note
REQUIRES: essentia
- class compiam.timbre.stroke_classification.mridangam_stroke_classification.MridangamStrokeClassification[source]
Mridangam stroke classification.
- dict_strokes()[source]
List and convert to indexed dict the available mridangam strokes in the dataset.
- Returns:
dict with strokes as values and unique integer as keys.
- list_strokes()[source]
List available mridangam strokes in the dataset.
- Returns:
list of strokes in the datasets.
- load_mridangam_dataset(data_home=None, version='default', download=True)[source]
Load mirdata dataloader for mirdangam stroke.
- Parameters:
data_home – folder where the dataset is found.
version – version of the dataset to use.
download – if True the dataset is downloaded.
- Returns:
None, but initializes the dataset of the class and the file dict of strokes.
- predict(file_list)[source]
Predict stroke type from list of files.
- Parameters:
file_list – list of files for prediction.
- Returns:
dict containing filenames as keys and estimated strokes as values.
- train_model(model_type='svm', load_computed=False, balance=False, balance_ref='random')[source]
Train a support vector machine for stroke classification.
- Parameters:
model_type – type of model to train.
model_type – bool to indicate if the features are computed or loaded from file.
balance – balance the number of instances per class to prevent biases.
balance_ref – reference class for data balancement.
- Returns:
accuracy in percentage and rounded to two decimals