Skip to main content

TRUST-GFS feature selection for tabular classification

Project description

trustgfs

trustgfs packages the TRUST-GFS feature selector for tabular classification.

It supports two input modes:

  1. fit(X_train, y_train)

    • the package creates an outer train/validation split internally
    • then runs TRUST-GFS on the recombined outer split, matching the locked script behavior
  2. fit(X_train, y_train, X_val, y_val)

    • the package directly combines train and validation
    • then runs TRUST-GFS on that combined data

The implementation preserves the locked TRUST-GFS-only logic, including:

  • Stage 1 bootstrap evidence scoring
  • null-threshold zoning into Strong / Mid / Weak
  • Soft-Weak rescue against Strong anchors
  • Stage 2 occlusion energy/support analysis
  • feasible add-on pool selection
  • genetic search over add-on subsets
  • final selected subset output

Installation

Local editable install

pip install -e .

From GitHub later

pip install "trustgfs @ git+https://github.com/YOUR_USERNAME/trustgfs.git"

From PyPI later

pip install trustgfs

Quick usage

from trustgfs import TRUSTGFSSelector

selector = TRUSTGFSSelector(feature_names=feature_names)
selector.fit(X_train, y_train)

print(selector.selected_features_)
X_selected = selector.transform(X_train)

With explicit validation data:

from trustgfs import TRUSTGFSSelector

selector = TRUSTGFSSelector(feature_names=feature_names)
selector.fit(X_train, y_train, X_val=X_val, y_val=y_val)

print(selector.selected_features_)

Convenience function

from trustgfs import run_trust_gfs

selected_idx, info = run_trust_gfs(
    X_train=X_train,
    y_train=y_train,
    feature_names=feature_names,
)

This prints only:

  • TRUST_GFS_STAGE1_FLOW_COUNTS
  • TRUST_GFS_STAGE1_GROUP_FEATURES
  • TRUST_GFS_FINAL_SELECTED_FEATURES

Notes

  • For exact old TRUST-GFS behavior, y should already be integer-encoded as 0..C-1.
  • transform() returns the selected columns from the given matrix.
  • The package does not include the older benchmark feature selectors or model-comparison loop.

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

trustgfs-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

trustgfs-0.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file trustgfs-0.1.0.tar.gz.

File metadata

  • Download URL: trustgfs-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for trustgfs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a516fbb6bee646efb45fd245609a7a81118a8ad9b62566df59ccd7a70e8843b
MD5 138ed50c0011f0f173d575bd7b08a03f
BLAKE2b-256 6162c71891f78abbffcefa305e4109437d749f7a7de8e4188db0d4658a90889c

See more details on using hashes here.

File details

Details for the file trustgfs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trustgfs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for trustgfs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f2d46e597c78ba256d02281c2b3c3beb3f81cf9fd42824e090fab01bb369adb
MD5 d814590f5fe3989dfc1ed834b05488e1
BLAKE2b-256 34d6c892695f249c21526126c9539781281137d7cdf1b0830b90d1d4c8fcf80a

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