All Projects → renatoosousa → GeneticAlgorithmForFeatureSelection

renatoosousa / GeneticAlgorithmForFeatureSelection

Licence: MIT License
Search the best feature subset for you classification mode

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GeneticAlgorithmForFeatureSelection

geneticalgorithm2
Supported highly optimized and flexible genetic algorithm package for python
Stars: ✭ 36 (-56.1%)
Mutual labels:  genetic-algorithm, genetic-algorithm-framework, evolutionary-algorithms, genetic-optimization-algorithm
tiny gp
Tiny Genetic Programming in Python
Stars: ✭ 58 (-29.27%)
Mutual labels:  genetic-algorithm, genetic-programming, evolutionary-algorithms, evolutionary-algorithm
zoofs
zoofs is a python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.
Stars: ✭ 142 (+73.17%)
Mutual labels:  genetic-algorithm, feature-selection, evolutionary-algorithms, machinelearning
opt4j
Modular Java framework for meta-heuristic optimization
Stars: ✭ 25 (-69.51%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms, evolutionary-algorithm
goga
Go evolutionary algorithm is a computer library for developing evolutionary and genetic algorithms to solve optimisation problems with (or not) many constraints and many objectives. Also, a goal is to handle mixed-type representations (reals and integers).
Stars: ✭ 39 (-52.44%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms, evolutionary-algorithm
moses
MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search. See also AS-MOSES https://github.com/opencog/asmoses but kept to guaranty backward compatibility.
Stars: ✭ 127 (+54.88%)
Mutual labels:  genetic-algorithm, genetic-programming, genetic-optimization-algorithm
GARI
GARI (Genetic Algorithm for Reproducing Images) reproduces a single image using Genetic Algorithm (GA) by evolving pixel values.
Stars: ✭ 41 (-50%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms
TextFeatureSelection
Python library for feature selection for text features. It has filter method, genetic algorithm and TextFeatureSelectionEnsemble for improving text classification models. Helps improve your machine learning models
Stars: ✭ 42 (-48.78%)
Mutual labels:  feature-selection, machinelearning
geppy
A framework for gene expression programming (an evolutionary algorithm) in Python
Stars: ✭ 124 (+51.22%)
Mutual labels:  genetic-programming, evolutionary-algorithm
GeneticsJS
Evolutionary algorithms library for the web 🧬
Stars: ✭ 25 (-69.51%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms
wargames
two soldiers shooting at each other, controlled by a neural network with a genetic algorithm.
Stars: ✭ 22 (-73.17%)
Mutual labels:  genetic-algorithm, genetic-programming
Ascension
A metaheuristic optimization framework
Stars: ✭ 24 (-70.73%)
Mutual labels:  genetic-algorithm, genetic-algorithm-framework
biteopt
Derivative-Free Optimization Method for Global Optimization (C++)
Stars: ✭ 91 (+10.98%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms
vita
Vita - Genetic Programming Framework
Stars: ✭ 24 (-70.73%)
Mutual labels:  genetic-programming, evolutionary-algorithms
binlex
A Binary Genetic Traits Lexer Framework
Stars: ✭ 303 (+269.51%)
Mutual labels:  genetic-algorithm, genetic-programming
arja
Multi-Objective GP for Automated Repair of Java
Stars: ✭ 31 (-62.2%)
Mutual labels:  genetic-algorithm, genetic-programming
geneal
A genetic algorithm implementation in python
Stars: ✭ 47 (-42.68%)
Mutual labels:  genetic-algorithm, genetic-programming
trsh
Project about minimizing costs in garbage collection in Montevideo, Uruguay, using Evolutionary Algorithms
Stars: ✭ 17 (-79.27%)
Mutual labels:  genetic-algorithm, evolutionary-algorithm
EvOLuTIoN
A simple simulation in Unity, which uses genetic algorithm to optimize forces applied to cubes
Stars: ✭ 44 (-46.34%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms
triangula
Generate high-quality triangulated and polygonal art from images.
Stars: ✭ 3,775 (+4503.66%)
Mutual labels:  genetic-algorithm, evolutionary-algorithms

Genetic Algorithm For Feature Selection

Search the best feature subset for you classification model

Description

Feature selection is the process of finding the most relevant variables for a predictive model. These techniques can be used to identify and remove unneeded, irrelevant and redundant features that do not contribute or decrease the accuracy of the predictive model.

In nature, the genes of organisms tend to evolve over successive generations to better adapt to the environment. The Genetic Algorithm is an heuristic optimization method inspired by that procedures of natural evolution.

In feature selection, the function to optimize is the generalization performance of a predictive model. More specifically, we want to minimize the error of the model on an independent data set not used to create the model.

Dependencies

Pandas

Numpy

scikit-learn

Deap

Usage

  1. Go to the repository folder
  2. Run:
python gaFeatureSelection.py path n_population n_generation

Obs:

  • path should be the path to some dataframe in csv format
  • n_population and n_generation must be integers
  • You can go to the code and change the classifier so that the search is optimized for your classifier.

Usage Example

python gaFeatureSelection.py datasets/nuclear.csv 20 6

Returns:

Accuracy with all features: 	(0.90833333333333344,)

gen	nevals	avg     	min     	max     
0  	20    	0.849167	0.683333	0.941667
1  	12    	0.919167	0.766667	0.966667
2  	18    	0.934167	0.908333	0.966667
3  	9     	0.941667	0.908333	0.966667
4  	9     	0.946667	0.908333	0.966667
5  	12    	0.955833	0.908333	0.966667
6  	12    	0.9625  	0.883333	0.966667
Best Accuracy: 	(0.96666666666666679,)
Number of Features in Subset: 	5
Individual: 		[1, 1, 1, 0, 0, 1, 1, 0, 0, 0]
Feature Subset	: ['cost', 'date', 't1', 'pr', 'ne']


creating a new classifier with the result
Accuracy with Feature Subset: 	0.966666666667

Fonts

  1. This repository was heavily based on GeneticAlgorithmFeatureSelection
  2. For the description was used part of the introduction of Genetic algorithms for feature selection in Data Analytics. Great text.

Author: Renato Sousa

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].