iris-classifier / README.md
unnicr's picture
Upload folder using huggingface_hub
307a48b verified
|
Raw History Blame Contribute Delete
847 Bytes
metadata
title: Iris Flower Classifier
emoji: 🌸
colorFrom: purple
colorTo: pink
sdk: gradio
app_file: app.py
pinned: false
license: mit

Iris Flower Classifier

A Random Forest model (scikit-learn) that predicts the species of an iris flower (setosa, versicolor, virginica) from four measurements in centimetres: sepal length, sepal width, petal length and petal width.

  • Training data: the classic Iris dataset (150 samples, 3 classes)
  • Algorithm: RandomForestClassifier, 100 trees
  • Test accuracy: 90% on a 20% hold-out split

Use it in Python

import joblib
from huggingface_hub import hf_hub_download

bundle = joblib.load(hf_hub_download("your-username/iris-classifier", "model.joblib"))
model, classes = bundle["model"], bundle["classes"]
print(classes[model.predict([[5.1, 3.5, 1.4, 0.2]])[0]])  # setosa