Alindstroem89
commited on
Commit
•
8857962
1
Parent(s):
a7b6bda
Version 1
Browse files- README.md +217 -0
- config.json +161 -0
- confusion_matrix.png +0 -0
- stroke_model.pkl +3 -0
README.md
ADDED
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: sklearn
|
3 |
+
tags:
|
4 |
+
- sklearn
|
5 |
+
- skops
|
6 |
+
- tabular-classification
|
7 |
+
model_format: pickle
|
8 |
+
model_file: stroke_model.pkl
|
9 |
+
widget:
|
10 |
+
- structuredData:
|
11 |
+
Residence_type_Rural:
|
12 |
+
- true
|
13 |
+
- true
|
14 |
+
- false
|
15 |
+
Residence_type_Urban:
|
16 |
+
- false
|
17 |
+
- false
|
18 |
+
- true
|
19 |
+
age:
|
20 |
+
- 0.15771484375
|
21 |
+
- 0.7802734375
|
22 |
+
- 0.31640625
|
23 |
+
avg_glucose_level:
|
24 |
+
- 0.24563752192779986
|
25 |
+
- 0.3366263502908319
|
26 |
+
- 0.04413258240236362
|
27 |
+
avg_glucose_level/bmi:
|
28 |
+
- 0.35152096177583636
|
29 |
+
- 0.18922222093200816
|
30 |
+
- 0.12391183202584002
|
31 |
+
bmi:
|
32 |
+
- 0.10487444608567206
|
33 |
+
- 0.35007385524372225
|
34 |
+
- 0.1920236336779911
|
35 |
+
ever_married_No:
|
36 |
+
- true
|
37 |
+
- false
|
38 |
+
- true
|
39 |
+
ever_married_Yes:
|
40 |
+
- false
|
41 |
+
- true
|
42 |
+
- false
|
43 |
+
gender_Female:
|
44 |
+
- false
|
45 |
+
- true
|
46 |
+
- false
|
47 |
+
gender_Male:
|
48 |
+
- true
|
49 |
+
- false
|
50 |
+
- true
|
51 |
+
gender_Other:
|
52 |
+
- false
|
53 |
+
- false
|
54 |
+
- false
|
55 |
+
heart_disease_No:
|
56 |
+
- true
|
57 |
+
- true
|
58 |
+
- true
|
59 |
+
heart_disease_Yes:
|
60 |
+
- false
|
61 |
+
- false
|
62 |
+
- false
|
63 |
+
hypertension_No:
|
64 |
+
- true
|
65 |
+
- true
|
66 |
+
- true
|
67 |
+
hypertension_Yes:
|
68 |
+
- false
|
69 |
+
- false
|
70 |
+
- false
|
71 |
+
smoking_status_Unknown:
|
72 |
+
- false
|
73 |
+
- false
|
74 |
+
- false
|
75 |
+
smoking_status_formerly smoked:
|
76 |
+
- false
|
77 |
+
- false
|
78 |
+
- false
|
79 |
+
smoking_status_never smoked:
|
80 |
+
- true
|
81 |
+
- false
|
82 |
+
- false
|
83 |
+
smoking_status_smokes:
|
84 |
+
- false
|
85 |
+
- true
|
86 |
+
- true
|
87 |
+
work_type_Govt_job:
|
88 |
+
- false
|
89 |
+
- false
|
90 |
+
- false
|
91 |
+
work_type_Never_worked:
|
92 |
+
- false
|
93 |
+
- false
|
94 |
+
- false
|
95 |
+
work_type_Private:
|
96 |
+
- false
|
97 |
+
- false
|
98 |
+
- true
|
99 |
+
work_type_Self-employed:
|
100 |
+
- false
|
101 |
+
- true
|
102 |
+
- false
|
103 |
+
work_type_children:
|
104 |
+
- true
|
105 |
+
- false
|
106 |
+
- false
|
107 |
+
---
|
108 |
+
|
109 |
+
# Model description
|
110 |
+
|
111 |
+
The model is intended to be used to predict if a person is likely to get a stroke or not
|
112 |
+
|
113 |
+
## Intended uses & limitations
|
114 |
+
|
115 |
+
[More Information Needed]
|
116 |
+
|
117 |
+
## Training Procedure
|
118 |
+
|
119 |
+
[More Information Needed]
|
120 |
+
|
121 |
+
### Hyperparameters
|
122 |
+
|
123 |
+
<details>
|
124 |
+
<summary> Click to expand </summary>
|
125 |
+
|
126 |
+
| Hyperparameter | Value |
|
127 |
+
|-------------------------|---------------------|
|
128 |
+
| objective | binary:logistic |
|
129 |
+
| base_score | |
|
130 |
+
| booster | |
|
131 |
+
| callbacks | |
|
132 |
+
| colsample_bylevel | 0.9076228511174643 |
|
133 |
+
| colsample_bynode | |
|
134 |
+
| colsample_bytree | 0.8045246933821307 |
|
135 |
+
| device | |
|
136 |
+
| early_stopping_rounds | |
|
137 |
+
| enable_categorical | False |
|
138 |
+
| eval_metric | |
|
139 |
+
| feature_types | |
|
140 |
+
| gamma | |
|
141 |
+
| grow_policy | |
|
142 |
+
| importance_type | |
|
143 |
+
| interaction_constraints | |
|
144 |
+
| learning_rate | 0.0711965541329635 |
|
145 |
+
| max_bin | |
|
146 |
+
| max_cat_threshold | |
|
147 |
+
| max_cat_to_onehot | |
|
148 |
+
| max_delta_step | |
|
149 |
+
| max_depth | |
|
150 |
+
| max_leaves | 4 |
|
151 |
+
| min_child_weight | 0.27994747825685384 |
|
152 |
+
| missing | nan |
|
153 |
+
| monotone_constraints | |
|
154 |
+
| multi_strategy | |
|
155 |
+
| n_estimators | 35 |
|
156 |
+
| n_jobs | |
|
157 |
+
| num_parallel_tree | |
|
158 |
+
| random_state | |
|
159 |
+
| reg_alpha | 0.0009765625 |
|
160 |
+
| reg_lambda | 2.991485993669717 |
|
161 |
+
| sampling_method | |
|
162 |
+
| scale_pos_weight | |
|
163 |
+
| subsample | 0.8073913094722203 |
|
164 |
+
| tree_method | |
|
165 |
+
| validate_parameters | |
|
166 |
+
| verbosity | |
|
167 |
+
|
168 |
+
</details>
|
169 |
+
|
170 |
+
### Model Plot
|
171 |
+
|
172 |
+
<style>#sk-container-id-23 {color: black;}#sk-container-id-23 pre{padding: 0;}#sk-container-id-23 div.sk-toggleable {background-color: white;}#sk-container-id-23 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-23 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-23 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-23 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-23 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-23 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-23 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-23 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-container-id-23 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-23 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-23 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-23 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-23 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-23 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-23 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-23 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-23 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-23 div.sk-item {position: relative;z-index: 1;}#sk-container-id-23 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-23 div.sk-item::before, #sk-container-id-23 div.sk-parallel-item::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-23 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-23 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-23 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-23 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-23 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-23 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-23 div.sk-label-container {text-align: center;}#sk-container-id-23 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-23 div.sk-text-repr-fallback {display: none;}</style><div id="sk-container-id-23" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>XGBClassifier(base_score=None, booster=None, callbacks=None,colsample_bylevel=0.9076228511174643, colsample_bynode=None,colsample_bytree=0.8045246933821307, device=None,early_stopping_rounds=None, enable_categorical=False,eval_metric=None, feature_types=None, gamma=None,grow_policy=None, importance_type=None,interaction_constraints=None, learning_rate=0.0711965541329635,max_bin=None, max_cat_threshold=None, max_cat_to_onehot=None,max_delta_step=None, max_depth=None, max_leaves=4,min_child_weight=0.27994747825685384, missing=nan,monotone_constraints=None, multi_strategy=None, n_estimators=35,n_jobs=None, num_parallel_tree=None, random_state=None, ...)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class="sk-container" hidden><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-23" type="checkbox" checked><label for="sk-estimator-id-23" class="sk-toggleable__label sk-toggleable__label-arrow">XGBClassifier</label><div class="sk-toggleable__content"><pre>XGBClassifier(base_score=None, booster=None, callbacks=None,colsample_bylevel=0.9076228511174643, colsample_bynode=None,colsample_bytree=0.8045246933821307, device=None,early_stopping_rounds=None, enable_categorical=False,eval_metric=None, feature_types=None, gamma=None,grow_policy=None, importance_type=None,interaction_constraints=None, learning_rate=0.0711965541329635,max_bin=None, max_cat_threshold=None, max_cat_to_onehot=None,max_delta_step=None, max_depth=None, max_leaves=4,min_child_weight=0.27994747825685384, missing=nan,monotone_constraints=None, multi_strategy=None, n_estimators=35,n_jobs=None, num_parallel_tree=None, random_state=None, ...)</pre></div></div></div></div></div>
|
173 |
+
|
174 |
+
## Evaluation Results
|
175 |
+
|
176 |
+
| Metric | Value |
|
177 |
+
|----------|---------|
|
178 |
+
| accuracy | 0.78 |
|
179 |
+
|
180 |
+
### Confusion Matrix
|
181 |
+
|
182 |
+
![Confusion Matrix](confusion_matrix.png)
|
183 |
+
|
184 |
+
# How to Get Started with the Model
|
185 |
+
|
186 |
+
[More Information Needed]
|
187 |
+
|
188 |
+
# Model Card Authors
|
189 |
+
|
190 |
+
Alexander Lindström
|
191 |
+
|
192 |
+
# Model Card Contact
|
193 |
+
|
194 |
+
You can contact the model card authors through following channels:
|
195 |
+
[More Information Needed]
|
196 |
+
|
197 |
+
# Citation
|
198 |
+
|
199 |
+
Below you can find information related to citation.
|
200 |
+
|
201 |
+
**BibTeX:**
|
202 |
+
```
|
203 |
+
[More Information Needed]
|
204 |
+
```
|
205 |
+
|
206 |
+
# precision recall f1-score support
|
207 |
+
|
208 |
+
class 0 0.98 0.78 0.87 960
|
209 |
+
class 1 0.18 0.76 0.29 62
|
210 |
+
|
211 |
+
accuracy 0.78 1022
|
212 |
+
macro avg 0.58 0.77 0.58 1022
|
213 |
+
weighted avg 0.93 0.78 0.83 1022
|
214 |
+
|
215 |
+
| Metric | Value |
|
216 |
+
|----------|---------|
|
217 |
+
| accuracy | 0.78 |
|
config.json
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"sklearn": {
|
3 |
+
"columns": [
|
4 |
+
"age",
|
5 |
+
"avg_glucose_level",
|
6 |
+
"bmi",
|
7 |
+
"gender_Female",
|
8 |
+
"gender_Male",
|
9 |
+
"gender_Other",
|
10 |
+
"hypertension_No",
|
11 |
+
"hypertension_Yes",
|
12 |
+
"heart_disease_No",
|
13 |
+
"heart_disease_Yes",
|
14 |
+
"ever_married_No",
|
15 |
+
"ever_married_Yes",
|
16 |
+
"work_type_Govt_job",
|
17 |
+
"work_type_Never_worked",
|
18 |
+
"work_type_Private",
|
19 |
+
"work_type_Self-employed",
|
20 |
+
"work_type_children",
|
21 |
+
"Residence_type_Rural",
|
22 |
+
"Residence_type_Urban",
|
23 |
+
"smoking_status_Unknown",
|
24 |
+
"smoking_status_formerly smoked",
|
25 |
+
"smoking_status_never smoked",
|
26 |
+
"smoking_status_smokes",
|
27 |
+
"avg_glucose_level/bmi"
|
28 |
+
],
|
29 |
+
"environment": [
|
30 |
+
"scikit-learn=1.3.2"
|
31 |
+
],
|
32 |
+
"example_input": {
|
33 |
+
"Residence_type_Rural": [
|
34 |
+
true,
|
35 |
+
true,
|
36 |
+
false
|
37 |
+
],
|
38 |
+
"Residence_type_Urban": [
|
39 |
+
false,
|
40 |
+
false,
|
41 |
+
true
|
42 |
+
],
|
43 |
+
"age": [
|
44 |
+
0.15771484375,
|
45 |
+
0.7802734375,
|
46 |
+
0.31640625
|
47 |
+
],
|
48 |
+
"avg_glucose_level": [
|
49 |
+
0.24563752192779986,
|
50 |
+
0.3366263502908319,
|
51 |
+
0.04413258240236362
|
52 |
+
],
|
53 |
+
"avg_glucose_level/bmi": [
|
54 |
+
0.35152096177583636,
|
55 |
+
0.18922222093200816,
|
56 |
+
0.12391183202584002
|
57 |
+
],
|
58 |
+
"bmi": [
|
59 |
+
0.10487444608567206,
|
60 |
+
0.35007385524372225,
|
61 |
+
0.1920236336779911
|
62 |
+
],
|
63 |
+
"ever_married_No": [
|
64 |
+
true,
|
65 |
+
false,
|
66 |
+
true
|
67 |
+
],
|
68 |
+
"ever_married_Yes": [
|
69 |
+
false,
|
70 |
+
true,
|
71 |
+
false
|
72 |
+
],
|
73 |
+
"gender_Female": [
|
74 |
+
false,
|
75 |
+
true,
|
76 |
+
false
|
77 |
+
],
|
78 |
+
"gender_Male": [
|
79 |
+
true,
|
80 |
+
false,
|
81 |
+
true
|
82 |
+
],
|
83 |
+
"gender_Other": [
|
84 |
+
false,
|
85 |
+
false,
|
86 |
+
false
|
87 |
+
],
|
88 |
+
"heart_disease_No": [
|
89 |
+
true,
|
90 |
+
true,
|
91 |
+
true
|
92 |
+
],
|
93 |
+
"heart_disease_Yes": [
|
94 |
+
false,
|
95 |
+
false,
|
96 |
+
false
|
97 |
+
],
|
98 |
+
"hypertension_No": [
|
99 |
+
true,
|
100 |
+
true,
|
101 |
+
true
|
102 |
+
],
|
103 |
+
"hypertension_Yes": [
|
104 |
+
false,
|
105 |
+
false,
|
106 |
+
false
|
107 |
+
],
|
108 |
+
"smoking_status_Unknown": [
|
109 |
+
false,
|
110 |
+
false,
|
111 |
+
false
|
112 |
+
],
|
113 |
+
"smoking_status_formerly smoked": [
|
114 |
+
false,
|
115 |
+
false,
|
116 |
+
false
|
117 |
+
],
|
118 |
+
"smoking_status_never smoked": [
|
119 |
+
true,
|
120 |
+
false,
|
121 |
+
false
|
122 |
+
],
|
123 |
+
"smoking_status_smokes": [
|
124 |
+
false,
|
125 |
+
true,
|
126 |
+
true
|
127 |
+
],
|
128 |
+
"work_type_Govt_job": [
|
129 |
+
false,
|
130 |
+
false,
|
131 |
+
false
|
132 |
+
],
|
133 |
+
"work_type_Never_worked": [
|
134 |
+
false,
|
135 |
+
false,
|
136 |
+
false
|
137 |
+
],
|
138 |
+
"work_type_Private": [
|
139 |
+
false,
|
140 |
+
false,
|
141 |
+
true
|
142 |
+
],
|
143 |
+
"work_type_Self-employed": [
|
144 |
+
false,
|
145 |
+
true,
|
146 |
+
false
|
147 |
+
],
|
148 |
+
"work_type_children": [
|
149 |
+
true,
|
150 |
+
false,
|
151 |
+
false
|
152 |
+
]
|
153 |
+
},
|
154 |
+
"model": {
|
155 |
+
"file": "stroke_model.pkl"
|
156 |
+
},
|
157 |
+
"model_format": "pickle",
|
158 |
+
"task": "tabular-classification",
|
159 |
+
"use_intelex": false
|
160 |
+
}
|
161 |
+
}
|
confusion_matrix.png
ADDED
stroke_model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:02a05520f2f7eb81068bdd3f56e092596025cb61700c1aed9025655922b3bf45
|
3 |
+
size 36557
|