Website Github Demo

🌸 Iris Species Classifier (Logistic Regression)

This repository provides a lightweight logistic regression model trained on the classic Iris dataset using scikit-learn. It is ideal for educational purposes, experimentation, and demonstration of inference on tabular data.

🧠 Model Overview

  • Algorithm: Logistic Regression
  • Framework: scikit-learn
  • Features:
    • sepal_length
    • sepal_width
    • petal_length
    • petal_width
  • Target Classes:
    • setosa
    • versicolor
    • virginica

πŸš€ Usage Example

Python Code

import joblib
import pandas as pd

model = joblib.load("model.joblib")

sample = pd.DataFrame([[5.1, 3.5, 1.4, 0.2]],
                      columns=["sepal_length", "sepal_width", "petal_length", "petal_width"])

prediction = model.predict(sample)
print(f"🌸 Predicted class: {prediction[0]}")

πŸ”„ How to load the model

from huggingface_hub import hf_hub_download
import joblib

model_path = hf_hub_download("DmytroSerbeniuk/my-iris-model", "model.joblib")
model = joblib.load(model_path)

CLI Inference

You can also use the provided inference.py script:

python3 inference.py 6.0 2.2 4.0 1.0

Expected Output:

🌸 Predicted class: versicolor

πŸ§ͺ Sample Predictions

Sepal Length Sepal Width Petal Length Petal Width Prediction
5.1 3.5 1.4 0.2 setosa
6.0 2.2 4.0 1.0 versicolor
6.9 3.1 5.4 2.1 virginica

πŸ“¦ Requirements

Dependencies listed in requirements.txt:

scikit-learn
pandas
joblib

License

my-iris-model is licensed under the Apache 2.0 license

Downloads last month
38
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support