py2lispIDyOM.export.Export

class py2lispIDyOM.export.Export(experiment_folder_path, idyom_output_keywords=None, melody_names=None)[source]

Export selected IDyOM model outputs to other formats.

Parameters:
  • experiment_folder_path (str) – the path to which you saved all the result data/plots

  • idyom_output_keywords (List[str]) – a list of IDyOM output keywords you want to export. To see a full list of valid idyom_output_keywords, use the method: extract.get_idyom_output_keyword_list()

  • melody_names (list(str)) – a list of melodies of which IDyOM outputs that you want to export

Public Data Attributes:

idyom_output_keywords

melody_names

experiment_folder_path

Public Methods:

__post_init__()

export2mat()

This function exports the IDyOM output data to mat files.

export2csv()

This function exports the IDyOM output data to a csv files.

__init__(experiment_folder_path[, ...])

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

Private Methods:

_generate_export_folder(export_folder_name)

To generate a folder to store the idyom outputs in other formats (e.g., .mat, .csv)

_get_valid_idyom_output_keys(melody)

To get a list of valid idyom output keys for a melody.

_get_idyom_output_for_single_melody(melody, ...)

To get the IDyOM output value array for a single melody, according to the IDyOM output keys.

_get_single_melody_output_values_df(melody)

This function returns a DataFrame of all IDyOM output values of one melody.

_get_output_values_in_selected_melodies(...)

This function returns a np.array of idyom output values for selected an idyom key for each selected songs.

_get_output_values_df_in_selected_melodies(...)

This function iterate through the func '_get_single_melody_output_values_df' to get a DataFrame of idyom output values for all idyom keys for each selected songs.

_export_by_keyword_2mat(keywords_list, ...)

Export the idyom output data to .mat files according to the keyword list.

_export_values_of_keywords_by_melody_2mat(...)

Exports the IDyOM output values according to the keywords_list of one song to a mat file.

_export_by_song_2csv(melody_name, ...)

Exports the all the IDyOM output data (df) for a single melody to csv


export2csv()[source]

This function exports the IDyOM output data to a csv files. By default, this will export all properties of the chosen melodies, where each melody is in one csv file.

:return a csv file containing all IDyOM output data for each selected melody.

export2mat()[source]

This function exports the IDyOM output data to mat files. By default, it will export the outputs according to the preset keywords specified in the idyom_output_keywords for all melodies. Users can also specify specific melody by passing the melody names to the melody_name param.

:return (a) mat file(s) containing the selected IDyOM output data