tubular


Nametubular JSON
Version 1.4.0 PyPI version JSON
download
home_pageNone
SummaryPackage to perform pre processing steps for machine learning models
upload_time2024-10-15 09:03:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2021, Liverpool Victoria General Insurance Group. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords data science feature engineering data transforms pipeline sklearn machine learning ml ds
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://github.com/lvgig/tubular/raw/main/logo.png">
</p>

Tubular pre-processing for machine learning!

----

![PyPI](https://img.shields.io/pypi/v/tubular?color=success&style=flat)
![Read the Docs](https://img.shields.io/readthedocs/tubular)
![GitHub](https://img.shields.io/github/license/lvgig/tubular)
![GitHub last commit](https://img.shields.io/github/last-commit/lvgig/tubular)
![GitHub issues](https://img.shields.io/github/issues/lvgig/tubular)
![Build](https://github.com/lvgig/tubular/actions/workflows/python-package.yml/badge.svg?branch=main)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lvgig/tubular/HEAD?labpath=examples)

`tubular` implements pre-processing steps for tabular data commonly used in machine learning pipelines.

The transformers are compatible with [scikit-learn](https://scikit-learn.org/) [Pipelines](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html). Each has a `transform` method to apply the pre-processing step to data and a `fit` method to learn the relevant information from the data, if applicable.

The transformers in `tubular` work with data in [pandas](https://pandas.pydata.org/) [DataFrames](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html).

There are a variety of transformers to assist with;

- capping
- dates
- imputation
- mapping
- categorical encoding
- numeric operations

Here is a simple example of applying capping to two columns;

```python
from tubular.capping import CappingTransformer
import pandas as pd
from sklearn.datasets import fetch_california_housing

# load the california housing dataset
cali = fetch_california_housing()
X = pd.DataFrame(cali['data'], columns=cali['feature_names'])

# initialise a capping transformer for 2 columns
capper = CappingTransformer(capping_values = {'AveOccup': [0, 10], 'HouseAge': [0, 50]})

# transform the data
X_capped = capper.transform(X)
```

## Installation

The easiest way to get `tubular` is directly from [pypi](https://pypi.org/project/tubular/) with;

 `pip install tubular`

## Documentation

The documentation for `tubular` can be found on [readthedocs](https://tubular.readthedocs.io/en/latest/).

Instructions for building the docs locally can be found in [docs/README](https://github.com/lvgig/tubular/blob/main/docs/README.md).

## Examples

To help get started there are example notebooks in the [examples](https://github.com/lvgig/tubular/tree/main/examples) folder in the repo that show how to use each transformer.

To open the example notebooks in [binder](https://mybinder.org/) click [here](https://mybinder.org/v2/gh/lvgig/tubular/HEAD?labpath=examples) or click on the `launch binder` shield above and then click on the directory button in the side bar to the left to navigate to the specific notebook.

## Issues

For bugs and feature requests please open an [issue](https://github.com/lvgig/tubular/issues).

## Build and test

The test framework we are using for this project is [pytest](https://docs.pytest.org/en/stable/). To build the package locally and run the tests follow the steps below.

First clone the repo and move to the root directory;

```shell
git clone https://github.com/lvgig/tubular.git
cd tubular
```

Next install `tubular` and development dependencies;

```shell
pip install . -r requirements-dev.txt
```

Finally run the test suite with `pytest`;

```shell
pytest
```

## Contribute

`tubular` is under active development, we're super excited if you're interested in contributing! 

See the [CONTRIBUTING](https://github.com/lvgig/tubular/blob/main/CONTRIBUTING.rst) file for the full details of our working practices.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tubular",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "data science, feature engineering, data transforms, pipeline, sklearn, machine learning, ML, DS",
    "author": null,
    "author_email": "LV GI Data Science Team <#DataSciencePackages@lv.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/3e/fb/1d4d37b9a1f2f376321d6f969bb231b7dd780e455b9a9a37399e6b783097/tubular-1.4.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"https://github.com/lvgig/tubular/raw/main/logo.png\">\n</p>\n\nTubular pre-processing for machine learning!\n\n----\n\n![PyPI](https://img.shields.io/pypi/v/tubular?color=success&style=flat)\n![Read the Docs](https://img.shields.io/readthedocs/tubular)\n![GitHub](https://img.shields.io/github/license/lvgig/tubular)\n![GitHub last commit](https://img.shields.io/github/last-commit/lvgig/tubular)\n![GitHub issues](https://img.shields.io/github/issues/lvgig/tubular)\n![Build](https://github.com/lvgig/tubular/actions/workflows/python-package.yml/badge.svg?branch=main)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lvgig/tubular/HEAD?labpath=examples)\n\n`tubular` implements pre-processing steps for tabular data commonly used in machine learning pipelines.\n\nThe transformers are compatible with [scikit-learn](https://scikit-learn.org/) [Pipelines](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html). Each has a `transform` method to apply the pre-processing step to data and a `fit` method to learn the relevant information from the data, if applicable.\n\nThe transformers in `tubular` work with data in [pandas](https://pandas.pydata.org/) [DataFrames](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html).\n\nThere are a variety of transformers to assist with;\n\n- capping\n- dates\n- imputation\n- mapping\n- categorical encoding\n- numeric operations\n\nHere is a simple example of applying capping to two columns;\n\n```python\nfrom tubular.capping import CappingTransformer\nimport pandas as pd\nfrom sklearn.datasets import fetch_california_housing\n\n# load the california housing dataset\ncali = fetch_california_housing()\nX = pd.DataFrame(cali['data'], columns=cali['feature_names'])\n\n# initialise a capping transformer for 2 columns\ncapper = CappingTransformer(capping_values = {'AveOccup': [0, 10], 'HouseAge': [0, 50]})\n\n# transform the data\nX_capped = capper.transform(X)\n```\n\n## Installation\n\nThe easiest way to get `tubular` is directly from [pypi](https://pypi.org/project/tubular/) with;\n\n `pip install tubular`\n\n## Documentation\n\nThe documentation for `tubular` can be found on [readthedocs](https://tubular.readthedocs.io/en/latest/).\n\nInstructions for building the docs locally can be found in [docs/README](https://github.com/lvgig/tubular/blob/main/docs/README.md).\n\n## Examples\n\nTo help get started there are example notebooks in the [examples](https://github.com/lvgig/tubular/tree/main/examples) folder in the repo that show how to use each transformer.\n\nTo open the example notebooks in [binder](https://mybinder.org/) click [here](https://mybinder.org/v2/gh/lvgig/tubular/HEAD?labpath=examples) or click on the `launch binder` shield above and then click on the directory button in the side bar to the left to navigate to the specific notebook.\n\n## Issues\n\nFor bugs and feature requests please open an [issue](https://github.com/lvgig/tubular/issues).\n\n## Build and test\n\nThe test framework we are using for this project is [pytest](https://docs.pytest.org/en/stable/). To build the package locally and run the tests follow the steps below.\n\nFirst clone the repo and move to the root directory;\n\n```shell\ngit clone https://github.com/lvgig/tubular.git\ncd tubular\n```\n\nNext install `tubular` and development dependencies;\n\n```shell\npip install . -r requirements-dev.txt\n```\n\nFinally run the test suite with `pytest`;\n\n```shell\npytest\n```\n\n## Contribute\n\n`tubular` is under active development, we're super excited if you're interested in contributing! \n\nSee the [CONTRIBUTING](https://github.com/lvgig/tubular/blob/main/CONTRIBUTING.rst) file for the full details of our working practices.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2021, Liverpool Victoria General Insurance Group. All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "Package to perform pre processing steps for machine learning models",
    "version": "1.4.0",
    "project_urls": {
        "Changelog": "https://github.com/lvgig/tubular/CHANGELOG.md",
        "Documentation": "https://tubular.readthedocs.io/en/latest/index.html",
        "Issues": "https://github.com/lvgig/tubular/issues",
        "Repository": "https://github.com/lvgig/tubular"
    },
    "split_keywords": [
        "data science",
        " feature engineering",
        " data transforms",
        " pipeline",
        " sklearn",
        " machine learning",
        " ml",
        " ds"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6d76eb1b7b5af1afcf63eef358e16a893c9d5579231033df443442a0f58da7b",
                "md5": "28c349a1a2b4011719238fcf9a09599a",
                "sha256": "d5a2a6c017140f0a9699899642257754915b816d60191bbfab7a4865feb403de"
            },
            "downloads": -1,
            "filename": "tubular-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28c349a1a2b4011719238fcf9a09599a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 49933,
            "upload_time": "2024-10-15T09:03:06",
            "upload_time_iso_8601": "2024-10-15T09:03:06.587244Z",
            "url": "https://files.pythonhosted.org/packages/f6/d7/6eb1b7b5af1afcf63eef358e16a893c9d5579231033df443442a0f58da7b/tubular-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3efb1d4d37b9a1f2f376321d6f969bb231b7dd780e455b9a9a37399e6b783097",
                "md5": "b0468464760fd5fca4ccdcb4a7afda22",
                "sha256": "a75349ec0907f3a1873eddb9cac3b60eb446ea615843a01db6cab46550d8ad25"
            },
            "downloads": -1,
            "filename": "tubular-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b0468464760fd5fca4ccdcb4a7afda22",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 806577,
            "upload_time": "2024-10-15T09:03:08",
            "upload_time_iso_8601": "2024-10-15T09:03:08.801189Z",
            "url": "https://files.pythonhosted.org/packages/3e/fb/1d4d37b9a1f2f376321d6f969bb231b7dd780e455b9a9a37399e6b783097/tubular-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-15 09:03:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lvgig",
    "github_project": "tubular",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tubular"
}
        
Elapsed time: 0.54834s