iris-classification / README.md
Nasywan's picture
Add README.md with Hugging Face configuration
f84b46f
---
title: Iris Flower Classification
emoji: 🌸
colorFrom: blue
colorTo: purple
sdk: docker
sdk_version: "4.36.2"
app_file: app.py
pinned: false
license: mit
---
# 🌸 Iris Flower Classification API
Aplikasi Machine Learning untuk klasifikasi bunga Iris menggunakan Decision Tree Algorithm. API ini dapat memprediksi spesies bunga Iris (Setosa, Versicolor, atau Virginica) berdasarkan fitur morfologi bunga.
## πŸ“Š Dataset & Model
- **Dataset**: Iris Dataset dari scikit-learn
- **Algorithm**: Decision Tree Classifier
- **Features**:
- Sepal Length (cm)
- Sepal Width (cm)
- Petal Length (cm)
- Petal Width (cm)
- **Target Classes**: Setosa, Versicolor, Virginica
## πŸš€ API Endpoints
### 1. Home Page
```
GET /
```
Web interface interaktif untuk testing model
### 2. Predict Species
```
POST /predict
Content-Type: application/json
{
"sepal_length": 5.1,
"sepal_width": 3.5,
"petal_length": 1.4,
"petal_width": 0.2
}
```
### 3. Model Information
```
GET /model-info
```
Informasi detail tentang model dan feature importance
### 4. Health Check
```
GET /health
```
Status kesehatan API
## πŸ§ͺ Example Usage
### Prediksi Setosa:
```json
{
"sepal_length": 5.1,
"sepal_width": 3.5,
"petal_length": 1.4,
"petal_width": 0.2
}
```
### Prediksi Versicolor:
```json
{
"sepal_length": 7.0,
"sepal_width": 3.2,
"petal_length": 4.7,
"petal_width": 1.4
}
```
### Prediksi Virginica:
```json
{
"sepal_length": 6.3,
"sepal_width": 3.3,
"petal_length": 6.0,
"petal_width": 2.5
}
```
## πŸ“ˆ Model Performance
- **Accuracy**: 100% (pada test set)
- **Algorithm**: Decision Tree dengan random_state=42
- **Training Data**: 120 samples
- **Test Data**: 30 samples
## πŸ”— Key Decision Rules
Berdasarkan Decision Tree yang dihasilkan:
1. **Setosa**: Petal Length ≀ 2.45 cm
2. **Versicolor**: Petal Length > 2.45 cm AND Petal Width ≀ 1.75 cm
3. **Virginica**: Petal Length > 2.45 cm AND Petal Width > 1.75 cm
## πŸ› οΈ Technology Stack
- **Backend**: Flask + Python 3.11
- **ML**: scikit-learn, pandas, numpy
- **Model Persistence**: joblib
- **Container**: Docker
- **Deployment**: Hugging Face Spaces
## πŸ‘¨β€πŸ’» Author
Tugas 27 - Machine Learning Model Deployment
**Universitas/Institusi**: Infinite Learning