Skip to main content

A gradient boosted tree library with automatic feature engineering.

Project description

gbt is a library for gradient boosted trees with minimal coding required. It is a thin wrapper around lightgbm. Give it a pandas.Dataframe, gbt.train() takes care of feature transforms (e.g. scaling for numerical features, label encoding for categorical features) and metrics print outs.

Install

pip install gbt

Quickstart

class DatasetBuilder:
    def training_dataset(self):
        df = pd.DataFrame(
            {
                "a": [1, 2, 3, 4, 5, 6, 7],
                "b": ["a", "b", "c", None, "e", "f", "g"],
                "c": [1, 0, 1, 1, 0, 0, 1],
                "some_other_column": [0, 0, None, None, None, 3, 3],
            }
        )
        return df
    
    def testing_dataset(self):
        return self.training_dataset()

TrainingPipeline(
    params_preset="binary",  # one of mape, l2, binary, multiclass
    params_override={"num_leaves": 10},
    label_column="c",
    val_size=0.2,  # fraction of the validation split
    categorical_feature_columns=["b"],
    numerical_feature_columns=["a"],
).fit(DatasetBuilder())

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

gbt-0.2.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

gbt-0.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file gbt-0.2.tar.gz.

File metadata

  • Download URL: gbt-0.2.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for gbt-0.2.tar.gz
Algorithm Hash digest
SHA256 8652c33c53bd8eb393136c5a7c117f918de515fed2b4b86a39d81481ef372a6a
MD5 a7af295eb7aa79e70318a13b6d1c2d6e
BLAKE2b-256 fce37cb4a4408a9b193120c893895f37c3abf531bde72804db2cf140778e2b08

See more details on using hashes here.

File details

Details for the file gbt-0.2-py3-none-any.whl.

File metadata

  • Download URL: gbt-0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for gbt-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43c0b8cf810b34aac2b455eb2552e9cc00bd910bb346959c6cc01a9c6cb0038a
MD5 a60765637683ea2e2238fcf6719d062f
BLAKE2b-256 57c8f23ebd937091ad641cbc9844b80a5bbd4134cd0b8734738e7fe661ec98f6

See more details on using hashes here.

Supported by

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