Downloads · 30 days
0
alfiinyang/XGSupply
XGSupply is a machine learning model from alfiinyang. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a global XGBoost regression model designed to predict upcoming demand (daily units sold) for supply chain management. It enables proactive inventory management by identifying potential stockouts and overstock…
Downloads · 30 days
0
Access
Public
Updated Sep 11, 2026
Repo size
425 KB
Likes
0
Public
Click a slice to open those files.
.joblib425 KB · 98%
From the Hugging Face model README
This is a global XGBoost regression model designed to predict upcoming demand (daily units sold) for supply chain management. It enables proactive inventory management by identifying potential stockouts and overstock situations across various product categories.
The model was evaluated using a chronological 20% test split to simulate real-world forecasting conditions.
| Metric | Value |
|---|---|
| Mean Absolute Error (MAE) | 53.18 |
| Root Mean Squared Error (RMSE) | 82.90 |
To use this model, your raw input data must contain the following columns:
date: Format YYYY-MM-DDsku_id: Unique identifier for the productcategory: Product category (e.g., Snacks, Beverages)units_sold: Historical daily sales (needed for rolling averages)units_received: Daily inventory replenishment quantityclosing_stock: End-of-day inventory levellead_time_days: Supplier delivery time in daysBecause the model uses a 30-day rolling average, you must provide at least 30 days of historical data for a specific SKU to get the most accurate predictions. If history is shorter, the pipeline will fill missing values with 0.
We have provided inference_utils.py to handle all feature engineering (Temporal, Rolling, Lag, and Scaling) automatically.
from huggingface_hub import hf_hub_download
import joblib
from inference_utils import preprocess_for_inference
# Download artifacts
repo = "alfiinyang/XGSupply"
model = joblib.load(hf_hub_download(repo, "xgboost_supply_model.joblib"))
hf_hub_download(repo, "training_feature_names.joblib", local_dir=".")
hf_hub_download(repo, "scaled_column_names.joblib", local_dir=".")
# Preprocess and Predict
X_processed = preprocess_for_inference(your_raw_dataframe, scaler_path=hf_hub_download(repo, "scaler.joblib"))
predictions = model.predict(X_processed)