Skip to main content

E2E-FS Feature Selection Method

Project description

E2E-FS

E2E-FS: An End-to-End Feature Selection Method for Neural Networks

CONTACT

This project is hosted at https://github.com/braisCB/E2E-FS.

REFERENCE

If you plan to use this code, please cite the following paper:

Cancela, B., Bolón-Canedo, V., & Alonso-Betanzos, A. (2020). E2E-FS: An End-to-End Feature Selection Method for Neural Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence. (Pending on publication)

EXAMPLE OF USE (for colon dataset)

from dataset_reader import colon
import numpy as np
import e2efs


n_features_to_select = 10

if __name__ == '__main__':

    ## LOAD DATA
    dataset = colon.load_dataset()
    raw_data = np.asarray(dataset['raw']['data'])
    raw_label = np.asarray(dataset['raw']['label']).reshape(-1)
    train_data = raw_data[:int(len(raw_data) * 0.8)]
    train_label = raw_label[:int(len(raw_label) * 0.8)]
    test_data = raw_data[int(len(raw_data) * 0.8):]
    test_label = raw_label[int(len(raw_label) * 0.8):]
    normalize = colon.Normalize()
    train_data = normalize.fit_transform(train_data)
    test_data = normalize.transform(test_data)

    ## LOAD E2EFSSoft model
    model = e2efs.E2EFSSoft(n_features_to_select=n_features_to_select)

    ## OPTIONAL: Load E2EFS Model
    # model = e2efs.E2EFS(n_features_to_select=n_features_to_select)

    ## OPTIONAL: Load E2EFSRanking Model
    # model = e2efs.E2EFSRanking()

    ## FIT THE SELECTION
    model.fit(train_data, train_label, validation_data=(test_data, test_label), batch_size=2, max_epochs=2000)

    ## FINETUNE THE MODEL
    model.fine_tune(train_data, train_label, validation_data=(test_data, test_label), batch_size=2, max_epochs=100)

    ## GET THE MODEL RESULTS
    metrics = model.evaluate(test_data, test_label)
    print(metrics)

    ## GET THE MASK
    mask = model.get_mask()
    print('MASK:', mask)

    ## GET THE RANKING
    ranking = model.get_ranking()
    print('RANKING:', ranking)

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

e2efs-1.0.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

e2efs-1.0.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: e2efs-1.0.1.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for e2efs-1.0.1.tar.gz
Algorithm Hash digest
SHA256 fda6ad7d1b7d02cf73d6d5c6ea9e5bbd7e47a2c6990f0ebaf71e0ae777812380
MD5 3dba917ca32be63213d375f7e70a9f0a
BLAKE2b-256 1e949c58868390958ecde5d324a2221d2e5b5d2373a774ec6b4db4b4ee79a0ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: e2efs-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for e2efs-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfe2779fbf8a3bc40f80a48ffd7a7c08a061f9716e8a3762b40dee51a2ccbd8b
MD5 68306d749d703433650512d14ccc18ab
BLAKE2b-256 fa0130445223e94e4043643f2c63f154572294769b83dbba8b59be253012fd21

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