Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritam Guha authored and Ritam Guha committed Nov 1, 2020
1 parent 7858c88 commit 345bd7d
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 14 deletions.
66 changes: 65 additions & 1 deletion Py_FS.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Py-FS
Version: 0.0.5.9
Version: 0.0.5.10
Summary: A Python Package for Feature Selection
Home-page: https://github.com/Ritam-Guha/Py_FS
Author: Ritam Guha
Expand Down Expand Up @@ -64,6 +64,70 @@ Description: # Py_FS: A Python Package for Feature Selection
## Quick User Guide
For a quicl demonstration of the process of using Py_FS, please proceed to this Colab link: [Py_FS: Demonstration](https://colab.research.google.com/drive/1PafNTmVgWv9Qz6j7bI41XqPT6CCCIb1T?usp=sharing).

## References
This toolbox has been developed by a team of students from [Computer Science and Engineering department, Jadavpur University](http://www.jaduniv.edu.in/view_department.php?deptid=59) supervised by [Prof. Ram Sarkar](http://www.jaduniv.edu.in/profile.php?uid=686). This team has participated in many research activities related to engineering optimization, feature selection and image processing. We request the users of Py_FS to cite the relevant articles from our group. It will mean a lot to us. The articles produced by this team are mentioned below:

### Wrappers

#### BBA

#### CS

#### EO

#### GA

* Guha, R., Ghosh, M., Kapri, S., Shaw, S., Mutsuddi, S., Bhateja, V., & Sarkar, R. (2019). Deluge based Genetic Algorithm for feature selection. Evolutionary intelligence, 1-11.

* Ghosh, M., Guha, R., Mondal, R., Singh, P. K., Sarkar, R., & Nasipuri, M. (2018). Feature selection using histogram-based multi-objective GA for handwritten Devanagari numeral recognition. In Intelligent engineering informatics (pp. 471-479). Springer, Singapore.

* Guha, R., Ghosh, M., Singh, P. K., Sarkar, R., & Nasipuri, M. (2019). M-HMOGA: a new multi-objective feature selection algorithm for handwritten numeral classification. Journal of Intelligent Systems, 29(1), 1453-1467.

* Ghosh, M., Guha, R., Singh, P. K., Bhateja, V., & Sarkar, R. (2019). A histogram based fuzzy ensemble technique for feature selection. Evolutionary Intelligence, 12(4), 713-724.

* Ghosh, M., Guha, R., Alam, I., Lohariwal, P., Jalan, D., & Sarkar, R. (2019). Binary Genetic Swarm Optimization: A Combination of GA and PSO for Feature Selection. Journal of Intelligent Systems, 29(1), 1598-1610.

* Guha, R., Khan, A.H., Singh, P.K. et al. CGA: a new feature selection model for visual human action recognition. Neural Comput & Applic (2020). https://doi.org/10.1007/s00521-020-05297-5

#### GSA

* Guha, R., Ghosh, M., Chakrabarti, A., Sarkar, R., & Mirjalili, S. (2020). Introducing clustering based population in Binary Gravitational Search Algorithm for Feature Selection. Applied Soft Computing, 106341.

#### GWO

#### HS

#### MA

#### PSO

* Ghosh, M., Guha, R., Singh, P. K., Bhateja, V., & Sarkar, R. (2019). A histogram based fuzzy ensemble technique for feature selection. Evolutionary Intelligence, 12(4), 713-724.

* Ghosh, M., Guha, R., Alam, I., Lohariwal, P., Jalan, D., & Sarkar, R. (2019). Binary Genetic Swarm Optimization: A Combination of GA and PSO for Feature Selection. Journal of Intelligent Systems, 29(1), 1598-1610.

#### RDA

#### SCA

#### WOA

* Guha, R., Ghosh, M., Mutsuddi, S., Sarkar, R., & Mirjalili, S. (2020). Embedded chaotic whale survival algorithm for filter-wrapper feature selection. arXiv preprint arXiv:2005.04593.

### Filters

#### PCC

* Guha, R., Ghosh, K. K., Bhowmik, S., & Sarkar, R. (2020, February). Mutually Informed Correlation Coefficient (MICC)-a New Filter Based Feature Selection Method. In 2020 IEEE Calcutta Conference (CALCON) (pp. 54-58). IEEE.

#### SCC

#### MI

* Guha, R., Ghosh, K. K., Bhowmik, S., & Sarkar, R. (2020, February). Mutually Informed Correlation Coefficient (MICC)-a New Filter Based Feature Selection Method. In 2020 IEEE Calcutta Conference (CALCON) (pp. 54-58). IEEE.

#### Relief


## 1. Wrapper-based Nature-inpsired Feature Selection
Wrapper-based Nature-inspired methods are very popular feature selection approaches due to their efficiency and simplicity. These methods progress by introducing random set of candidate solutions (agents which are natural elements like particles, whales, bats etc.) and improving these solutions gradually by using guidance mechanisms of fitter agents. In order to calculate the fitness of the candidate solutions, wrappers require some learning algorithm (like classifiers) to calculate the worth of a solution at every iteration. This makes wrapper methods extremely reliable but computationally expensive as well.

Expand Down
4 changes: 3 additions & 1 deletion Py_FS.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ Py_FS/wrapper/nature_inspired/__pycache__/WOA.cpython-38.pyc
Py_FS/wrapper/nature_inspired/__pycache__/__init__.cpython-38.pyc
Py_FS/wrapper/nature_inspired/__pycache__/_transfer_functions.cpython-38.pyc
Py_FS/wrapper/nature_inspired/__pycache__/_transformation_functions.cpython-38.pyc
Py_FS/wrapper/nature_inspired/__pycache__/_utilities.cpython-38.pyc
Py_FS/wrapper/nature_inspired/__pycache__/_utilities.cpython-38.pyc
dist/Py_FS-0.0.5.9-py3-none-any.whl
dist/Py_FS-0.0.5.9.tar.gz
Binary file modified Py_FS/evaluation/__pycache__/_utilities.cpython-38.pyc
Binary file not shown.
26 changes: 16 additions & 10 deletions Py_FS/evaluation/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@
class Metric():
# class for defining the evaluation metrics
def __init__(self, train_X, test_X, train_Y, test_Y, agent, classifier, save_conf_mat):
self.train_X = train_X
self.test_X = test_X

self.agent = agent
if self.agent is None:
self.agent = np.ones(train_X.shape[1])

cols = np.flatnonzero(self.agent)
if(cols.shape[0] == 0):
print('[Error!] There are 0 features in the agent......')
exit(1)

self.train_X = train_X[:, cols]
self.test_X = test_X[:, cols]
self.train_Y = train_Y
self.test_Y = test_Y
self.classifier = classifier
Expand All @@ -27,8 +37,7 @@ def __init__(self, train_X, test_X, train_Y, test_Y, agent, classifier, save_con
print('\n[Error!] We don\'t currently support {} classifier...\n'.format(classifier))
exit(1)

if(agent == None):
self.agent = np.ones(train_X.shape[1])

self.predictions = self.classify()
self.accuracy = self.compute_accuracy()
self.precision = self.compute_precision()
Expand All @@ -40,13 +49,10 @@ def __init__(self, train_X, test_X, train_Y, test_Y, agent, classifier, save_con

def classify(self):
# function to predict the labels for the test samples
cols = np.flatnonzero(self.agent)
if(cols.shape[0] == 0):
return 0

train_data = self.train_X[:,cols]

train_data = self.train_X
train_label = self.train_Y
test_data = self.test_X[:,cols]
test_data = self.test_X

self.clf.fit(train_data,train_label)
predictions = self.clf.predict(test_data)
Expand Down
7 changes: 6 additions & 1 deletion Py_FS/evaluation/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from sklearn import datasets

from Py_FS.evaluation._utilities import Metric
# from _utilities import Metric

import numpy as np

Expand All @@ -14,4 +15,8 @@ def evaluate(train_X, test_X, train_Y, test_Y, agent=None, classifier='knn', sav
if __name__ == "__main__":
iris = datasets.load_iris()
train_X, test_X, train_Y, test_Y = train_test_split(iris.data, iris.target, stratify=iris.target, test_size=0.2)
evaluate(train_X, test_X, train_Y, test_Y, save_conf_mat=True)
num_features = iris.data.shape[1]
agent = np.ones(num_features)
agent[0] = agent[2] = 0
result = evaluate(train_X, test_X, train_Y, test_Y, agent, save_conf_mat=True)
print(result.confusion_matrix)
1 change: 1 addition & 0 deletions build/lib/Py_FS/evaluation/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np
import matplotlib.pyplot as plt
import sys

class Metric():
# class for defining the evaluation metrics
Expand Down
Binary file added dist/Py_FS-0.0.5.10-py3-none-any.whl
Binary file not shown.
Binary file added dist/Py_FS-0.0.5.10.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setuptools.setup(
name='Py_FS',
version='0.0.5.9',
version='0.0.5.11',
author="Ritam Guha",
author_email="[email protected]",
description="A Python Package for Feature Selection",
Expand Down

0 comments on commit 345bd7d

Please sign in to comment.