mouadenna commited on
Commit
a3eeb8a
1 Parent(s): 0cb0826

Update deployML.py

Browse files
Files changed (1) hide show
  1. deployML.py +5 -10
deployML.py CHANGED
@@ -9,9 +9,10 @@ severity=pd.read_csv("Symptom-severity.csv")
9
  severity['Symptom'] = severity['Symptom'].str.replace('_',' ')
10
  precaution = pd.read_csv("symptom_precaution.csv")
11
 
12
- def predd(x,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17):
13
- psymptoms = [S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17]
14
  #print(psymptoms)
 
 
15
  a = np.array(severity["Symptom"])
16
  b = np.array(severity["weight"])
17
  for j in range(len(psymptoms)):
@@ -27,11 +28,5 @@ def predd(x,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17):
27
  precuation_list=[]
28
  for i in range(1,len(precaution.iloc[c])):
29
  precuation_list.append(precaution.iloc[c,i])
30
- print("The Disease Name: ",pred2[0])
31
- print("The Disease Discription: ",disp)
32
- print("Recommended Things to do at home: ")
33
- for i in precuation_list:
34
- print(" -",i)
35
- """
36
- predd(loaded_rf,'high fever','sunken eyes','breathlessness',0,0,0,0,0,0,0,'sweating',0,0,0,0,0,0)
37
- """
 
9
  severity['Symptom'] = severity['Symptom'].str.replace('_',' ')
10
  precaution = pd.read_csv("symptom_precaution.csv")
11
 
12
+ def predd(x,psymptoms):
 
13
  #print(psymptoms)
14
+ psymptoms.extend([0] * (17-len(psymptoms)))
15
+
16
  a = np.array(severity["Symptom"])
17
  b = np.array(severity["weight"])
18
  for j in range(len(psymptoms)):
 
28
  precuation_list=[]
29
  for i in range(1,len(precaution.iloc[c])):
30
  precuation_list.append(precaution.iloc[c,i])
31
+ combined_info = f"The Disease Name: {pred2[0]}\nThe Disease Description: {disp}\nRecommended Things to do at home:"+''.join([f'\n -{i}' for i in precuation_list])
32
+ return combined_info