priyanka17 commited on
Commit
dd720eb
1 Parent(s): 34c090e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +218 -0
README.md ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - duxprajapati/symptom-disease-dataset
4
+ language:
5
+ - en
6
+ metrics:
7
+ - accuracy
8
+ - f1
9
+ pipeline_tag: text-classification
10
+ ---
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+ This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
16
+
17
+ ## Model Details
18
+
19
+ ### Model Description
20
+
21
+ A predictive machine learning model was developed that can classify data points into distinct categories based on symptoms using diseases data.
22
+
23
+
24
+
25
+ - Developed by: Priyanka Kamila
26
+ - **Funded by [optional]:** [More Information Needed]
27
+ - **Shared by [optional]:** [More Information Needed]
28
+ - Model type: RandomForestClassifier, SVC
29
+ - Language(s) (NLP): EN
30
+ - **License:** [More Information Needed]
31
+ - **Finetuned from model [optional]:** [More Information Needed]
32
+
33
+
34
+ ## Uses
35
+
36
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
37
+
38
+ ### Direct Use
39
+
40
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
41
+
42
+ This model can be directly used for disease diagnosis based on binary encoded medical features. By inputting patient symptoms in the form of binary vectors, the model predicts the likely medical condition. Here’s how you can utilize the model:
43
+
44
+ ####Prepare Input Data:
45
+
46
+ Ensure that the input data is formatted as a binary matrix, where each row represents a patient and each column represents a symptom or feature.
47
+ The target variable should be a categorical label representing the medical condition.
48
+ Load the Model:
49
+
50
+ Load the trained Random Forest Classifier or SVM Classifier from the repository.
51
+ You can use libraries like joblib or pickle in Python to load the pre-trained model.
52
+
53
+ ####Make Predictions:
54
+
55
+ Use the loaded model to make predictions on new input data.
56
+ For instance, in Python:
57
+ python
58
+ Copy code
59
+ import joblib
60
+ model = joblib.load('path_to_model.pkl')
61
+ predictions = model.predict(new_input_data)
62
+
63
+ ####Interpret Results:
64
+
65
+ The model will output the predicted medical condition for each input row.
66
+ These predictions can be used by healthcare professionals to assist in diagnosing patients.
67
+
68
+
69
+ Example Usage:
70
+
71
+ Suppose you have a new patient’s symptom data in binary format:
72
+ python
73
+ Copy code
74
+ new_patient_data = [0, 1, 0, 1, ..., 0] # Example binary vector for a new patient
75
+ prediction = model.predict([new_patient_data])
76
+ print("Predicted Condition:", prediction[0])
77
+ This model is intended for direct use in clinical decision support systems or healthcare applications where quick
78
+ and accurate disease diagnosis is critical. It can be integrated into electronic health records (EHR) systems, patient management software,
79
+ or used as a standalone diagnostic tool.
80
+
81
+ [More Information Needed]
82
+
83
+ ### Downstream Use [optional]
84
+
85
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
86
+
87
+ [More Information Needed]
88
+
89
+ ### Out-of-Scope Use
90
+
91
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
92
+
93
+ This model is designed specifically for diagnosing diseases based on binary encoded medical features. It is important to recognize the limitations and
94
+ potential misuse of the model:
95
+
96
+ Non-Medical Applications:
97
+
98
+ The model is not suitable for non-medical applications or any use cases outside of healthcare diagnostics.
99
+ Using this model for unrelated classification tasks will yield inaccurate and irrelevant results.
100
+
101
+ Incomplete or Inaccurate Input Data:
102
+
103
+ The model relies on precise binary encoding of medical symptoms. Providing incomplete, inaccurate, or improperly formatted data can lead to incorrect diagnoses.
104
+ It is crucial to ensure that input data is complete and correctly formatted according to the binary encoding schema used during model training.
105
+
106
+ Real-Time Critical Decisions:
107
+
108
+ While the model can aid in diagnosis, it should not be solely relied upon for real-time critical medical decisions without human oversight.
109
+ Healthcare professionals should verify the model’s predictions and consider additional clinical information and diagnostics before making final decisions.
110
+
111
+ Malicious Use:
112
+
113
+ The model should not be used to intentionally misdiagnose or manipulate medical diagnoses for fraudulent purposes.
114
+ Ensuring ethical use of the model is paramount, and it should only be used to assist in improving patient care.
115
+ ###Diagnostic Scope Limitation:
116
+
117
+ The model is trained on specific diseases included in the dataset. It may not perform well in diagnosing conditions outside the scope of its training data.
118
+ For diseases not represented in the training data, the model might default to predicting "other," which should be interpreted with caution.
119
+
120
+ General Population Screening:
121
+
122
+ This model is not intended for general population screening or predicting disease prevalence in broad, non-clinical populations.
123
+ It is designed for use with patients already presenting symptoms or those in a clinical setting.
124
+ By understanding these limitations and potential misuse scenarios, users can ensure that the model is applied appropriately and ethically in relevant healthcare contexts.
125
+
126
+
127
+ ## Training Details
128
+
129
+ ### Training Data
130
+
131
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
132
+
133
+ The training data used for this model consists of a custom dataset with binary encoded medical features. Each row in the dataset represents a patient's symptoms encoded as binary values, and the corresponding label represents the diagnosed disease. The dataset includes a wide range of medical conditions, with the aim of providing a comprehensive diagnostic tool.
134
+
135
+ Source of Data:
136
+
137
+ The dataset was compiled from https://huggingface.co/datasets/duxprajapati/symptom-disease-dataset from huggingface
138
+ which was then processed in terms of data-labeling using Smabbler's QueryLab platform ensuring a accurate representation of data-labels for common and rare diseases.
139
+
140
+
141
+ Pre-processing:
142
+
143
+ Data was pre-processed to ensure consistency and accuracy. This involved cleaning the data, handling missing values, and normalizing the binary encoding.
144
+ Each symptom was converted into a binary feature (0 or 1), indicating its absence or presence respectively.
145
+ The labels were mapped to specific diseases using a detailed mapping file to ensure accurate representation.
146
+
147
+ Label Mapping:
148
+
149
+ The labels in the dataset correspond to various diseases. A mapping file (mapping.json) was used to translate encoded labels to human-readable disease names.
150
+ Top labels include diseases like Psoriasis, Malaria, Bronchial Asthma, Dengue, Arthritis, Heart Attack, and many more.
151
+
152
+ Additional Documentation:
153
+
154
+ Detailed documentation on data pre-processing and filtering steps is provided to ensure reproducibility and transparency.
155
+ The dataset card includes information on the data sources, pre-processing steps, and any additional filtering or transformations applied.
156
+
157
+ ### Training Procedure
158
+
159
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
160
+
161
+ The training procedure for this model involves several key steps to ensure robust and accurate disease diagnosis using Random Forest and SVM classifiers. Below are the detailed steps and technical specifications related to the training procedure:
162
+
163
+ Data Splitting:
164
+
165
+ The dataset was split into training and testing sets using an 80-20 split ratio.
166
+ The training set was used to train the classifiers, while the testing set was used to evaluate the model’s performance.
167
+ Feature Selection:
168
+
169
+ Binary encoded features representing the presence or absence of symptoms were selected as input features.
170
+ The target variable was the disease label, which was mapped from encoded integers to human-readable disease names.
171
+ Model Initialization:
172
+
173
+ Two classifiers were initialized: Random Forest Classifier and Support Vector Machine (SVM) Classifier.
174
+ Both classifiers were initialized with default parameters and a fixed random state to ensure reproducibility.
175
+
176
+ Training the Models:
177
+
178
+ Random Forest Classifier:
179
+ The Random Forest model was trained on the training data using the fit method.
180
+ Hyperparameters such as the number of trees and depth were tuned to optimize performance.
181
+ SVM Classifier:
182
+ The SVM model was similarly trained using the fit method.
183
+ Kernel type, regularization parameters, and other hyperparameters were adjusted for optimal classification.
184
+
185
+
186
+
187
+ ## Evaluation
188
+
189
+ <!-- This section describes the evaluation protocols and provides the results. -->
190
+
191
+ The performance of both models was evaluated on the testing set.
192
+ Metrics such as accuracy, precision, recall, and f1-score were calculated to assess model performance.
193
+ Confusion matrices were generated to visualize the performance of each classifier in predicting the correct disease labels.
194
+
195
+
196
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6682b3f72b1f40e83883f999/zzVYejajU3qtj6dlDUS6g.png)
197
+
198
+
199
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6682b3f72b1f40e83883f999/yK7UpL0dtCGz8Nq3q2ylN.png)
200
+
201
+
202
+
203
+ ### Results
204
+
205
+
206
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6682b3f72b1f40e83883f999/58ZffNH4K8hgweNRqAHMC.png)
207
+
208
+ #### Summary
209
+
210
+ This model utilizes both Random Forest and SVM classifiers to accurately diagnose a variety of diseases based on binary encoded medical features.
211
+ The training involved data pre-processing, feature selection, model training,
212
+ and extensive evaluation to ensure reliability. Designed for healthcare applications,
213
+ it aids professionals in making informed diagnostic decisions efficiently.
214
+
215
+
216
+ ## Model Card Authors
217
+
218
+ Priyanka Kamila