Instructions to use shrisivaj333/iris-flower with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use shrisivaj333/iris-flower with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("shrisivaj333/iris-flower", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
πΈ iris-flower β Iris Species Classifier
A scikit-learn model that predicts the species of an Iris flower
(setosa, versicolor, virginica) from four measurements.
- Algorithm: RandomForestClassifier inside a
StandardScalerPipeline - Trained on: the classic Iris dataset (150 samples)
- Accuracy: ~95% cross-validation, ~90% on held-out test data
- Inputs (cm):
sepal_length,sepal_width,petal_length,petal_width
π Use it by name (anyone, anywhere)
pip install huggingface_hub joblib scikit-learn pandas
from huggingface_hub import hf_hub_download
import joblib, pandas as pd
# Download THIS model by its name from the Hub
path = hf_hub_download(repo_id="shrisivaj333/iris-flower", filename="model.joblib")
bundle = joblib.load(path)
pipeline = bundle["pipeline"]
features = bundle["features"] # ['sepal_length','sepal_width','petal_length','petal_width']
# Predict a flower
row = pd.DataFrame([[5.1, 3.5, 1.4, 0.2]], columns=features)
print(pipeline.predict(row)) # -> ['setosa']
print(pipeline.predict_proba(row)) # confidence per class
π¦ What's inside model.joblib
A Python dict:
pipelineβ the fitted scikit-learn Pipeline (scaler + random forest)featuresβ the input column names, in orderclassesβ the species labels
π Retrain / source code
Full training code, web app, and Docker deployment:
the model was built from a CSV with StandardScaler + RandomForestClassifier.
Built for self-learning. πΈ
- Downloads last month
- -