brjapon/iris
Viewer • Updated • 150 • 10
How to use Jesus02/iris-model-clase with Scikit-learn:
from huggingface_hub import hf_hub_download
import joblib
model = joblib.load(
hf_hub_download("Jesus02/iris-model-clase", "sklearn_model.joblib")
)
# only load pickle files from sources you trust
# read more about it here https://skops.readthedocs.io/en/stable/persistence.htmlThis repository starts with a Decision Tree model trained on the classic Iris dataset. The model classifies iris flowers into three species—setosa, versicolor, or virginica—based on four numeric features (sepal length, sepal width, petal length, and petal width).
Because of its small size and simplicity, this model is intended primarily for demonstration and educational purposes.
DecisionTreeClassifier class) To use this model, you can load the .joblib file from the Hub in Python code:
import joblib
from huggingface_hub import hf_hub_download
# Accompanying dataset is hosted in Hugging Face under 'Jesus02/iris-clase'
model_path = hf_hub_download(repo_id="brjapon/iris",
filename="iris_dt.joblib",
repo_type="model")
model = joblib.load(model_path)
# Example prediction (random values below)
sample_input = [[5.1, 3.5, 1.4, 0.2]]
prediction = model.predict(sample_input)
print(prediction) # e.g., [0] which might correspond to 'setosa'
brjapon/iris) train_test_splitUsing a random 80/20 split, the model typically achieves ~97% accuracy on the test subset. Actual results may vary depending on your specific train/test split random state.