Instructions to use mosesalphonse/iris-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use mosesalphonse/iris-classifier with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("mosesalphonse/iris-classifier", "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
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: sklearn
|
| 4 |
+
tags:
|
| 5 |
+
- sklearn
|
| 6 |
+
- random-forest
|
| 7 |
+
- iris
|
| 8 |
+
- classification
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Iris Classifier
|
| 12 |
+
|
| 13 |
+
A simple Random Forest classifier trained on the classic Iris dataset.
|
| 14 |
+
|
| 15 |
+
## Model details
|
| 16 |
+
- **Algorithm**: Random Forest (100 trees)
|
| 17 |
+
- **Library**: scikit-learn
|
| 18 |
+
- **Dataset**: Iris (150 samples, 4 features, 3 classes)
|
| 19 |
+
- **Test accuracy**: 1.00
|
| 20 |
+
|
| 21 |
+
## Input
|
| 22 |
+
4 numeric features:
|
| 23 |
+
1. Sepal length (cm)
|
| 24 |
+
2. Sepal width (cm)
|
| 25 |
+
3. Petal length (cm)
|
| 26 |
+
4. Petal width (cm)
|
| 27 |
+
|
| 28 |
+
## Output
|
| 29 |
+
Predicted species class: `0` (setosa), `1` (versicolor), or `2` (virginica)
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
```python
|
| 33 |
+
import skops.io as sio
|
| 34 |
+
from huggingface_hub import hf_hub_download
|
| 35 |
+
|
| 36 |
+
path = hf_hub_download(repo_id="mosesalphonse/iris-classifier", filename="model.skops")
|
| 37 |
+
model = sio.load(path, trusted=True)
|
| 38 |
+
|
| 39 |
+
prediction = model.predict([[5.1, 3.5, 1.4, 0.2]])
|
| 40 |
+
print(prediction)
|
| 41 |
+
```
|