Skip to main content
Tests

Deep Feature Synthesis in Rust

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

Roadmap

  • (30JUL20221) Parity with Featuretools creating feature definitions (no calculation) on single table
  • Parity with Featuretools creating feature definitions (no calculation) on multiple tables
  • Explore Calculation on single table using Polars
  • Explore Calculation on multiple tables using Polars

Running in Python

pip install rust_dfs

Using from python

# Import Featuretools, rust_dfs, and some other utility functions
import featuretools as ft
from rust_dfs.utils import *
from rust_dfs import generate_features, compare_featuresets, Feature
from rust_dfs.generate_fake_dataframe import generate_pandas_fake_dataframe

# Generate a fake dataset with 4 Numeric columns
df = generate_pandas_fake_dataframe(
    n_rows=10,
    col_defs=[
        ("Numeric", 4),
    ]
)

# 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 = list(convert_features(ft_feats).values())

# 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 = generate_features(r_features, r_primitives)


a,b = compare_featuresets(c_feats, r_derived_feats)

print("=== Features generated by Featuretools, that were NOT generated by Rust ===")
print(a)
print()
print("=== Features generated by Rust, that were NOT generated by Featuretools ===")
print(b)


# Persist Rust Features to disk
Feature.save_features(r_derived_feats, "all_features.json")

Develop Guide

Install pipenv

pip install pipenv
pipenv install
pipenv shell

Ensure Cargo.toml is configured

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

Run maturin

maturin develop

Run main.rs

To run as a rust binary:

cargo run --no-default-features

Test

cargo test --no-default-features

Why --no-default-features? Because we are using pyo3 and is describe here:

Finally, don't forget that on MacOS the extension-module feature will cause cargo test to fail without the --no-default-features flag (see the FAQ).

  1. 3 primitives are not yet passing tests. 'diff_datetime', 'geomidpoint', 'age' ↩

Metadata

Release files for rust-dfs 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rust-dfs 0.3.0
File Size Uploaded
rust_dfs-0.3.0.tar.gz 150.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rust-dfs 0.3.0
File
rust_dfs-0.3.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.17+ x86-64 Details
rust_dfs-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
rust_dfs-0.3.0-cp311-cp311-macosx_10_7_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.7+ x86-64 Details
rust_dfs-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
rust_dfs-0.3.0-cp310-cp310-macosx_10_7_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.7+ x86-64 Details
rust_dfs-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
rust_dfs-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.7+ x86-64 Details
rust_dfs-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
rust_dfs-0.3.0-cp38-cp38-macosx_10_7_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.7+ x86-64 Details
rust_dfs-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details

Total release size: 4.0 MB

Release files / rust_dfs-0.3.0.tar.gz

Download URL rust_dfs-0.3.0.tar.gz
Size 150.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e35686444e846903a33f27291b6ae9dbaac0e991af2a0a1ebce3c643b3f79b49
BLAKE2b-256 checksum
How to use checksums
89509bd8e97ab94bc091f2a00c519ca7316530310b48deb450eff504d8b92638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rust_dfs-0.3.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 407.1 kB
Tags Linux glibc 2.17+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
3791c290ca42ab3ee84914a48d7ab2fd0d1c9792d5cbbdd6f58dd377a164415f
BLAKE2b-256 checksum
How to use checksums
8cf74a365d27d405b617310c075b892afc3115e3afa6e5114a5fe935cd038d88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rust_dfs-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 403.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
70f12981c9fa02bc8ff6b719f3de2555761260b84224b05deaccfefa3ba65169
BLAKE2b-256 checksum
How to use checksums
f2d378afec24aecd4e967dbe2b74fa5a0d2d6a212fd5d73bd36fe7bb585036f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp311-cp311-macosx_10_7_x86_64.whl

Download URL rust_dfs-0.3.0-cp311-cp311-macosx_10_7_x86_64.whl
Size 363.4 kB
Tags CPython 3.11 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
61a6e91470b2d6555d71c8405feb0ed1bfbc8c659eef5c096dae5f970191f109
BLAKE2b-256 checksum
How to use checksums
2b377bb5d5e6dfae7b9c136aec248398587a8c2ed11e5fc7ab6396d2288bb805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rust_dfs-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 403.8 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
76470315fed4efa1a30645cd661b03a65f7211aa3005bfa9573d1fef8e2b7c1a
BLAKE2b-256 checksum
How to use checksums
4d0a27614a9f3c91c1a8e6efce440fe55ea2d9a45dc3c8f8852ee9caeda07fb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp310-cp310-macosx_10_7_x86_64.whl

Download URL rust_dfs-0.3.0-cp310-cp310-macosx_10_7_x86_64.whl
Size 363.4 kB
Tags CPython 3.10 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
ec8190e044824a7aa5419150635b9e3b47f518b51ffc607d62302008160c085b
BLAKE2b-256 checksum
How to use checksums
07e51d49a181e8a6ae687659da7b5ee31a4cf87cecab2fcbb55638807e987f34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rust_dfs-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 403.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0d5aeb0c0d4d9ed74618f0f5c71cc12285876d56d1502aee3639d02a8ab249f8
BLAKE2b-256 checksum
How to use checksums
69018d64c661318926ad0476bbbfeccf66f59692bef35624ef1588c4b3bf1e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl

Download URL rust_dfs-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl
Size 363.6 kB
Tags CPython 3.9 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
32531540335d2d3894b054e01036e9fb46947d7dbe15236dfb186bf2f5d7ceb3
BLAKE2b-256 checksum
How to use checksums
c86c8dfa05519b8acd936cb5107781241531f84c8fbe09eaa937058eca8cd362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rust_dfs-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 403.9 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
317e4297489fb80daedd37ccca340b112b8635b7bf6188569f5ed7a5f3e508bf
BLAKE2b-256 checksum
How to use checksums
bdda136b546c127db47dfe6b7b34ade7eaf8842d44073ccf5d762b0ab3986223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp38-cp38-macosx_10_7_x86_64.whl

Download URL rust_dfs-0.3.0-cp38-cp38-macosx_10_7_x86_64.whl
Size 363.5 kB
Tags CPython 3.8 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
d2f0038db64f25d62d954716f325bee4f4ab8d4f0d71fc7fc8f8243caf678dbd
BLAKE2b-256 checksum
How to use checksums
5f261335382c3e91bc9a8470466c078d37b89f91e32d4d1b86eedd865e017cca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release files / rust_dfs-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rust_dfs-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 404.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
084778daf0091eec76830b929e4bb5775d433a9a9ffa0a45d44bb1c75de8b68d
BLAKE2b-256 checksum
How to use checksums
24fef981176657908ba84e921ae86373c796c7fc78d6acbeb444940e9ffa02f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.20

Release history Release notifications | RSS feed

This release

0.3.0 This release

11 release files

0.2.0

11 release files

0.1.6

13 release files

0.1.5

12 release files

0.1.4

2 release files

0.1.3

4 release files

0.1.2

3 release files

0.1.1

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page