Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/config-checkpoint.json +51 -0
- README.md +43 -28
.ipynb_checkpoints/config-checkpoint.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sklearn": {
|
| 3 |
+
"columns": [
|
| 4 |
+
"Age",
|
| 5 |
+
"Height",
|
| 6 |
+
"Weight",
|
| 7 |
+
"FCVC",
|
| 8 |
+
"NCP",
|
| 9 |
+
"CH2O",
|
| 10 |
+
"FAF",
|
| 11 |
+
"TUE",
|
| 12 |
+
"cluster2"
|
| 13 |
+
],
|
| 14 |
+
"environment": [
|
| 15 |
+
"scikit-learn=1.3.0"
|
| 16 |
+
],
|
| 17 |
+
"example_input": {
|
| 18 |
+
"Age": [
|
| 19 |
+
25
|
| 20 |
+
],
|
| 21 |
+
"Height": [
|
| 22 |
+
1.7
|
| 23 |
+
],
|
| 24 |
+
"Weight": [
|
| 25 |
+
68
|
| 26 |
+
],
|
| 27 |
+
"FCVC": [
|
| 28 |
+
2
|
| 29 |
+
],
|
| 30 |
+
"NCP": [
|
| 31 |
+
3
|
| 32 |
+
],
|
| 33 |
+
"CH2O": [
|
| 34 |
+
2
|
| 35 |
+
],
|
| 36 |
+
"FAF": [
|
| 37 |
+
1
|
| 38 |
+
],
|
| 39 |
+
"TUE": [
|
| 40 |
+
1
|
| 41 |
+
],
|
| 42 |
+
"cluster2": [
|
| 43 |
+
0
|
| 44 |
+
]
|
| 45 |
+
},
|
| 46 |
+
"model": {
|
| 47 |
+
"file": "model.pkl"
|
| 48 |
+
},
|
| 49 |
+
"task": "tabular-classification"
|
| 50 |
+
}
|
| 51 |
+
}
|
README.md
CHANGED
|
@@ -1,38 +1,15 @@
|
|
| 1 |
-
|
| 2 |
-
tags:
|
| 3 |
-
- sklearn
|
| 4 |
-
- classification
|
| 5 |
-
- decision-tree
|
| 6 |
-
- obesity
|
| 7 |
-
- health
|
| 8 |
-
license: mit
|
| 9 |
-
model-index:
|
| 10 |
-
- name: obesity-classification
|
| 11 |
-
results: []
|
| 12 |
-
---
|
| 13 |
# Model description
|
| 14 |
|
| 15 |
This model is a decision tree classifier trained to predict obesity levels based on demographic, lifestyle, and diet-related features. The dataset includes variables including age, height, weight, caloric food intake, physical activity, water consumption, smoking behavior, and transportation habits. The target label is the obesity category, which includes seven classes ranging from Insufficient_Weight to Obesity_Type_III. The decision tree originally had 12 layers which was cut down (pruned) to improve interpretability and reduce overfitting.
|
| 16 |
|
| 17 |
## Intended uses & limitations
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
# Evaluation Results
|
| 22 |
-
|
| 23 |
-
The model achieves approximately 87% accuracy. Its performance is strongest on more distinct obesity categories and weaker on categories that are closer together. A more complex model could lead to higher accuracy, but it would be less interpretable and harder to present to medical professionals. I would trust this model as a decision-support tool, but not as the sole basis for medical diagnosis because it can make mistakes. This model as a supportive screening tool, and would be beneficial to flag individuals who need to change their lifestyle habits.
|
| 24 |
|
| 25 |
-
#
|
| 26 |
|
| 27 |
-
|
| 28 |
-
from skops.io import load
|
| 29 |
-
model = load('model.skops')
|
| 30 |
-
predictions = model.predict(X)
|
| 31 |
-
```
|
| 32 |
-
|
| 33 |
-
# Model Card Authors
|
| 34 |
-
|
| 35 |
-
Kayleigh Carley
|
| 36 |
|
| 37 |
### Hyperparameters
|
| 38 |
|
|
@@ -137,10 +114,48 @@ div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,
|
|
| 137 |
}
|
| 138 |
</style><div id="sk-container-id-2" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>DecisionTreeClassifier(max_depth=6)</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 fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-2" type="checkbox" checked><label for="sk-estimator-id-2" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted"> DecisionTreeClassifier<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.4/modules/generated/sklearn.tree.DecisionTreeClassifier.html">?<span>Documentation for DecisionTreeClassifier</span></a><span class="sk-estimator-doc-link fitted">i<span>Fitted</span></span></label><div class="sk-toggleable__content fitted"><pre>DecisionTreeClassifier(max_depth=6)</pre></div> </div></div></div></div>
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
## Figures
|
| 141 |
|
| 142 |
### Confusion Matrix
|
|
|
|
| 143 |

|
| 144 |
|
| 145 |
### Decision Tree
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
# Model description
|
| 3 |
|
| 4 |
This model is a decision tree classifier trained to predict obesity levels based on demographic, lifestyle, and diet-related features. The dataset includes variables including age, height, weight, caloric food intake, physical activity, water consumption, smoking behavior, and transportation habits. The target label is the obesity category, which includes seven classes ranging from Insufficient_Weight to Obesity_Type_III. The decision tree originally had 12 layers which was cut down (pruned) to improve interpretability and reduce overfitting.
|
| 5 |
|
| 6 |
## Intended uses & limitations
|
| 7 |
|
| 8 |
+
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
## Training Procedure
|
| 11 |
|
| 12 |
+
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
### Hyperparameters
|
| 15 |
|
|
|
|
| 114 |
}
|
| 115 |
</style><div id="sk-container-id-2" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>DecisionTreeClassifier(max_depth=6)</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 fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-2" type="checkbox" checked><label for="sk-estimator-id-2" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted"> DecisionTreeClassifier<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.4/modules/generated/sklearn.tree.DecisionTreeClassifier.html">?<span>Documentation for DecisionTreeClassifier</span></a><span class="sk-estimator-doc-link fitted">i<span>Fitted</span></span></label><div class="sk-toggleable__content fitted"><pre>DecisionTreeClassifier(max_depth=6)</pre></div> </div></div></div></div>
|
| 116 |
|
| 117 |
+
## Evaluation Results
|
| 118 |
+
|
| 119 |
+
[More Information Needed]
|
| 120 |
+
|
| 121 |
## Figures
|
| 122 |
|
| 123 |
### Confusion Matrix
|
| 124 |
+
|
| 125 |

|
| 126 |
|
| 127 |
### Decision Tree
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
|
| 131 |
+
# How to Get Started with the Model
|
| 132 |
+
|
| 133 |
+
```python
|
| 134 |
+
from huggingface_hub import hf_hub_download
|
| 135 |
+
import skops.io as sio
|
| 136 |
+
hf_hub_download(repo_id='CSC310-fall25/obesity-classification', filename='model.pkl', local_dir='.')
|
| 137 |
+
dt_loaded = sio.load('model.pkl')
|
| 138 |
+
# X must contain the same feature columns used during training
|
| 139 |
+
predictions = dt_loaded.predict(X)
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
# Model Card Authors
|
| 143 |
+
|
| 144 |
+
Kayleigh Carley
|
| 145 |
+
|
| 146 |
+
# Model Card Contact
|
| 147 |
+
|
| 148 |
+
kayleigh.carley@uri.edu
|
| 149 |
+
|
| 150 |
+
# Citation
|
| 151 |
+
|
| 152 |
+
The Estimation of Obesity Levels Based On Eating Habits and Physical Condition was found on the UCI Machin Learning Repo
|
| 153 |
+
https://archive.ics.uci.edu/dataset/544/estimation+of+obesity+levels+based+on+eating+habits+and+physical+condition
|
| 154 |
+
|
| 155 |
+
# Intended uses & limitations
|
| 156 |
+
|
| 157 |
+
The intended use fot his model is educational use, possible tool for exploring health data, research, classification and interpretability techniques. The model performs very well for higher risk categories, but is less accurate for lower risk catergories. The model is Not intended for actual medical diagnosis or treatment decisions. Limitations include that normal-weight and neighboring overweight classes overlap, making them harder to classify. The data is also self-reported, which may lead to bias or inaccuracies.
|
| 158 |
+
|
| 159 |
+
# Evaluation Results
|
| 160 |
+
|
| 161 |
+
The model achieves approximately 87% accuracy. Its performance is strongest on more distinct obesity categories and weaker on categories that are closer together. A more complex model could lead to higher accuracy, but it would be less interpretable and harder to present to medical professionals. I would trust this model as a decision-support tool, but not as the sole basis for medical diagnosis because it can make mistakes. This model as a supportive screening tool, and would be beneficial to flag individuals who need to change their lifestyle habits.
|