Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b7e8b11
remove optimizer
RektPunk Apr 2, 2026
2b38cf8
wip
RektPunk Apr 2, 2026
9f8bbf0
update test and simplify
RektPunk Apr 2, 2026
4ed0c84
remove property
RektPunk Apr 3, 2026
2759c49
add eof
RektPunk Apr 3, 2026
c8b0b8e
refactor objective and regressor
RektPunk Apr 3, 2026
363b0b1
fix tests
RektPunk Apr 3, 2026
f379ebc
remove encoding
RektPunk Apr 3, 2026
d615ac2
update example
RektPunk Apr 3, 2026
88e01d4
revert workflow name
RektPunk Apr 3, 2026
817f028
update pytest workflow
RektPunk Apr 3, 2026
cb36020
update readme
RektPunk Apr 3, 2026
7b71748
update readme
RektPunk Apr 3, 2026
e22acac
update readme
RektPunk Apr 3, 2026
f6e759d
update test and objective
RektPunk Apr 3, 2026
952336d
update readme
RektPunk Apr 4, 2026
391882a
remove utils.py
RektPunk Apr 10, 2026
d8e911c
set examples
RektPunk Apr 28, 2026
5933d2d
fix example colab link
RektPunk Apr 28, 2026
e529230
autoupdate pre-commit
RektPunk May 6, 2026
62ac860
set base proper to py39
RektPunk May 6, 2026
3ab8b0d
fix dataset and regressor
RektPunk May 6, 2026
2accd63
fix typo in constraints
RektPunk May 6, 2026
0669811
fix huber loss error and refactor objective
RektPunk May 6, 2026
44a8d4e
make test simple
RektPunk May 7, 2026
cca24cc
set license
RektPunk May 7, 2026
67661f1
remove badge
RektPunk May 8, 2026
2849ce7
fix actions
RektPunk May 14, 2026
b0991cb
specific args
RektPunk May 14, 2026
a40d29c
unify delta and epsilon to epsilon
RektPunk May 14, 2026
88dd49f
fix lint action version
RektPunk May 14, 2026
938a7e0
add comments
RektPunk May 14, 2026
0fc76df
lint action test
RektPunk May 14, 2026
b283209
fix action
RektPunk May 14, 2026
4e21742
test action
RektPunk May 14, 2026
d8b5778
add ipynb to linter too
RektPunk May 14, 2026
559e579
citation
RektPunk May 19, 2026
9e3583c
fix readme
RektPunk May 19, 2026
dace3c4
fix bibtex
RektPunk May 19, 2026
846cea3
fix readme
RektPunk May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# ALL
@RektPunk
@RektPunk
16 changes: 12 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Lint
on:
push:
paths:
- '**.py'
- "**.py"
- "**.ipynb"

jobs:
run-linters:
Expand All @@ -12,7 +13,14 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Lint check ruff
uses: chartboost/ruff-action@v1
- name: Install Ruff
uses: astral-sh/ruff-action@v4.0.0
with:
args: "--version"

- name: Run Ruff Check & Format
run: |
ruff check .
ruff format --check --diff .
22 changes: 12 additions & 10 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ name: Publish Python Package
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"

jobs:
release:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v6

# poetry publish
- name: Publish module
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
poetry_install_options: "--without dev"
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Build distributions
run: uv build --sdist --wheel

- name: Publish to PyPI
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
31 changes: 11 additions & 20 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,26 @@ name: Tests

on:
pull_request:
types: [opened, reopened, ready_for_review, review_requested]
types: [opened, reopened, synchronize]
push:
branches:
- main

jobs:
run-pytest:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Checkout code
uses: actions/checkout@v6

- name: Install dependencies
run: poetry install --no-interaction --with dev
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Run tests
run: poetry run pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=app tests/ | tee pytest-coverage.txt
- name: Install dependencies
run: |
uv sync --all-extras
uv pip install -e .

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
- name: Run tests
run: uv run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ __pycache__/
.vscode/
.pytest_cache/
.mypy_cache/
*.egg-info
42 changes: 20 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
- id: ruff
name: ruff check
args: [--fix]
- id: ruff
name: ruff isort
args: [--select, I, --fix]
- id: ruff-format
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 RektPunk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
<div style="text-align: center;">
<img src="https://capsule-render.vercel.app/api?type=transparent&fontColor=0047AB&text=MQBoost&height=120&fontSize=90">
</div>
<p align="center">
<a href="https://github.com/RektPunk/MQBoost/releases/latest">
<img alt="release" src="https://img.shields.io/github/v/release/RektPunk/mqboost.svg">
</a>
<a href="https://pypi.org/project/MQBoost">
<img alt="Pythonv" src="https://img.shields.io/pypi/pyversions/MQBoost.svg?logo=python&logoColor=white">
</a>
<a href="https://github.com/RektPunk/MQBoost/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/RektPunk/MQboost.svg">
</a>
<a href="https://github.com/RektPunk/MQBoost/actions/workflows/lint.yaml">
<img alt="Lint" src="https://github.com/RektPunk/MQBoost/actions/workflows/lint.yaml/badge.svg?branch=main">
</a>
<a href="https://github.com/RektPunk/MQBoost/actions/workflows/test.yaml">
<img alt="Test" src="https://github.com/RektPunk/MQBoost/actions/workflows/test.yaml/badge.svg?branch=main">
</a>
</p>

**MQBoost** is a gradient boosting-based framework for simultaneous multi-quantile regression with monotonicity constraints (non-crossing quantiles).
It is built on top of [LightGBM](https://github.com/microsoft/LightGBM) and [XGBoost](https://github.com/dmlc/xgboost), two leading gradient boosting frameworks, enabling efficient and scalable training while ensuring valid quantile estimates.

**MQBoost** introduces an advanced model for estimating multiple quantiles while ensuring the non-crossing condition (monotone quantile condition). This model harnesses the capabilities of both [LightGBM](https://github.com/microsoft/LightGBM) and [XGBoost](https://github.com/dmlc/xgboost), two leading gradient boosting frameworks.
Standard quantile regression models often suffer from quantile crossing (e.g., 90% quantile < 50% quantile) and independent training per quantile → inconsistent predictions. We solve this by:
- Learning multiple quantiles jointly
- Enforcing monotonicity across quantiles
- Leveraging efficient boosting frameworks

By implementing the hyperparameter optimization prowess of [Optuna](https://github.com/optuna/optuna), the model achieves great performance. Optuna's optimization algorithms fine-tune the hyperparameters, ensuring the model operates efficiently.

# Installation
# Usage
## Installation
Install using pip:
```bash
pip install mqboost
```

# Usage
## Features
- **MQDataset**: Encapsulates the dataset used for MQRegressor and MQOptimizer.
- **MQDataset**: Encapsulates the dataset used for MQRegressor.
- **MQRegressor**: Custom multiple quantile estimator with preserving monotonicity among quantiles.
- **MQOptimizer**: Optimize hyperparameters for MQRegressor with Optuna.


## Example
Please refer to the [**Examples**](https://github.com/RektPunk/MQBoost/tree/main/examples) provided for further clarification.
Please refer to the [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/RektPunk/MQBoost/blob/main/examples/mqregressor.ipynb) or [**Examples**](https://github.com/RektPunk/MQBoost/tree/main/examples/mqregressor.py) provided for further clarification.

# Citation
If you use MQBoost in your research or project, please cite it as follows:
```bibtex
@article{Moon2026,
title={Monotone Composite Quantile Regression via Second-Order Gradient Boosting Framework},
author={Moon, Sangjun and Hong, Sungchul and Park, Beomjin},
journal={Machine Learning},
volume={115},
number={6},
pages={127},
year={2026},
publisher={Springer}
}
```
12 changes: 0 additions & 12 deletions examples/README.md

This file was deleted.

74 changes: 0 additions & 74 deletions examples/mqoptimizer.py

This file was deleted.

Loading