Spaces:
Running
Running
Sadjad Alikhani
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ def plot_confusion_matrix(y_true, y_pred, title):
|
|
112 |
plt.savefig(f"{title}.png")
|
113 |
return Image.open(f"{title}.png")
|
114 |
|
115 |
-
def identical_train_test_split(output_emb, output_raw, percentage):
|
116 |
N = output_emb.shape[0] # Get the total number of samples
|
117 |
|
118 |
# Generate the indices for shuffling and splitting
|
@@ -200,6 +200,7 @@ def process_hdf5_file(uploaded_file, percentage_idx):
|
|
200 |
|
201 |
train_data_emb, test_data_emb, train_data_raw, test_data_raw, train_labels, test_labels = identical_train_test_split(output_emb.view(len(output_emb),-1),
|
202 |
output_raw.view(len(output_raw),-1),
|
|
|
203 |
percentage_idx)
|
204 |
|
205 |
# Step 8: Perform classification using the Euclidean distance for both raw and embeddings
|
|
|
112 |
plt.savefig(f"{title}.png")
|
113 |
return Image.open(f"{title}.png")
|
114 |
|
115 |
+
def identical_train_test_split(output_emb, output_raw, labels, percentage):
|
116 |
N = output_emb.shape[0] # Get the total number of samples
|
117 |
|
118 |
# Generate the indices for shuffling and splitting
|
|
|
200 |
|
201 |
train_data_emb, test_data_emb, train_data_raw, test_data_raw, train_labels, test_labels = identical_train_test_split(output_emb.view(len(output_emb),-1),
|
202 |
output_raw.view(len(output_raw),-1),
|
203 |
+
labels,
|
204 |
percentage_idx)
|
205 |
|
206 |
# Step 8: Perform classification using the Euclidean distance for both raw and embeddings
|