Downloads · 30 days
0
Sonia2k5/decision_tree_flower
decision_tree_flower is a machine learning model from Sonia2k5. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Jul 14, 2025
Repo size
3.2 KB
Likes
0
Public
Click a slice to open those files.
.pkl3.2 KB · 40%
From the Hugging Face model README
🌸 Iris Flower Species Predictor
This is a simple yet effective machine learning model that predicts the species of an Iris flower (setosa, versicolor, or virginica) using four key features:
The model is built using a Decision Tree Classifier from scikit-learn, trained on the classic Iris dataset.
Model Overview
sklearn.datasets.load_iris()How to Use
Input
You need to provide these four numerical inputs:
| Feature | Type | Example |
|---|---|---|
| Sepal length | Float | 5.1 |
| Sepal width | Float | 3.5 |
| Petal length | Float | 1.4 |
| Petal width | Float | 0.2 |
Output
The model returns the predicted species as one of the following:
setosaversicolorvirginicaExample Code
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
# Load and train model
iris = load_iris()
X, y = iris.data, iris.target
model = DecisionTreeClassifier()
model.fit(X, y)
# Predict
sample = [[5.1, 3.5, 1.4, 0.2]]
predicted_class = model.predict(sample)[0]
print("Predicted species:", iris.target_names[predicted_class])