Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ALL
@RektPunk
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Rust CI

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

env:
CARGO_TERM_COLOR: always

jobs:
quality-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Check Formatting
run: cargo fmt --check

- name: Run Clippy
run: cargo clippy -- -D warnings

- name: Run Tests
run: cargo test --verbose --release
36 changes: 36 additions & 0 deletions .github/workflows/pyci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

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

jobs:
run-pytest:
runs-on: ubuntu-latest

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

- name: Set up python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync --all-extras --dev

- name: Build and Install Extension
run: uvx maturin develop --release

- name: Run tests
run: uv run pytest python/tests/
65 changes: 65 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish to PyPI

on:
push:
tags:
- "v*.*.*"

permissions:
contents: read

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist
manylinux: auto
sccache: "true"

- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: dist

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build_wheels]
steps:
- uses: actions/checkout@v6

- name: Download all wheels
uses: actions/download-artifact@v8
with:
path: dist
pattern: wheels-*
merge-multiple: true

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist

- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing dist/*
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ target
# Generated by cargo mutants
# Contains mutation testing data
**/mutants.out*/

__pycache__/
*.py[cod]
*$py.class
*.so
*.whl
.python-version

dist/
.venv
.DS_Store
136 changes: 135 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[package]
name = "xuplift"
version = "0.1.0"
version = "0.0.1"
edition = "2024"

[lib]
name = "xuplift"
crate-type = ["cdylib", "rlib"]

[dependencies]
faer = "0.24.0"
numpy = "0.28.0"
pyo3 = { version = "0.28.3", features = ["extension-module", "abi3-py38"] }
rand = "0.10.0"
rayon = "1.11.0"
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
</a>
</p>

Explainable uplift modeling via linearized kernel feature maps.
Explainable uplift modeling via linearized kernel feature maps, providing a collection of meta-learners.

WIP
# Installation
Install using pip:
```bash
pip install xuplift
```

# Features
- Regressor: High-performance regression engine for outcome and residual modeling.
- Classifier: Optimized binary classifier for precise propensity score estimation.
- RLearner: Advanced residual-on-residual estimator with built-in 2-fold cross-fitting to ensure unbiased treatment effect estimation.
- XLearner: Optimized cross-learner designed to handle significantly unbalanced treatment groups.
- TLearner/SLearner: Standard two-model and single-model estimators for baseline causal analysis.
Loading