Severian commited on
Commit
fc7572a
·
verified ·
1 Parent(s): 41ae4a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  import pandas as pd
5
  import plotly.graph_objects as go
6
  from plotly.subplots import make_subplots
7
- from umap.umap_ import UMAP
8
  from sklearn.cluster import KMeans
9
  from scipy.stats import entropy as shannon_entropy
10
  from scipy import special as sp_special
@@ -118,8 +118,11 @@ else:
118
  n_dummy_items_per_category = 50
119
 
120
  rng = np.random.default_rng(42)
121
- dog_labels = ["bark", "growl", "whine", "pant"] * (n_dummy_items_per_category // 4)
122
- human_labels = ["speech", "laugh", "cry", "shout"] * (n_dummy_items_per_category // 4)
 
 
 
123
  dog_rows = {
124
  "feature_1": rng.random(n_dummy_items_per_category), "feature_2": rng.random(n_dummy_items_per_category), "feature_3": rng.random(n_dummy_items_per_category),
125
  "label": dog_labels, "filepath": [f"dog_{i}.wav" for i in range(n_dummy_items_per_category)],
 
4
  import pandas as pd
5
  import plotly.graph_objects as go
6
  from plotly.subplots import make_subplots
7
+ from umap import UMAP
8
  from sklearn.cluster import KMeans
9
  from scipy.stats import entropy as shannon_entropy
10
  from scipy import special as sp_special
 
118
  n_dummy_items_per_category = 50
119
 
120
  rng = np.random.default_rng(42)
121
+ # Ensure labels match the exact number of items
122
+ base_dog_labels = ["bark", "growl", "whine", "pant"]
123
+ base_human_labels = ["speech", "laugh", "cry", "shout"]
124
+ dog_labels = [base_dog_labels[i % len(base_dog_labels)] for i in range(n_dummy_items_per_category)]
125
+ human_labels = [base_human_labels[i % len(base_human_labels)] for i in range(n_dummy_items_per_category)]
126
  dog_rows = {
127
  "feature_1": rng.random(n_dummy_items_per_category), "feature_2": rng.random(n_dummy_items_per_category), "feature_3": rng.random(n_dummy_items_per_category),
128
  "label": dog_labels, "filepath": [f"dog_{i}.wav" for i in range(n_dummy_items_per_category)],