File size: 1,257 Bytes
f168f53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: en
license: mit
tags:
  - sklearn
  - iris
  - classification
  - random-forest
---

# 🌸 Iris Flower Classifier

A simple Random Forest classifier trained on the classic Iris dataset.

## Model Details

| Property       | Value                    |
|----------------|--------------------------|
| Algorithm      | Random Forest            |
| n_estimators   | 100           |
| Test Accuracy  | 0.9000           |
| Train samples  | 120           |
| Test samples   | 30            |

## Classes

The model predicts one of three Iris species:
- `setosa`
- `versicolor`
- `virginica`

## Usage

```python
import pickle, numpy as np

with open("model.pkl",  "rb") as f: model  = pickle.load(f)
with open("scaler.pkl", "rb") as f: scaler = pickle.load(f)

# sepal length, sepal width, petal length, petal width  (all in cm)
X = np.array([[5.1, 3.5, 1.4, 0.2]])
X_scaled = scaler.transform(X)
prediction = model.predict(X_scaled)
print(prediction)   # e.g. [0]  →  setosa
```

## Per-class Metrics

| Class       | Precision | Recall | F1-score |
|-------------|-----------|--------|----------|
| setosa      | 1.0000    | 1.0000 | 1.0000    |
| versicolor  | 0.8182    | 0.9000 | 0.8571    |
| virginica   | 0.8889    | 0.8000 | 0.8421    |