YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Iris Logistic Regression (scikit-learn)
This repository contains a simple Logistic Regression classifier trained on the classic Iris dataset using scikit-learn.
Details
- Library: scikit-learn
- Task: Multi-class classification (3 Iris species)
- Model:
LogisticRegression(max_iter=200) - Test accuracy: 0.9333 (93.33%)
Files
model.pkl– a pickled Python dictionary containing:model: trainedLogisticRegressionobjectscaler:StandardScalerused for preprocessingtarget_names: class names (setosa,versicolor,virginica)
Usage Example
import pickle
import numpy as np
# Load the model bundle
with open("model.pkl", "rb") as f:
bundle = pickle.load(f)
model = bundle["model"]
scaler = bundle["scaler"]
target_names = bundle["target_names"]
# Example prediction: sepal_length, sepal_width, petal_length, petal_width
x_new = np.array([[5.1, 3.5, 1.4, 0.2]])
x_new_scaled = scaler.transform(x_new)
pred = model.predict(x_new_scaled)[0]
print("Predicted class:", target_names[pred])
Classes
- Setosa
- Versicolor
- Virginica
Dataset
The Iris dataset is a classic machine learning dataset containing 150 samples with 4 features each:
- Sepal length (cm)
- Sepal width (cm)
- Petal length (cm)
- Petal width (cm)
Created with: scikit-learn
Uploaded to: Hugging Face Hub
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support