Skip to main content

A novel approach for Semi-Dynamic Feature Sets (SDFS)

Project description

Semi-Dynamic Feature Set (SDFS)

The Semi-Dynamic Feature Set (SDFS) is a novel approach to combining static and dynamic features in machine learning models. This package provides an implementation of the SDFS model along with utilities for expanding feature sets using dynamic methods like PCA and mean-variance initialization.

This method is designed to enhance machine learning models by dynamically updating feature sets, which is particularly useful for improving performance in relevant scenarios such as classification tasks.

Features

  • Implements the SDFS model for combining static and dynamic features.
  • Supports dynamic feature initialization using:
    • Principal Component Analysis (PCA)
    • Mean and Variance based initialization
    • Random initialization
  • Includes methods for:
    • Training models with dynamic features
    • Expanding test datasets based on closest dynamic feature matches
    • Concatenating feature sets for better model performance.

Installation

To install the SDFS package, use pip:

pip install sdfs

Usage

Once installed, you can use the sdfs function to expand your feature sets and train the model. Here’s a simple usage example:

from sdfs.feature_expansion import sdfs

# Assuming you have train, validation, and test sets ready:
extended_X_train, extended_X_val, extended_X_test = sdfs(
    X_train, X_val, X_test, y_train, y_val, y_test, 
    dynamic_input_size=5, init_method='PCA', distance_method='minkowski'
)

Parameters:

  • X_train, X_val, X_test: Training, validation, and test feature sets.
  • y_train, y_val, y_test: Corresponding labels for the feature sets.
  • dynamic_input_size: The size of the dynamic feature vector to be concatenated.
  • init_method: Method to initialize dynamic features, choose from:
    • PCA: Principal Component Analysis for dimensionality reduction.
    • mean_std: Initialization based on mean and variance of training features.
    • random: Random initialization of dynamic features.
  • distance_method: Method for calculating distances to dynamically expand test sets, choose from:
    • euclidean
    • manhattan
    • minkowski
    • cosine

Example Workflow

Here’s an example of how to use the SDFS package in a typical workflow:

  1. Initialize dynamic features using PCA or other methods.
  2. Expand the feature sets by concatenating the static and dynamic features.
  3. Train the SDFS model on the expanded feature sets.
  4. Evaluate the model on validation and test sets by expanding those feature sets similarly.
# Example usage
from sdfs.feature_expansion import sdfs

# Define your datasets
X_train, X_val, X_test = ...
y_train, y_val, y_test = ...

# Expand feature sets and train the model
expanded_X_train, expanded_X_val, expanded_X_test = sdfs(
    X_train, X_val, X_test, y_train, y_val, y_test, 
    dynamic_input_size=10, init_method='PCA', distance_method='minkowski'
)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

This package was implemented for a relevant research project, aimed at exploring semi-dynamic feature sets to enhance the flexibility and accuracy of machine learning models.

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

sdfs-1.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

sdfs-1.0.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file sdfs-1.0.1.tar.gz.

File metadata

  • Download URL: sdfs-1.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for sdfs-1.0.1.tar.gz
Algorithm Hash digest
SHA256 63f37581e5caa7eecee52c355b6198cdb9f6b560268b4ca0212ee9aa19a51d0c
MD5 23d70f903e157260a8cbe5430d31a518
BLAKE2b-256 402328c8d9c911bdc64237f312478c6b37f2c9f543a8966ae73102e711280251

See more details on using hashes here.

File details

Details for the file sdfs-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sdfs-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for sdfs-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c31e9de9871b260489a45359c5fef661f1746f46db3863dab42b1baf70b6717
MD5 d03fcf85f7db9945d2062a994f482acb
BLAKE2b-256 dd5eda694aa7296bf0b506961461fe1c2f606f116358f84c03bb6fe3cf322451

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page