Upload folder using huggingface_hub
Browse files- README.md +53 -0
- metrics.json +32 -0
- model.pkl +3 -0
- scaler.pkl +3 -0
README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- sklearn
|
| 6 |
+
- iris
|
| 7 |
+
- classification
|
| 8 |
+
- random-forest
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# 🌸 Iris Flower Classifier
|
| 12 |
+
|
| 13 |
+
A simple Random Forest classifier trained on the classic Iris dataset.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
| Property | Value |
|
| 18 |
+
|----------------|--------------------------|
|
| 19 |
+
| Algorithm | Random Forest |
|
| 20 |
+
| n_estimators | 100 |
|
| 21 |
+
| Test Accuracy | 0.9000 |
|
| 22 |
+
| Train samples | 120 |
|
| 23 |
+
| Test samples | 30 |
|
| 24 |
+
|
| 25 |
+
## Classes
|
| 26 |
+
|
| 27 |
+
The model predicts one of three Iris species:
|
| 28 |
+
- `setosa`
|
| 29 |
+
- `versicolor`
|
| 30 |
+
- `virginica`
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
import pickle, numpy as np
|
| 36 |
+
|
| 37 |
+
with open("model.pkl", "rb") as f: model = pickle.load(f)
|
| 38 |
+
with open("scaler.pkl", "rb") as f: scaler = pickle.load(f)
|
| 39 |
+
|
| 40 |
+
# sepal length, sepal width, petal length, petal width (all in cm)
|
| 41 |
+
X = np.array([[5.1, 3.5, 1.4, 0.2]])
|
| 42 |
+
X_scaled = scaler.transform(X)
|
| 43 |
+
prediction = model.predict(X_scaled)
|
| 44 |
+
print(prediction) # e.g. [0] → setosa
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Per-class Metrics
|
| 48 |
+
|
| 49 |
+
| Class | Precision | Recall | F1-score |
|
| 50 |
+
|-------------|-----------|--------|----------|
|
| 51 |
+
| setosa | 1.0000 | 1.0000 | 1.0000 |
|
| 52 |
+
| versicolor | 0.8182 | 0.9000 | 0.8571 |
|
| 53 |
+
| virginica | 0.8889 | 0.8000 | 0.8421 |
|
metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"accuracy": 0.9,
|
| 3 |
+
"n_estimators": 100,
|
| 4 |
+
"test_size": 0.2,
|
| 5 |
+
"train_samples": 120,
|
| 6 |
+
"test_samples": 30,
|
| 7 |
+
"class_names": [
|
| 8 |
+
"setosa",
|
| 9 |
+
"versicolor",
|
| 10 |
+
"virginica"
|
| 11 |
+
],
|
| 12 |
+
"per_class": {
|
| 13 |
+
"setosa": {
|
| 14 |
+
"precision": 1.0,
|
| 15 |
+
"recall": 1.0,
|
| 16 |
+
"f1-score": 1.0,
|
| 17 |
+
"support": 10.0
|
| 18 |
+
},
|
| 19 |
+
"versicolor": {
|
| 20 |
+
"precision": 0.8182,
|
| 21 |
+
"recall": 0.9,
|
| 22 |
+
"f1-score": 0.8571,
|
| 23 |
+
"support": 10.0
|
| 24 |
+
},
|
| 25 |
+
"virginica": {
|
| 26 |
+
"precision": 0.8889,
|
| 27 |
+
"recall": 0.8,
|
| 28 |
+
"f1-score": 0.8421,
|
| 29 |
+
"support": 10.0
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
}
|
model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cac5737a705ac8a2a6b932315b9016ff042c7ab01f2587b8aa9b6d2043f364ad
|
| 3 |
+
size 158028
|
scaler.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db51af1cc0506fb08ce30f8a10d82b225c5a370c9b59fed3233ef8392c154794
|
| 3 |
+
size 512
|