Skip to main content

No project description provided

Project description

Deep Feature Synthesis in Rust

This is a project to implement the Deep Feature Synthesis algorithm in Rust.

Running in Python

Create virtualenv

python -m venv .env
source .env/bin/activate
pip install maturin
pip install featuretools
pip install pandas

Ensure Cargo.toml is configured

[lib]
name = "rust_dfs"
crate-type = ["cdylib"]

Run maturin

maturin develop

Using from python

# Import Featuretools, rust_dfs, and some other utility functions
import featuretools as ft
from py.utils import *
import rust_dfs

# Generate a fake dataset with 2 Integer columns
df = generate_fake_dataframe(
    n_rows=10,
    col_defs=[
        ("Integer", 2),
        # ("Boolean", 2),
    ]
)

# pick some primitives
f_primitives = [
    ft.primitives.GreaterThan,
    ft.primitives.LessThan
]

# or use all of them
# f_primitives = list(ft.primitives.utils.get_transform_primitives().values())

# convert datafame to an entityset
es = df_to_es(df)

# run dfs with features_only=True
ft_feats = ft.dfs(
    entityset=es, 
    target_dataframe_name="nums", 
    trans_primitives=f_primitives, 
    features_only=True,
    max_depth=1
)

# ft_feats = [<Feature: F_0>, <Feature: F_1>, <Feature: F_0 > F_1>, <Feature: F_1 > F_0>]

# Convert back into a format that we can use to compare with rust
c_feats = convert_features(ft_feats)

# Now run using Rust

# convert featuretools primitives to rust primitives
r_primitives = convert_primitives(f_primitives)

# convert dataframe to rust features
r_features = dataframe_to_features(es.dataframes[0])

# generate engineered features using Rust (create new features only)
r_derived_feats = rust_dfs.generate_features(r_features, r_primitives)

# r_derived_feats = [GreaterThan_F_0_F_1 : Unknown : Unknown, GreaterThan_F_1_F_0 : Unknown : Unknown]

Run main.rs

To run as a rust binary:

cargo run --no-default-features

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

rust_dfs-0.1.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

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

rust_dfs-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (294.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

rust_dfs-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (293.9 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file rust_dfs-0.1.1.tar.gz.

File metadata

  • Download URL: rust_dfs-0.1.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.20

File hashes

Hashes for rust_dfs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6ee204a75784a252dcc5b8d5f0becb3fbe274a5f8d19d367194e2676ecc3ce36
MD5 27309aa0106be2bc67a76cdfc754cf08
BLAKE2b-256 2387e95b7d611f26d2546aa16c53416fd4b9cd229a424687f16b3dc0c59ec0c1

See more details on using hashes here.

File details

Details for the file rust_dfs-0.1.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_dfs-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22caede8e3467c2ae3508f6af8aa660bf4ab1355aa4a7bddf948ff9892c65e14
MD5 4be341cc60c4d13615aeff5760aff2f7
BLAKE2b-256 35e842b9c2c9637bf2baaec86c37c28c23c5a0b0dbea354499405d228c6f5e7d

See more details on using hashes here.

File details

Details for the file rust_dfs-0.1.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_dfs-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39e74c3b8b242ebff1ff6d00a08513bce13051e2af392abae7cb93af0edcbd54
MD5 20aa242039d5cabe2657db406e91664a
BLAKE2b-256 ad6321ee9e468a8055344c926948b2b2d13852f26ade397b54075f26480f805f

See more details on using hashes here.

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