Skip to main content

Rust/Python gradient boosting for tabular data

Project description

GTBoost

Rust/Python gradient boosting for tabular data.

GTBoost combines histogram tree boosting with native NaN handling, optional interval split candidates, and optional PCF-lite categorical geometry. The project is alpha software: APIs may change, but the public surface is intentionally small.

Install

pip install maturin
maturin develop --release

Native API

import gtboost as gtb

train = gtb.Dataset(train_df, label="target", categorical="auto")
valid = gtb.Dataset(valid_df, label="target", reference=train)

model = gtb.train(
    {
        "objective": "binary",
        "learning_rate": 0.05,
        "max_depth": 6,
        "categorical_geometry": "auto",  # raw or pcf_lite when useful
        "interval_splits": "auto",
        "random_state": 42,
    },
    train,
    valid_sets=[valid],
    num_boost_round=1000,
    early_stopping_rounds=100,
)

p = model.predict(test_df)          # probabilities for binary tasks
labels = model.predict_label(test_df)

Sklearn API

from gtboost import GTBoostClassifier, GTBoostRegressor

clf = GTBoostClassifier(
    n_estimators=1000,
    learning_rate=0.05,
    max_depth=6,
    cat_features=None,  # pandas category/object/string columns auto-detected
    categorical_geometry="pcf_lite",
    interval_splits=True,
    seed=42,
)

clf.fit(X_train, y_train, eval_set=[(X_valid, y_valid)], early_stopping_rounds=100)
proba = clf.predict_proba(X_test)

DataFrames

gtboost.Dataset preserves column names and encodes pandas categorical columns consistently. Use reference=train for validation/test data so unseen categories map to the same unknown/NaN path.

dtrain = gtb.Dataset(df_train, label="target", categorical=["city", "segment"])
dtest = gtb.Dataset(df_test, reference=dtrain)

Tuning

from gtboost.tuner import tune_gtboost

result = tune_gtboost(
    X_train,
    y_train,
    task="binary",
    cat_features="auto",
    categorical_geometry_choices=["raw", "pcf_lite"],
    interval_splits="auto",
    n_trials=30,
    n_folds=3,
)

model = GTBoostClassifier(**result.best_params).fit(X_train, y_train)

Alpha Scope

Stable-facing:

  • Dataset, train, Booster
  • GTBoostClassifier, GTBoostRegressor
  • native NaN handling
  • interval splits
  • categorical_geometry="raw" and "pcf_lite"

Experimental:

  • CLT categorical teacher paths
  • broad research knobs in GTBoostModel

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gtboost-0.1.0a1.tar.gz (237.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gtboost-0.1.0a1-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

gtboost-0.1.0a1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gtboost-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gtboost-0.1.0a1-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

gtboost-0.1.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gtboost-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gtboost-0.1.0a1-cp310-cp310-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10Windows x86-64

gtboost-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gtboost-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file gtboost-0.1.0a1.tar.gz.

File metadata

  • Download URL: gtboost-0.1.0a1.tar.gz
  • Upload date:
  • Size: 237.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gtboost-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 80d1665386109961668b3b7c9758aeead9ce3f408aebdd8b547433822fab0700
MD5 0089c54000878398e20a876e21e542ae
BLAKE2b-256 764641e9fdc847efac49aef6f0e6fed2d203232eb101deb29638da498bff8805

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1.tar.gz:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gtboost-0.1.0a1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gtboost-0.1.0a1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 20cd27a22d911fe4121599a79c79648e8018865891eb89a7c3e133fc04d66830
MD5 2343953df19ed35356bd10c15d3d9cae
BLAKE2b-256 033821e35bf1f3bb4457a003bb94dafe696b4ef720f0662412ff01c924128caf

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtboost-0.1.0a1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d2c2ee34697cb762ee6e353a29587a6a97ccf5c7b678521e43018dafca31a4d5
MD5 8415a44331ddae4528bbfed4c3b47fb8
BLAKE2b-256 46b002004099a97eb0d4f47819f11e322f8a042981d3af3082b1bf0f8bc41907

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gtboost-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e246fbb0a1c12f6153b523731361d5b58f1030eb48e69336789fe517a2d857b2
MD5 83b072bd8afa81f097af823d8cfd7c6f
BLAKE2b-256 d0f611ea74228548f1bff95d596b74eefeda9747ca39567004780f17781d4e95

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gtboost-0.1.0a1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gtboost-0.1.0a1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 313782b9a9147970749d380b4fd2841b5637cddb2a7190193370b8eb95c02eba
MD5 889de9c0a63ed301ffed487bde13d6a3
BLAKE2b-256 c5ee2c187add6c64a3b5bfc65e57c9ac193893b66115c1e2f5e2fb7256dc9f1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtboost-0.1.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5b8776650d1ec1c012aa42ae6c513cc5e94fbc2b437977c9364fe6458b72def
MD5 c02956ee37ac9f75598f063c30981a11
BLAKE2b-256 ebaea751c1ff27f76c6352fe1887bd62d061e67714fd68e80b6db0b551169059

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gtboost-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 befad35ac681cedcff24e858f119e0b7e654de60ff88682eba2fe1c2a37bea8e
MD5 f58afd96401d8fa356bcd1a33a640762
BLAKE2b-256 ffd1ec64a9f2db8dcb59dd9e06132e8ece4d1f493c09bf415ba9ef22ab947c71

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: gtboost-0.1.0a1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gtboost-0.1.0a1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 928a42dcfc5039d149bb62233e6c91d0470989aaf85c0aba4e4cd353c58d0de2
MD5 53d2fd0a8cade9b6761923ce087cf26b
BLAKE2b-256 4eab96a3f0889946d7b8ee4a1c1fd256ce9aaa2e7f5e88e5651ba3d57ececbb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtboost-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81ad7ca1561e54434dd70c2ad8111ce3528fb1de6751ca41740cb5417a95f999
MD5 2a9238d221676e3b37a533c01a02f377
BLAKE2b-256 1b3642e4d3d10728b65837285d369f9ed7d807937229ffffea8b0fa61e8c847f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gtboost-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gtboost-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6979771006d1053e0824d06f276eb975f294d6647dbf1155932742a855d4a96f
MD5 6be8f429b245e29f1594355b9276830b
BLAKE2b-256 0d99394e8cc88817954bc4c04a937f9cf12e575cf91d1b4c446684b37ee5d2ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for gtboost-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on gtboost-org/gtboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page