Skip to main content

Ensemble dataset generator for tabular data prediction and modeling projects.

Project description

EnsembleSet

PyPI release Python CIDevcontainer

EnsembleSet generates dataset ensembles by applying a randomized sequence of feature engineering methods to a randomized subset of input features.

1. Installation

Install the pre-release alpha from PyPI with:

pip install ensembleset

2. Usage

See the example usage notebook.

Initialize an EnsembleSet class instance, passing in the label name and training DataFrame. Optionally, include a test DataFrame and/or list of any string features and the path where you want EnsembleSet to put data. Then call the make_datasets() to generate an EnsembleSet, specifying:

  1. The number of individual datasets to generate.
  2. The fraction of features to randomly select for each feature engineering step.
  3. The number of feature engineering steps to run.
import ensembleset.dataset as ds

data_ensemble=ds.DataSet(
    label='label_column_name',                       # Required
    train_data=train_df,                             # Required
    test_data=test_df,                               # Optional, defaults to None
    string_features=['string_feature_column_names'], # Optional, defaults to None
    data_directory='path/to/ensembleset/data'        # Optional, defaults to ./data
)

data_ensemble.make_datasets(
    n_datasets=10,         # Required
    fraction_features=0.1, # Required
    n_steps=5              # Required
)

The above call to make_datasets() will generate 10 different datasets using a random sequence of 5 feature engineering techniques applied to a randomly selected 10% of features. The feature selection is re-calculated after each feature engineering step. Each feature engineering step is applied to the test set if one is provided with a minimum of data leakage (e.g. gaussian KDE is calculated from training data only and then applied to training and testing data).

By default, generated datasets will be saved to HDF5 in data/dataset.h5 using the following structure:

dataset.h5
├──train
│   ├── labels
|   ├── 1
|   ├── .
|   ├── .
|   ├── .
|   └── n
│
└──test
    ├── labels
    ├── 1
    ├── .
    ├── .
    ├── .
    └── n

3. Feature engineering

The currently implemented pool of feature engineering methods are:

  1. One-hot encoding for string features
  2. Ordinal encoding for string features
  3. Log features with bases 2, e or 10
  4. Ratio features
  5. Exponential features with base 2 or e
  6. Sum features with 2, 3, or 4
  7. Difference features with 2, 3 or 4 subtrahends
  8. Polynomial features with degree 2 or 3
  9. Spline features with degree 2, 3 or 4
  10. Quantized features with using randomly selected k-bins
  11. Smoothed features with gaussian kernel density estimation

Major feature engineering parameters are also randomly selected for each step.

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

ensembleset-1.0a18.tar.gz (8.6 MB view details)

Uploaded Source

Built Distribution

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

ensembleset-1.0a18-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file ensembleset-1.0a18.tar.gz.

File metadata

  • Download URL: ensembleset-1.0a18.tar.gz
  • Upload date:
  • Size: 8.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ensembleset-1.0a18.tar.gz
Algorithm Hash digest
SHA256 889105c4af37fb8d13f0cea3d8657c5810e3bcf86d51f46a253e77b6e5dca4ed
MD5 aeb1c40b9305753c5bab7fa305875128
BLAKE2b-256 e1aea5f2e07d99e2330c6b91b1deb8206e26f1ed9bb23c50d3dfeaef9cb690d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ensembleset-1.0a18.tar.gz:

Publisher: publish_pypi.yml on gperdrizet/ensembleset

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

File details

Details for the file ensembleset-1.0a18-py3-none-any.whl.

File metadata

  • Download URL: ensembleset-1.0a18-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ensembleset-1.0a18-py3-none-any.whl
Algorithm Hash digest
SHA256 fc5ff66a0a9527427366ff7fe37df3a87e3f991b780377461c8fc608e39852b0
MD5 47f0f23b41575444ae8875820b566f95
BLAKE2b-256 1f9fb88b6050b199db8c2dcaee14e3bee93c83ed2722f8d44e4b11b95a91b67d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ensembleset-1.0a18-py3-none-any.whl:

Publisher: publish_pypi.yml on gperdrizet/ensembleset

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