<p align="center">
<img height="120" src="https://github.com/perpetual-ml/perpetual/raw/main/resources/perp_logo.png">
</p>
<div align="center">
[![Python Versions](https://img.shields.io/pypi/pyversions/perpetual.svg?logo=python&logoColor=white)](https://pypi.org/project/perpetual)
[![PyPI Version](https://img.shields.io/pypi/v/perpetual.svg?logo=pypi&logoColor=white)](https://pypi.org/project/perpetual)
[![Crates.io Version](https://img.shields.io/crates/v/perpetual?logo=rust&logoColor=white)](https://crates.io/crates/perpetual)
[![Static Badge](https://img.shields.io/badge/join-discord-blue?logo=discord)](https://discord.gg/AyUK7rr6wy)
</div>
# Perpetual
PerpetualBooster is a gradient boosting machine (GBM) algorithm which doesn't need hyperparameter optimization unlike other GBM algorithms. Similar to AutoML libraries, it has a `budget` parameter. Increasing the `budget` parameter increases the predictive power of the algorithm and gives better results on unseen data. Start with a small budget (e.g. 1.0) and increase it (e.g. 2.0) once you are confident with your features. If you don't see any improvement with further increasing the `budget`, it means that you are already extracting the most predictive power out of your data.
## Benchmark
Hyperparameter optimization usually takes 100 iterations with plain GBM algorithms. PerpetualBooster achieves the same accuracy in a single run. Thus, it achieves up to 100x speed-up at the same accuracy with different `budget` levels and with different datasets.
The following table summarizes the results for the [California Housing](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_california_housing.html) dataset (regression):
| Perpetual budget | LightGBM n_estimators | Perpetual mse | LightGBM mse | Speed-up wall time | Speed-up cpu time |
| ---------------- | --------------------- | ------------- | ------------ | ------------------ | ----------------- |
| 1.0 | 100 | 0.192 | 0.192 | 54x | 56x |
| 1.5 | 300 | 0.188 | 0.188 | 59x | 58x |
| 2.1 | 1000 | 0.185 | 0.186 | 42x | 41x |
The following table summarizes the results for the [Cover Types](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_covtype.html) dataset (classification):
| Perpetual budget | LightGBM n_estimators | Perpetual log loss | LightGBM log loss | Speed-up wall time | Speed-up cpu time |
| ---------------- | --------------------- | ------------------ | ----------------- | ------------------ | ----------------- |
| 0.9 | 100 | 0.091 | 0.084 | 72x | 78x |
You can reproduce the results using the scripts in the [examples](./python-package/examples) folder.
## Usage
You can use the algorithm like in the example below. Check examples folders for both Rust and Python.
```python
from perpetual import PerpetualBooster
model = PerpetualBooster(objective="SquaredLoss")
model.fit(X, y, budget=1.0)
```
## Documentation
Documentation for the Python API can be found [here](https://perpetual-ml.github.io/perpetual) and for the Rust API [here](https://docs.rs/perpetual/latest/perpetual/).
## Installation
The package can be installed directly from [pypi](https://pypi.org/project/perpetual).
```shell
pip install perpetual
```
Using [conda-forge](https://anaconda.org/conda-forge/perpetual):
```shell
conda install conda-forge::perpetual
```
To use in a Rust project, add the following to your Cargo.toml file to get the package from [crates.io](https://crates.io/crates/perpetual).
```toml
perpetual = "0.7.3"
```
## Contribution
Contributions are welcome. Check CONTRIBUTING.md for the guideline.
## Paper
PerpetualBooster prevents overfitting with a generalization algorithm. The paper is work-in-progress to explain how the algorithm works. Check our [blog post](https://perpetual-ml.com/blog/how-perpetual-works) for a high level introduction to the algorithm.
Raw data
{
"_id": null,
"home_page": "https://perpetual-ml.com",
"name": "perpetual",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "rust, perpetual, machine learning, tree model, decision tree, gradient boosted decision tree, gradient boosting machine",
"author": "Mutlu Simsek",
"author_email": "Mutlu Simsek <msimsek@perpetual-ml.com>",
"download_url": "https://files.pythonhosted.org/packages/1e/fa/cbdc312558d90aec3b9b536675f548e997633385ef72a772389a3b2ee048/perpetual-0.7.3.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img height=\"120\" src=\"https://github.com/perpetual-ml/perpetual/raw/main/resources/perp_logo.png\">\n</p>\n\n<div align=\"center\">\n\n[![Python Versions](https://img.shields.io/pypi/pyversions/perpetual.svg?logo=python&logoColor=white)](https://pypi.org/project/perpetual)\n[![PyPI Version](https://img.shields.io/pypi/v/perpetual.svg?logo=pypi&logoColor=white)](https://pypi.org/project/perpetual)\n[![Crates.io Version](https://img.shields.io/crates/v/perpetual?logo=rust&logoColor=white)](https://crates.io/crates/perpetual)\n[![Static Badge](https://img.shields.io/badge/join-discord-blue?logo=discord)](https://discord.gg/AyUK7rr6wy)\n\n</div>\n\n# Perpetual\n\nPerpetualBooster is a gradient boosting machine (GBM) algorithm which doesn't need hyperparameter optimization unlike other GBM algorithms. Similar to AutoML libraries, it has a `budget` parameter. Increasing the `budget` parameter increases the predictive power of the algorithm and gives better results on unseen data. Start with a small budget (e.g. 1.0) and increase it (e.g. 2.0) once you are confident with your features. If you don't see any improvement with further increasing the `budget`, it means that you are already extracting the most predictive power out of your data.\n\n## Benchmark\n\nHyperparameter optimization usually takes 100 iterations with plain GBM algorithms. PerpetualBooster achieves the same accuracy in a single run. Thus, it achieves up to 100x speed-up at the same accuracy with different `budget` levels and with different datasets.\n\nThe following table summarizes the results for the [California Housing](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_california_housing.html) dataset (regression):\n\n| Perpetual budget | LightGBM n_estimators | Perpetual mse | LightGBM mse | Speed-up wall time | Speed-up cpu time |\n| ---------------- | --------------------- | ------------- | ------------ | ------------------ | ----------------- |\n| 1.0 | 100 | 0.192 | 0.192 | 54x | 56x |\n| 1.5 | 300 | 0.188 | 0.188 | 59x | 58x |\n| 2.1 | 1000 | 0.185 | 0.186 | 42x | 41x |\n\nThe following table summarizes the results for the [Cover Types](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_covtype.html) dataset (classification):\n\n| Perpetual budget | LightGBM n_estimators | Perpetual log loss | LightGBM log loss | Speed-up wall time | Speed-up cpu time |\n| ---------------- | --------------------- | ------------------ | ----------------- | ------------------ | ----------------- |\n| 0.9 | 100 | 0.091 | 0.084 | 72x | 78x |\n\nYou can reproduce the results using the scripts in the [examples](./python-package/examples) folder.\n\n## Usage\n\nYou can use the algorithm like in the example below. Check examples folders for both Rust and Python.\n\n```python\nfrom perpetual import PerpetualBooster\n\nmodel = PerpetualBooster(objective=\"SquaredLoss\")\nmodel.fit(X, y, budget=1.0)\n```\n\n## Documentation\n\nDocumentation for the Python API can be found [here](https://perpetual-ml.github.io/perpetual) and for the Rust API [here](https://docs.rs/perpetual/latest/perpetual/).\n\n## Installation\n\nThe package can be installed directly from [pypi](https://pypi.org/project/perpetual).\n\n```shell\npip install perpetual\n```\n\nUsing [conda-forge](https://anaconda.org/conda-forge/perpetual):\n\n```shell\nconda install conda-forge::perpetual\n```\n\nTo use in a Rust project, add the following to your Cargo.toml file to get the package from [crates.io](https://crates.io/crates/perpetual).\n\n```toml\nperpetual = \"0.7.3\"\n```\n\n## Contribution\n\nContributions are welcome. Check CONTRIBUTING.md for the guideline.\n\n## Paper\n\nPerpetualBooster prevents overfitting with a generalization algorithm. The paper is work-in-progress to explain how the algorithm works. Check our [blog post](https://perpetual-ml.com/blog/how-perpetual-works) for a high level introduction to the algorithm.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A self-generalizing gradient boosting machine which doesn't need hyperparameter optimization",
"version": "0.7.3",
"project_urls": {
"Homepage": "https://perpetual-ml.com",
"Source Code": "https://github.com/perpetual-ml/perpetual"
},
"split_keywords": [
"rust",
" perpetual",
" machine learning",
" tree model",
" decision tree",
" gradient boosted decision tree",
" gradient boosting machine"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "863eb81c95a5186d65c6b5ef19a86fc3db829e2f72f76f1e319fb37e9b531cef",
"md5": "ea863eaa6fa588625f0bd081fba0afda",
"sha256": "dd8ba3ee7620283ac87930bcef6f02f99d421b1a6c43a6aae2b562db1b2f69c3"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "ea863eaa6fa588625f0bd081fba0afda",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 884168,
"upload_time": "2024-11-15T18:12:33",
"upload_time_iso_8601": "2024-11-15T18:12:33.529813Z",
"url": "https://files.pythonhosted.org/packages/86/3e/b81c95a5186d65c6b5ef19a86fc3db829e2f72f76f1e319fb37e9b531cef/perpetual-0.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "006d479bf85335eee36af1d4a7a301867644a3b130ca0e16974b96c456f945b3",
"md5": "1d53a4e6c80af0676e4ec1317806cf56",
"sha256": "64a83a3468654e21d7ac3ab7bd621af9451cd39f2af31fb73e91cd9b77545a0c"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp310-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "1d53a4e6c80af0676e4ec1317806cf56",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 623027,
"upload_time": "2024-11-15T18:12:35",
"upload_time_iso_8601": "2024-11-15T18:12:35.824084Z",
"url": "https://files.pythonhosted.org/packages/00/6d/479bf85335eee36af1d4a7a301867644a3b130ca0e16974b96c456f945b3/perpetual-0.7.3-cp310-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "83bc5e5cebbe0fce1d81515e779bca3c77f3b03f44ce8794254f03ce648cccd3",
"md5": "593b5b9e177b47d9a8e9c15d64eefc76",
"sha256": "26765f6042131c93a5191a13157859d582169676540ca96d80ebd509798c4898"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp311-cp311-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "593b5b9e177b47d9a8e9c15d64eefc76",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 659464,
"upload_time": "2024-11-15T18:12:37",
"upload_time_iso_8601": "2024-11-15T18:12:37.826001Z",
"url": "https://files.pythonhosted.org/packages/83/bc/5e5cebbe0fce1d81515e779bca3c77f3b03f44ce8794254f03ce648cccd3/perpetual-0.7.3-cp311-cp311-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3e9da57e279699a1e9346c8903bc8417274524a373c204559a99b997fbd45bde",
"md5": "b63daee8d4f7299381fae44f60ad55af",
"sha256": "b2e2094404882ad14423df212adf00d222451ceca668d98784649b2d416160ca"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp311-cp311-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "b63daee8d4f7299381fae44f60ad55af",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 624415,
"upload_time": "2024-11-15T18:12:39",
"upload_time_iso_8601": "2024-11-15T18:12:39.116440Z",
"url": "https://files.pythonhosted.org/packages/3e/9d/a57e279699a1e9346c8903bc8417274524a373c204559a99b997fbd45bde/perpetual-0.7.3-cp311-cp311-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80c9a6e9c8884ceabc97c8601cf9987158bed407908b3e6ab47bc4c759fcff4e",
"md5": "2f4a8308a1dd51fc3105a8bdd9128d22",
"sha256": "d7021fe4e2a34385674296e2c05b38e4758bcfe0b582dfa0e511871e76c98e30"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "2f4a8308a1dd51fc3105a8bdd9128d22",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 884097,
"upload_time": "2024-11-15T18:12:40",
"upload_time_iso_8601": "2024-11-15T18:12:40.525580Z",
"url": "https://files.pythonhosted.org/packages/80/c9/a6e9c8884ceabc97c8601cf9987158bed407908b3e6ab47bc4c759fcff4e/perpetual-0.7.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cef7641f07f5ec796c90b115590969aaafb786bd0eac2793fc8f207a744be8b3",
"md5": "308028fdeba2297f11ba21ebc1b1debf",
"sha256": "466bbadb41fa25e7cfee802e0621a9fd95431cb6def94c4944ae11cfe54bd7a7"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp311-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "308028fdeba2297f11ba21ebc1b1debf",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 623378,
"upload_time": "2024-11-15T18:12:42",
"upload_time_iso_8601": "2024-11-15T18:12:42.676889Z",
"url": "https://files.pythonhosted.org/packages/ce/f7/641f07f5ec796c90b115590969aaafb786bd0eac2793fc8f207a744be8b3/perpetual-0.7.3-cp311-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9f917d304808b58e945428f04ad9dd3029fb339ab006d37a5626f0ee88e0db68",
"md5": "f0c9213cb8f76bccee583957fd118661",
"sha256": "cc0d8b8a09bd587760ac881a369b1377157e58decde884731333bb0120154e2e"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp312-cp312-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "f0c9213cb8f76bccee583957fd118661",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 657971,
"upload_time": "2024-11-15T18:12:44",
"upload_time_iso_8601": "2024-11-15T18:12:44.025155Z",
"url": "https://files.pythonhosted.org/packages/9f/91/7d304808b58e945428f04ad9dd3029fb339ab006d37a5626f0ee88e0db68/perpetual-0.7.3-cp312-cp312-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "695dc103763e03707eb0a4cd6b18aa311ca2d1e322884dfb0fb9683c87279826",
"md5": "8139540dd8b979c5efcad1314eaa921a",
"sha256": "758de614efc1cd95f19e9f583e1426c828b156ad676f170e6159573677852cd8"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp312-cp312-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "8139540dd8b979c5efcad1314eaa921a",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 624135,
"upload_time": "2024-11-15T18:12:47",
"upload_time_iso_8601": "2024-11-15T18:12:47.607936Z",
"url": "https://files.pythonhosted.org/packages/69/5d/c103763e03707eb0a4cd6b18aa311ca2d1e322884dfb0fb9683c87279826/perpetual-0.7.3-cp312-cp312-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e99839f01541f35cf8dd1c29c80d78b729a1b031bfa4d2c8931dac3505d07ce5",
"md5": "ef68b733a20e69adf4cb609b0b01d802",
"sha256": "6081680e3227e5475b4a356a3ae8621c08d4aefa3c028c01cd0a2cd4a6d9aa49"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "ef68b733a20e69adf4cb609b0b01d802",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 884514,
"upload_time": "2024-11-15T18:12:49",
"upload_time_iso_8601": "2024-11-15T18:12:49.775136Z",
"url": "https://files.pythonhosted.org/packages/e9/98/39f01541f35cf8dd1c29c80d78b729a1b031bfa4d2c8931dac3505d07ce5/perpetual-0.7.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6b5c33ff568d742768c2f00ae07027a5fbcf470eaf6c256c7df1634b3b35a60a",
"md5": "54971dffcc6653fd33921a398dfeb89c",
"sha256": "f7fa4847908ad7234eabb2ac997c0bc7627c3b450c1b5dbad585ce064185e0ee"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp312-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "54971dffcc6653fd33921a398dfeb89c",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 622598,
"upload_time": "2024-11-15T18:12:51",
"upload_time_iso_8601": "2024-11-15T18:12:51.875768Z",
"url": "https://files.pythonhosted.org/packages/6b/5c/33ff568d742768c2f00ae07027a5fbcf470eaf6c256c7df1634b3b35a60a/perpetual-0.7.3-cp312-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "19f7f40e78303ff9ab0234bbe61cbd98b751776831dc94d4ba2bea2d1f8c10d8",
"md5": "8e7854786edfe168352c311aadd5d44b",
"sha256": "56a9d5dcdd8f4a09f00bdd90c83b47fd3542a20402e7ff22e9d6efdfa79821ae"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "8e7854786edfe168352c311aadd5d44b",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 884573,
"upload_time": "2024-11-15T18:12:54",
"upload_time_iso_8601": "2024-11-15T18:12:54.169824Z",
"url": "https://files.pythonhosted.org/packages/19/f7/f40e78303ff9ab0234bbe61cbd98b751776831dc94d4ba2bea2d1f8c10d8/perpetual-0.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8cc55dc133c4603cd0d22e13acb135c883b2fb1dc0cee4579d4e9b4c34117e08",
"md5": "7a4567c4196e5546e3c804d67be5b58c",
"sha256": "43f8f024768af4acf9f314352e23bcd15b6a5acb85cf37efe702a1b4f931ed1b"
},
"downloads": -1,
"filename": "perpetual-0.7.3-cp39-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "7a4567c4196e5546e3c804d67be5b58c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 623918,
"upload_time": "2024-11-15T18:12:56",
"upload_time_iso_8601": "2024-11-15T18:12:56.176023Z",
"url": "https://files.pythonhosted.org/packages/8c/c5/5dc133c4603cd0d22e13acb135c883b2fb1dc0cee4579d4e9b4c34117e08/perpetual-0.7.3-cp39-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1efacbdc312558d90aec3b9b536675f548e997633385ef72a772389a3b2ee048",
"md5": "6f151d916ff47283f4c64eb7ecc26447",
"sha256": "c1285d4b8f3511bb0511190a5f3d5dc0fa728dd95828084816adc5b61f440c20"
},
"downloads": -1,
"filename": "perpetual-0.7.3.tar.gz",
"has_sig": false,
"md5_digest": "6f151d916ff47283f4c64eb7ecc26447",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 147353,
"upload_time": "2024-11-15T18:12:58",
"upload_time_iso_8601": "2024-11-15T18:12:58.213695Z",
"url": "https://files.pythonhosted.org/packages/1e/fa/cbdc312558d90aec3b9b536675f548e997633385ef72a772389a3b2ee048/perpetual-0.7.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 18:12:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "perpetual-ml",
"github_project": "perpetual",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "perpetual"
}