File size: 1,435 Bytes
8d50e88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
license: mit
tags:
  - sklearn
  - classification
  - iris
  - random-forest
  - tabular
library_name: sklearn
---

# 🌸 Iris Classifier — Random Forest

A simple **Random Forest** classifier trained on the classic
[Iris dataset](https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html).
Deployed automatically via GitHub Actions.

## 📊 Evaluation Results

| Metric | Value |
|---|---|
| Test Accuracy | **0.9333** |
| CV Accuracy (5-fold) | **0.9667 ± 0.0211** |
| Train samples | 120 |
| Test samples | 30 |

## 🏗️ Model Details

| Parameter | Value |
|---|---|
| Algorithm | Random Forest |
| n_estimators | 100 |
| max_depth | 5 |

## 📥 Usage

```python
import pickle, requests, numpy as np
from huggingface_hub import hf_hub_download

# Download model
model_path = hf_hub_download(repo_id="YOUR_HF_USERNAME/iris-classifier", filename="iris_classifier.pkl")
with open(model_path, "rb") as f:
    model = pickle.load(f)

# Predict  (sepal length, sepal width, petal length, petal width)
sample = np.array([[5.1, 3.5, 1.4, 0.2]])
prediction = model.predict(sample)
class_names = ['setosa', 'versicolor', 'virginica']
print(class_names[prediction[0]])  # -> 'setosa'
```

## 📋 Features

The model uses 4 features:
- `sepal length (cm)`
- `sepal width (cm)`
- `petal length (cm)`
- `petal width (cm)`

## 🏷️ Classes

`setosa`, `versicolor`, `virginica`

---
*Last trained: 2026-03-10*