Downloads · 30 days
0
kendrickfff/OJ-Sales-Revenue-Prediction
OJ-Sales-Revenue-Prediction is a tabular regression model from kendrickfff. 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.
A Gradient Boosting Regressor trained on the OJ Sales dataset from Azure Open Datasets to predict orange juice Revenue based on sales features.
Downloads · 30 days
0
Access
Public
Updated Feb 18, 2026
Repo size
680 KB
Likes
0
Public
Click a slice to open those files.
.pkl680 KB · 99%
From the Hugging Face model README
A Gradient Boosting Regressor trained on the OJ Sales dataset from Azure Open Datasets to predict orange juice Revenue based on sales features.
Built and deployed on Microsoft Fabric during METC Online Training #5: "Mempersiapkan Data untuk Model AI di Microsoft Fabric" 🍊 organized by Microsoft Elevate and Dicoding.
| Property | Value |
|---|---|
| Model Type | Gradient Boosting Regressor |
| Framework | scikit-learn |
| Task | Tabular Regression |
| Target Variable | Revenue (continuous) |
| Training Platform | Microsoft Fabric + MLflow |
| Dataset | OJ Sales (Azure Open Datasets) |
| Sample Size | 500 rows (sampled with random_state=1) |
| Train/Test Split | 80/20 (random_state=42) |
| Feature | Type | Description |
|---|---|---|
Quantity | int | Units sold |
Advert | int | Advertisement flag (0=No, 1=Yes) |
Price | float | Unit price ($) |
Brand_encoded | int | Brand (0=Dominicks, 1=Minute Maid, 2=Tropicana) |
Store_encoded | int | Store ID (label encoded) |
Year | int | Year extracted from WeekStarting |
Month | int | Month (1-12) |
WeekOfYear | int | Week number (1-52) |
Quarter | int | Quarter (1-4) |
| Metric | Score |
|---|---|
| R² | 0.9965 |
| MAE | 358.00 |
| RMSE | 454.92 |
| CV R² (5-fold) | 0.9964 ± 0.0008 |
| Model | R² | MAE | RMSE |
|---|---|---|---|
| Gradient Boosting | 0.9965 | 358 | 455 |
| XGBoost | 0.9960 | 380 | 489 |
| Random Forest | 0.9952 | 412 | 533 |
| Linear Regression | 0.9474 | 1,835 | 2,450 |
import pickle
import numpy as np
# Load model
with open("model.pkl", "rb") as f:
model = pickle.load(f)
# Input: [Quantity, Advert, Price, Brand_encoded, Store_encoded, Year, Month, WeekOfYear, Quarter]
sample = np.array([[15000, 1, 2.50, 1, 5, 1992, 6, 24, 2]])
prediction = model.predict(sample)
print(f"Predicted Revenue: ${prediction[0]:,.2f}")
Advert=1) shows positive impact on sales quantityn_estimators=200, learning_rate=0.1, max_depth=5, random_state=42