Downloads ยท 30 days
0
verisimb/regresi
regresi is a tabular regression model from verisimb. Use it for the tabular regression task on the model card, and read the license before you ship it in a product. It is set up for sklearn. The card lists the license as mit.
Model Multiple Linear Regression yang dilatih untuk memprediksi lebar petal (petal width) bunga Iris berdasarkan tiga fitur morfologi bunga dari dataset Iris klasik (R.A. Fisher, 1936).
Downloads ยท 30 days
0
Access
Public
Updated Jun 8, 2026
Repo size
881 B
Likes
0
Public
Click a slice to open those files.
.md6.4 KB ยท 73%
From the Hugging Face model README
Model Multiple Linear Regression yang dilatih untuk memprediksi lebar petal (petal width) bunga Iris berdasarkan tiga fitur morfologi bunga dari dataset Iris klasik (R.A. Fisher, 1936).
| Atribut | Detail |
|---|---|
| Tipe Model | Multiple Linear Regression |
| Library | scikit-learn |
| Task | Tabular Regression |
| Dataset | Iris Dataset (UCI Repository) |
| File Model | iris_linear_regression_model.pkl |
| Format | joblib pickle (.pkl) |
Evaluasi dilakukan pada 30 data uji (20% dari total 150 sampel):
| Metrik | Nilai |
|---|---|
| Rยฒ Score | 0.9269 |
| MSE (Mean Sq. Error) | 0.0464 |
| RMSE (Root MSE) | 0.2155 |
Rยฒ = 0.9269 artinya model mampu menjelaskan 92.69% variasi data petal width โ performa yang sangat baik untuk model linear.
Model menghasilkan persamaan regresi berikut:
petal_width = -0.1791
+ (-0.2379 ร sepal_length)
+ ( 0.2430 ร sepal_width)
+ ( 0.5367 ร petal_length)
| Fitur | Koefisien | Interpretasi |
|---|---|---|
sepal_length | -0.2379 | Tiap +1 cm sepal length โ petal width turun 0.24 cm |
sepal_width | 0.2430 | Tiap +1 cm sepal width โ petal width naik 0.24 cm |
petal_length | 0.5367 | Tiap +1 cm petal length โ petal width naik 0.54 cm |
| Intercept | -0.1791 | Nilai dasar saat semua fitur = 0 |
Petal length adalah prediktor terkuat dengan koefisien terbesar (0.5367), sejalan dengan korelasi tinggi (0.9490) yang tercatat dalam dataset.
| Fitur | Min | Max | Mean | Std Dev |
|---|---|---|---|---|
sepal_length | 4.3 | 7.9 | 5.84 | 0.83 |
sepal_width | 2.0 | 4.4 | 3.05 | 0.43 |
petal_length | 1.0 | 6.9 | 3.76 | 1.76 |
petal_width | 0.1 | 2.5 | 1.20 | 0.76 |
| Set | Jumlah Sampel |
|---|---|
| Training | 120 (80%) |
| Testing | 30 (20%) |
Split menggunakan
random_state=42untuk reproducibility.
pip install scikit-learn joblib huggingface_hub
import joblib
import numpy as np
from huggingface_hub import hf_hub_download
# Download model dari Hugging Face
model_path = hf_hub_download(
repo_id="verisimb/regresi",
filename="iris_linear_regression_model.pkl",
)
model = joblib.load(model_path)
# Prediksi satu sampel: [sepal_length, sepal_width, petal_length]
sample = [[5.1, 3.5, 1.4]]
prediction = model.predict(sample)
print(f"Prediksi Petal Width: {prediction[0]:.4f} cm")
# Output: Prediksi Petal Width: 0.2095 cm
import pandas as pd
data_baru = pd.DataFrame({
'sepal_length': [5.1, 6.3, 7.2],
'sepal_width' : [3.5, 2.9, 3.0],
'petal_length': [1.4, 4.5, 5.8]
})
predictions = model.predict(data_baru)
data_baru['petal_width_pred'] = predictions.round(4)
print(data_baru)
Output:
sepal_length sepal_width petal_length petal_width_pred
0 5.1 3.5 1.4 0.2095
1 6.3 2.9 4.5 1.4421
2 7.2 3.0 5.8 1.9500
| Fitur | Min | Max | Satuan |
|---|---|---|---|
sepal_length | 4.3 | 7.9 | cm |
sepal_width | 2.0 | 4.4 | cm |
petal_length | 1.0 | 6.9 | cm |
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import joblib
# Features dan Target
X = df[['sepal_length', 'sepal_width', 'petal_length']]
y = df['petal_width']
# Split data
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42
)
# Training
model = LinearRegression()
model.fit(X_train, y_train)
# Simpan model
joblib.dump(model, "iris_linear_regression_model.pkl")
Notebook lengkap proses pelatihan tersedia di: Linear_Regression_Iris.ipynb
Coba model langsung melalui aplikasi Gradio yang telah di-deploy:
๐ Buka Demo โ
| File | Deskripsi |
|---|---|
iris_linear_regression_model.pkl | File model terlatih (joblib format) |