Upload folder using huggingface_hub
Browse files- README.md +61 -0
- model.joblib +3 -0
- model_metadata.json +28 -0
- sample_input.json +19 -0
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: sklearn
|
| 3 |
+
tags:
|
| 4 |
+
- sklearn
|
| 5 |
+
- scikit-learn
|
| 6 |
+
- classification
|
| 7 |
+
- wine
|
| 8 |
+
- random-forest
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Wine Classification Model
|
| 12 |
+
|
| 13 |
+
A RandomForestClassifier model trained on the UCI Wine dataset for wine classification.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
- **Model Type**: RandomForestClassifier
|
| 18 |
+
- **Dataset**: UCI Wine Dataset
|
| 19 |
+
- **Number of Features**: 13
|
| 20 |
+
- **Number of Classes**: 3
|
| 21 |
+
- **Classes**: class_0, class_1, class_2
|
| 22 |
+
|
| 23 |
+
## Model Parameters
|
| 24 |
+
|
| 25 |
+
- `n_estimators`: 100
|
| 26 |
+
- `max_depth`: 6
|
| 27 |
+
- `random_state`: 42
|
| 28 |
+
|
| 29 |
+
## Usage
|
| 30 |
+
|
| 31 |
+
### Using Hugging Face Hub
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from huggingface_hub import hf_hub_download
|
| 35 |
+
import joblib
|
| 36 |
+
|
| 37 |
+
# Download and load the model
|
| 38 |
+
model_path = hf_hub_download(repo_id="alirisheh/test1", filename="model.joblib")
|
| 39 |
+
model = joblib.load(model_path)
|
| 40 |
+
|
| 41 |
+
# Make predictions
|
| 42 |
+
predictions = model.predict(X_test)
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
### Using the Hugging Face Inference API
|
| 46 |
+
|
| 47 |
+
You can also use this model with the Hugging Face Inference API once it's deployed.
|
| 48 |
+
|
| 49 |
+
## Training
|
| 50 |
+
|
| 51 |
+
The model was trained on the scikit-learn wine dataset with an 80/20 train/test split.
|
| 52 |
+
|
| 53 |
+
## Evaluation
|
| 54 |
+
|
| 55 |
+
The model achieves high accuracy on the test set. See `model_metadata.json` for detailed metrics.
|
| 56 |
+
|
| 57 |
+
## Files
|
| 58 |
+
|
| 59 |
+
- `model.joblib`: The trained scikit-learn model
|
| 60 |
+
- `model_metadata.json`: Model metadata and training information
|
| 61 |
+
- `sample_input.json`: Sample input for testing
|
model.joblib
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33969f544a65c85b6e962282b35e3c593d45452dcc2f620183b6c98cc5663a1c
|
| 3 |
+
size 213681
|
model_metadata.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "RandomForestClassifier",
|
| 3 |
+
"n_estimators": 100,
|
| 4 |
+
"max_depth": 6,
|
| 5 |
+
"accuracy": 1.0,
|
| 6 |
+
"n_features": 13,
|
| 7 |
+
"n_classes": 3,
|
| 8 |
+
"class_names": [
|
| 9 |
+
"class_0",
|
| 10 |
+
"class_1",
|
| 11 |
+
"class_2"
|
| 12 |
+
],
|
| 13 |
+
"feature_names": [
|
| 14 |
+
"alcohol",
|
| 15 |
+
"malic_acid",
|
| 16 |
+
"ash",
|
| 17 |
+
"alcalinity_of_ash",
|
| 18 |
+
"magnesium",
|
| 19 |
+
"total_phenols",
|
| 20 |
+
"flavanoids",
|
| 21 |
+
"nonflavanoid_phenols",
|
| 22 |
+
"proanthocyanins",
|
| 23 |
+
"color_intensity",
|
| 24 |
+
"hue",
|
| 25 |
+
"od280/od315_of_diluted_wines",
|
| 26 |
+
"proline"
|
| 27 |
+
]
|
| 28 |
+
}
|
sample_input.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sample": [
|
| 3 |
+
13.64,
|
| 4 |
+
3.1,
|
| 5 |
+
2.56,
|
| 6 |
+
15.2,
|
| 7 |
+
116.0,
|
| 8 |
+
2.7,
|
| 9 |
+
3.03,
|
| 10 |
+
0.17,
|
| 11 |
+
1.66,
|
| 12 |
+
5.1,
|
| 13 |
+
0.96,
|
| 14 |
+
3.36,
|
| 15 |
+
845.0
|
| 16 |
+
],
|
| 17 |
+
"expected_class": 0,
|
| 18 |
+
"class_name": "class_0"
|
| 19 |
+
}
|