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)
Metadata
Release files for e2efs 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| e2efs-1.0.1.tar.gz | 32.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| e2efs-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.5 kB
Release files / e2efs-1.0.1.tar.gz
| Download URL | e2efs-1.0.1.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fda6ad7d1b7d02cf73d6d5c6ea9e5bbd7e47a2c6990f0ebaf71e0ae777812380
|
|
BLAKE2b-256 checksum How to use checksums |
1e949c58868390958ecde5d324a2221d2e5b5d2373a774ec6b4db4b4ee79a0ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.14
|
Release files / e2efs-1.0.1-py3-none-any.whl
| Download URL | e2efs-1.0.1-py3-none-any.whl |
|---|---|
| Size | 34.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfe2779fbf8a3bc40f80a48ffd7a7c08a061f9716e8a3762b40dee51a2ccbd8b
|
|
BLAKE2b-256 checksum How to use checksums |
fa0130445223e94e4043643f2c63f154572294769b83dbba8b59be253012fd21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.14
|