Spaces:
Sleeping
Sleeping
metadata
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:
{
"sepal_length": 5.1,
"sepal_width": 3.5,
"petal_length": 1.4,
"petal_width": 0.2
}
Prediksi Versicolor:
{
"sepal_length": 7.0,
"sepal_width": 3.2,
"petal_length": 4.7,
"petal_width": 1.4
}
Prediksi Virginica:
{
"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:
- Setosa: Petal Length β€ 2.45 cm
- Versicolor: Petal Length > 2.45 cm AND Petal Width β€ 1.75 cm
- 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