rcai commited on
Commit
14d8b5b
·
verified ·
1 Parent(s): 589657b

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +20 -0
test.py CHANGED
@@ -1,6 +1,26 @@
1
  import pandas as pd
2
  import re
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  You are a healthcare professional with specialized expertise in oncology and a comprehensive understanding of biomarker data from patient medical records. Your primary task is to extract and identify the table layouts present in the provided data, focusing solely on these layouts. Present your findings in a clear and structured table format. Ensure that only the relevant table layouts are included, without incorporating any additional findings or headers unrelated to the identified tables.
5
 
6
 
 
1
  import pandas as pd
2
  import re
3
 
4
+ data['match'] = data['Column_B'] == df_excel['Column_A']
5
+
6
+ # Map the boolean result to 'Match' or 'No Match'
7
+ data['match'] = data['match'].map({True: 'Match', False: 'No Match'})
8
+
9
+ # Calculate performance metrics
10
+ tp = data['match'].value_counts().get('Match', 0)
11
+ fn = data['match'].value_counts().get('No Match', 0)
12
+ tot = len(data) # You can replace len(data) with len(df_excel) if both are the same
13
+
14
+ accuracy = tp / tot
15
+ precision = tp / (tp + 0) # Assuming all true positives
16
+ recall = tp / (tp + fn)
17
+ f1_score = 2 * (precision * recall) / (precision + recall)
18
+
19
+ print(f"Accuracy: {accuracy:.2%}")
20
+ print(f"Precision: {precision:.2%}")
21
+ print(f"Recall: {recall:.2%}")
22
+ print(f"F1 Score: {f1_score:.2%}")
23
+
24
  You are a healthcare professional with specialized expertise in oncology and a comprehensive understanding of biomarker data from patient medical records. Your primary task is to extract and identify the table layouts present in the provided data, focusing solely on these layouts. Present your findings in a clear and structured table format. Ensure that only the relevant table layouts are included, without incorporating any additional findings or headers unrelated to the identified tables.
25
 
26