<jupyter_start><jupyter_text>Mean duration of events<jupyter_code>means = []
labels = np.unique(df["event_label"])
print("Mean duration of events")
for label in labels:
    mean_duration = df[df["event_label"] == label]["duration"].mean()
    means.append(mean_duration)
    print("{:30} : {:3f}".format(label, mean_duration))<jupyter_output>Mean duration of events
Alarm_bell_ringing             : 1.534518
Blender                        : 5.354750
Cat                            : 0.813392
Dishes                         : 0.559590
Dog                            : 1.026252
Electric_shaver_toothbrush     : 7.415429
Frying                         : 9.336375
Running_water                  : 5.611053
Speech                         : 1.514981
Vacuum_cleaner                 : 8.655472<jupyter_text>Median duration of events<jupyter_code>medians = []
labels = np.unique(df["event_label"])
print("Median duration of events")
for label in labels:
    mean_duration = df[df["event_label"] == label]["duration"].median()
    medians.append(mean_duration)
    print("{:30} : {:3f}".format(label, mean_duration))<jupyter_output>Median duration of events
Alarm_bell_ringing             : 0.575500
Blender                        : 4.587500
Cat                            : 0.640000
Dishes                         : 0.418500
Dog                            : 0.573000
Electric_shaver_toothbrush     : 8.795500
Frying                         : 10.000000
Running_water                  : 5.529500
Speech                         : 1.175000
Vacuum_cleaner                 : 9.985500<jupyter_text>Durations, mean over events<jupyter_code>print("mean duration on mean events (macro)")
print(np.mean(means))
print("median duration on median events (macro)")
print(np.median(medians))<jupyter_output>median duration on median events (macro)
2.88125<jupyter_text>Durations, overall data<jupyter_code>print("Median duration over all events (micro)")
print(df["duration"].median())
print("mean duration over all events (micro)")
df["duration"].mean()<jupyter_output>mean duration over all events (micro)
{'fraction_non_alphanumeric': 0.10710854947166186, 'fraction_numerical': 0.07348703170028818, 'mean_word_length': 2.3925081433224755, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '549165', 'license': 'MIT', 'n_tokens_mistral': 761, 'n_tokens_neox': 628, 'n_words': 129, 'path': 'task4/notebooks/Test_events_duration.ipynb', 'repo_name': 'ankitshah009/dcase2018_baseline', 'size': '2082'}