File size: 1,692 Bytes
438f9b0
 
 
 
 
 
 
 
 
 
2f8bc0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Iris Flower Prediction With MachineLearning
emoji: 🐨
colorFrom: purple
colorTo: blue
sdk: docker
pinned: false
license: apache-2.0
---

# Iris Flower Detection Web Application

This is a simple Flask web application that uses a machine learning model to predict the species of iris flowers based on measurements.

## Files and Structure

- `app.py` - The main Flask application
- `iris_model.pkl` / `new_iris_model.pkl` - The trained machine learning model
- `templates/` - Folder containing HTML templates
  - `form.html` - Input form for flower measurements
  - `result.html` - Page showing prediction results
- `create_new_model.py` - Script to create a fresh model if needed
- `test_app.py` - Script to test the application functionality
- `run_app.bat` - Windows batch file to easily run the application

## How to Run

1. Double-click on `run_app.bat` or run `python app.py` in your terminal
2. Open your web browser and go to http://127.0.0.1:5000
3. Enter the flower measurements and click "Predict Flower Species"

## Sample Measurements

### Iris Setosa

- Sepal Length: 5.1 cm
- Sepal Width: 3.5 cm
- Petal Length: 1.4 cm
- Petal Width: 0.2 cm

### Iris Versicolor

- Sepal Length: 6.0 cm
- Sepal Width: 2.7 cm
- Petal Length: 4.2 cm
- Petal Width: 1.3 cm

### Iris Virginica

- Sepal Length: 6.8 cm
- Sepal Width: 3.0 cm
- Petal Length: 5.5 cm
- Petal Width: 2.1 cm

## Troubleshooting

If you encounter issues:

1. Run `python test_app.py` to verify the model is working correctly
2. Check that you have all the required Python packages installed:
   - Flask
   - scikit-learn
   - joblib
   - numpy
3. Try generating a new model with `python create_new_model.py`