| Name | galileo-forecast JSON |
| Version |
0.1.4
JSON |
| download |
| home_page | None |
| Summary | Thompson Sampling using bootstrap sampling |
| upload_time | 2024-10-20 13:55:41 |
| maintainer | None |
| docs_url | None |
| author | Niels Ota |
| requires_python | <4.0,>=3.10 |
| license | None |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Galileo Forecast
Galileo Forecast is a Python package that implements Thompson Sampling. It provides a flexible wrapper that can be used with various base model classes.
## Installation
You can install Galileo Forecast using pip:
```bash
pip install galileo-forecast
```
## Usage
To use Galileo Forecast, you need to create a wrapper for your base model class. Here's an example with LightGBM:
```python
from galileo_forecast import ThompsonSamplingWrapper
from lightgbm import LGBMClassifier
# make classification data, us sklearn make_classification
from sklearn.datasets import make_classification
# sample data with low hit rate
X, y = make_classification(n_samples=1000, n_features=10, n_informative=1, n_redundant=1, n_clusters_per_class=1, class_sep=0.1)
# create a wrapper for the LightGBM model
wrapper = ThompsonSamplingWrapper(base_model_class=LGBMClassifier, num_models=10)
# fit the wrapper
wrapper.fit(X, y)
# get the predicted probabilities for the positive class
selected_model_indices, sampled_probabilities = wrapper.predict_proba(X)
# get the fancy output dataframe - contains sampled probabilities, the sampled model and the greedy model, etc.
print(wrapper.get_fancy_output_df().head())
```
## Demo
The demo folder contains Jupyter notebooks that shows how to use the package.
Raw data
{
"_id": null,
"home_page": null,
"name": "galileo-forecast",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Niels Ota",
"author_email": "ota.niels@bcg.com",
"download_url": "https://files.pythonhosted.org/packages/7d/ce/8c3b2e16bdb3f84ca0002c57b597631d3ee290149576b3217bb373a6164d/galileo_forecast-0.1.4.tar.gz",
"platform": null,
"description": "# Galileo Forecast\n\nGalileo Forecast is a Python package that implements Thompson Sampling. It provides a flexible wrapper that can be used with various base model classes.\n\n## Installation\n\nYou can install Galileo Forecast using pip:\n\n```bash\npip install galileo-forecast\n```\n\n## Usage\n\nTo use Galileo Forecast, you need to create a wrapper for your base model class. Here's an example with LightGBM:\n\n```python\nfrom galileo_forecast import ThompsonSamplingWrapper\nfrom lightgbm import LGBMClassifier\n\n# make classification data, us sklearn make_classification\nfrom sklearn.datasets import make_classification\n\n# sample data with low hit rate\nX, y = make_classification(n_samples=1000, n_features=10, n_informative=1, n_redundant=1, n_clusters_per_class=1, class_sep=0.1)\n\n# create a wrapper for the LightGBM model \nwrapper = ThompsonSamplingWrapper(base_model_class=LGBMClassifier, num_models=10)\n\n# fit the wrapper\nwrapper.fit(X, y)\n\n# get the predicted probabilities for the positive class\nselected_model_indices, sampled_probabilities = wrapper.predict_proba(X)\n\n# get the fancy output dataframe - contains sampled probabilities, the sampled model and the greedy model, etc.\nprint(wrapper.get_fancy_output_df().head())\n\n```\n\n## Demo\n\nThe demo folder contains Jupyter notebooks that shows how to use the package.\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Thompson Sampling using bootstrap sampling",
"version": "0.1.4",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0fe19190bf0321a7ccb7051daf2603612ab5d287a298f01ab5ead805d4d03d34",
"md5": "1feae174adb00dd968eca9b06f6e9bd3",
"sha256": "709092140b5da79b0afc710a8b9f6c66942ce6abdbdb33258b6d0ef945c98610"
},
"downloads": -1,
"filename": "galileo_forecast-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1feae174adb00dd968eca9b06f6e9bd3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 22817,
"upload_time": "2024-10-20T13:55:39",
"upload_time_iso_8601": "2024-10-20T13:55:39.706860Z",
"url": "https://files.pythonhosted.org/packages/0f/e1/9190bf0321a7ccb7051daf2603612ab5d287a298f01ab5ead805d4d03d34/galileo_forecast-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7dce8c3b2e16bdb3f84ca0002c57b597631d3ee290149576b3217bb373a6164d",
"md5": "cad3f875431d9e4927190bf561eb51ce",
"sha256": "6b6679e3f81512eef9355d1772877762768805c669da17b3ce5323694a8bc2e8"
},
"downloads": -1,
"filename": "galileo_forecast-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "cad3f875431d9e4927190bf561eb51ce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 17281,
"upload_time": "2024-10-20T13:55:41",
"upload_time_iso_8601": "2024-10-20T13:55:41.255751Z",
"url": "https://files.pythonhosted.org/packages/7d/ce/8c3b2e16bdb3f84ca0002c57b597631d3ee290149576b3217bb373a6164d/galileo_forecast-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 13:55:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "galileo-forecast"
}