Instructions to use BOUIDA/logreg-iris-softmax with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use BOUIDA/logreg-iris-softmax with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("BOUIDA/logreg-iris-softmax", "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
Ajout de la Model Card
Browse files
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: sklearn
|
| 3 |
+
tags:
|
| 4 |
+
- tabular-classification
|
| 5 |
+
- logistic-regression
|
| 6 |
+
- iris
|
| 7 |
+
datasets:
|
| 8 |
+
- scikit-learn/iris
|
| 9 |
+
metrics:
|
| 10 |
+
- accuracy
|
| 11 |
+
license: mit
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Régression logistique multiclasse (softmax) – Iris 🌸
|
| 15 |
+
|
| 16 |
+
Modèle de classification qui prédit l'espèce d'une fleur d'iris à partir de 4 mesures.
|
| 17 |
+
|
| 18 |
+
## Description
|
| 19 |
+
- **Type :** `Pipeline` scikit-learn = `StandardScaler` + `LogisticRegression` (softmax multiclasse)
|
| 20 |
+
- **Données :** dataset Iris (150 fleurs, 3 espèces), 70 % entraînement / 30 % test (stratifié)
|
| 21 |
+
- **Classes :** 0 = setosa, 1 = versicolor, 2 = virginica
|
| 22 |
+
|
| 23 |
+
## Performance
|
| 24 |
+
| Méthode | Accuracy (test) |
|
| 25 |
+
|---|---|
|
| 26 |
+
| **Softmax (ce modèle)** | **0,911** |
|
| 27 |
+
| One-vs-Rest (comparaison) | 0,844 |
|
| 28 |
+
|
| 29 |
+
## Utilisation
|
| 30 |
+
```python
|
| 31 |
+
from huggingface_hub import hf_hub_download
|
| 32 |
+
import joblib
|
| 33 |
+
import pandas as pd
|
| 34 |
+
|
| 35 |
+
chemin = hf_hub_download("BOUIDA/logreg-iris-softmax", "logreg_iris_softmax.joblib")
|
| 36 |
+
modele = joblib.load(chemin)
|
| 37 |
+
|
| 38 |
+
fleur = pd.DataFrame([{
|
| 39 |
+
"sepal length (cm)": 6.0, "sepal width (cm)": 2.9,
|
| 40 |
+
"petal length (cm)": 4.5, "petal width (cm)": 1.5,
|
| 41 |
+
}])
|
| 42 |
+
classes = ["setosa", "versicolor", "virginica"]
|
| 43 |
+
print(classes[modele.predict(fleur)[0]]) # versicolor
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
⚠️ Le modèle attend un DataFrame avec exactement ces 4 noms de colonnes.
|
| 47 |
+
La normalisation (StandardScaler) est incluse dans le modèle.
|
| 48 |
+
|
| 49 |
+
## Limites
|
| 50 |
+
- Entraîné sur un petit dataset (150 exemples) : projet d'apprentissage.
|
| 51 |
+
- Ne reconnaît que les 3 espèces d'iris du dataset.
|