Instructions to use studentscolab/iris with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use studentscolab/iris with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("studentscolab/iris", "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
File size: 948 Bytes
0412483 7c11744 0412483 18620e0 0412483 7c11744 0412483 7c11744 18620e0 4830494 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ---
library_name: scikit-learn
tags:
- sklearn
- iris
---
# Iris Flower Classification
Model: Logistic Regression w Pipeline (StandardScaler + LogisticRegression).
## Input
Table with columns:
- sepal length (cm)
- sepal width (cm)
- petal length (cm)
- petal width (cm)
## Output
- predict: class (0/1/2)
- predict_proba: class probabilities
## Przykład użycia
```python
import joblib
import pandas as pd
from huggingface_hub import hf_hub_download
import numpy as np
repo_id = "studentscolab/iris"
model_path = hf_hub_download(repo_id=repo_id, filename="model.joblib")
model = joblib.load(model_path)
x = pd.DataFrame([{
"sepal length (cm)": 5.1,
"sepal width (cm)": 3.5,
"petal length (cm)": 1.4,
"petal width (cm)": 0.2,
}])
np.set_printoptions(precision=10, suppress=True)
pred = model.predict(x)[0]
proba = model.predict_proba(x)[0]
print("classes:", model.classes_)
print("pred:", pred)
print("proba:", proba)
``` |