All Questions
Tagged with fitness genetic-algorithm
37 questions
1
vote
1
answer
254
views
How do i scale my fitness values? (using PyGAD)
As the title says, i want to use fitness scalling methods, such as sigma scalling, for i'm having problems with premature genetic conversion in non-optimal solutions.
I know that PyGAD has a ...
0
votes
0
answers
59
views
f(x)= number of ones in x . find the highest and average fitness for genetic algorithm , Alternate option to Map and reduce in python
i am trying to write a code which takes input as below and then find the highest and average where f(x)= number of ones in x .
['00111110011001010011', '01111101001101110010', '01100110111110000000', '...
0
votes
1
answer
349
views
How to select random rows from a matrix in python scratch without any numpy library
Hi i am trying to inplememt Genetic algorithm rollete wheel selection mechanism. I have done fitness and also the corresponding fitness probability.
I need a code to randomly select rows from initial ...
0
votes
0
answers
41
views
what is the cause of my GA plot only shows straight lines
i have no idea, Is this plot appropriate because the fitness function I created is like that? output plot
here is the code:
library(GA)
frame_uji <- data.matrix(data_uji)
sum_fu <- matrix(0, ...
0
votes
0
answers
183
views
How to do a fitness function to find the best path in a search problem (Genetic Algorithm)
I have to be able to, with this 'dataset' (its a graph): ...
{
0 : [3,2,1],
1 : [4],
2 : [6,5],
3 : [7],
4 : [8],
5 : [9]
}
... input a initial and a final value with a goal to show the best ...
0
votes
5
answers
221
views
How can I implement a R code for AUC in genetic algorithm
I am doing research on applying a genetic algorithm to binary logistic regression.
I have a few questions to be clarified. Can you please help me?
Can I use AIC or BIC as the fitness function in the ...
4
votes
2
answers
447
views
How to scale and weight fitness of a given values?
I'm working on a GA. My problem is as follows. I have a fitness function which takes a couple of values:
A - value which is huge, but less important for example 999999.
(weight of importance 30% ...
0
votes
1
answer
268
views
Why does my genetic algorithm return negative fitness values?
I'm trying to minimize the function and then graph it, but I'm getting negative fitness values and I don't know how or why. I'm using the GA package which basically handles the algorithm for me as ...
3
votes
1
answer
236
views
How to know whether i'm forcing convergence too much, if my GA converges to the RIGHT solution quickly?
I'm developing a genetic algorithm to solve a two-dimensional knapsack problem. Currently, I'm testing with 50 itens, each one having a weight, volume, and value.
Each cycle, 10(of my population of ...
1
vote
0
answers
175
views
genetic algorithm, implementation of generation of new population
I have this problem with the implementation of the generation of a new population. I have a population of matrices, I defined a fitness function and I need the value of fitness to be as low as ...
0
votes
0
answers
1k
views
Fitness function for Maze Solving Genetic Algorithm
I am working on a Maze Solver using a GA approach. Each genome has directions encoded as chars ('N', 'S', 'E', 'W'), and each genome in the generation are evaluated for fitness and crossbreed using a ...
3
votes
1
answer
362
views
Fitness Proportionate Selection when some fitnesses are 0
I have a question about what to do with the fitnesses (fitness'?) that are 0 when getting the fitness proportionate probabilities. Should the container for the members be sorted by highest fitness ...
2
votes
1
answer
780
views
Generate probabilities list for fitness proportionate selection (roulette wheel) in genetic algorithms
firs of all I apologize if my approach is too dumb or simplistic, I am an economist trying very hard to get into programming, therefore I lack some specific skills. Anyways, I have the following code: ...
1
vote
2
answers
599
views
Genetic Algorithms: Can my Fitness Function be too complicated?
On a Genetic Algorithm, would it be correct to make the Fitness Function something other than a mathematical ecuation? Could it have a recursive function and a loop inside of it?
The thing is I'm ...
0
votes
0
answers
284
views
Genetic algorithm not producing better results
I'm running a genetic algorithm to train a set of Hunters to learn to capture as many Elephants as possible. Basically, there's ~20 Hunters that move around in a 2D Grid environment, and 4 Hunters ...
0
votes
0
answers
507
views
Genetic Algorithm Fitness Stop Increasing at Some Point
I am trying to implement a Genetic Algorithm which will recreate a given image by positioning, sizing and colouring 1000 circles. However, I found that when the fitness reaches a certain value (around ...
0
votes
3
answers
3k
views
Genetic algorithm to solve a quadratic equation
I have a problem understanding the process for genetic algorithms. I found examples of maximizing a function over an interval, and I think I understand them, but how can a genetic algorithm be used to ...
0
votes
1
answer
288
views
Objective function of a Genetic Algorithm
This is my first effort about AI/ML.
I have the following problem given by my teacher,
Design a simple genetic algorithm in MATLAB, with binary-coded chromosomes, in
order to solve pattern ...
0
votes
1
answer
442
views
implementing Subset Sum with genetic Algorithm
import java.util.Collections;
import java.util.Vector;
public class Metaheuristic {
private static int[] DATA;
private static int NUM_CHROMOSOMES ;
private static int MAX_POWER;
...
0
votes
0
answers
504
views
Game playing AI, how to find a good board evaluation function?
I'm working on an AI to play a fairly simple game, using minimax and genetic algorithms to find weights to score board states with.
The game resembles 4x4 tictactoe, but a turn can be spent to move a ...
1
vote
1
answer
85
views
Fitness function for Ball and beam
I have problem to be solved and any constructive help would be good.
Anyway, I have to make genetic algorithm that creates neural network for solving problem Ball-and-Beam. Only fitness function ...
0
votes
0
answers
254
views
Finding the perfect fitness function for path testing using Genetic Algorithm
I recently started working with genetic algorithm, and to understand it better, I decided to use it to solve a problem. I'm working on using genetic algorithm to generate test cases for a path testing ...
1
vote
1
answer
606
views
Fitness Sharing in multi objective optimization
i'm writing a genetic algorithm that uses fitness sharing in tournament selection. in all the relevant literature that i found (Sareni for example) it is mentioned that the solution's own fitness (Fi) ...
0
votes
1
answer
1k
views
Your fitness function must return a scalar value
I tried to perform an optimization using a neural network and the genetic algorithm. I trained a neural network with input p (4x72 matrix) and target t (2x72 matrix). Regrading the optimization using ...
11
votes
5
answers
9k
views
Genetic algorithm - new generations getting worse
I have implemented a simple Genetic Algorithm to generate short story based on Aesop fables.
Here are the parameters I'm using:
Mutation: Single word swap mutation with tested rate with 0.01.
...
0
votes
1
answer
766
views
Using fitness sharing on a minimization function
I'm trying to use fitness/function sharing on a minimization function. I'm using the standard definition of the sharing function found here which then divides the fitness by the niche count. This ...
3
votes
2
answers
1k
views
Fitness sharing in DEAP
Is there any way to implement fitness sharing/niching using DEAP? Specifically I'm looking for an implementation of the method defined here (Goldberg's fitness sharing) on page 98 of the pdf. If you ...
1
vote
1
answer
657
views
Optimization of Image Reconstruction Algorithm using Genetic Algorithm in Matlab
I'm trying to optimize an image reconstruction algorithm using genetic algorithm.I took initial population size as 10.I have an input image an 10 reconstructed image.fitness function is the difference ...
1
vote
1
answer
190
views
fitness in inverted pendulum
What is the fitness function used to solve an inverted pendulum ?
I am evolving neural networks with genetic algorithm. And I don't know how to evaluate each individual.
I tried minimize the angle ...
2
votes
1
answer
2k
views
Issue in solving XOR using neural network and genetic algorithm
I'm trying to solve XOR problem using neural network. For training I'm using genetic algorithm.
But after a certain number of generations (200), the error stuck in 1. And the outputs are correct ...
4
votes
0
answers
3k
views
Backpack (knapsack) by means of genetic algorithm. How to add penalty to the fitness func
I use ga (matlab optimization tool) to solve the backpack problem. I wrote a simple fitness function with hardcoded weight-value array:
function fitness = bp_fitness(x)
% This function computes the ...
1
vote
1
answer
467
views
Multiobjective genetic algorithm fitness evaluation Matlab
I want to write two objective functions based on NSGA2 genetic algorithm in Matlab, However, i'm confusing to input chromosomes to evaluate my objectives, and in my objective function, the chromosomes ...
4
votes
2
answers
4k
views
How many and which parents should we select for crossover in genetic algorithm
I have read many tutorials, papers and I understood the concept of Genetic Algorithm, but I have some problems to implement the problem in Matlab.
In summary, I have:
A chromosome containing three ...
1
vote
1
answer
1k
views
Genetic algorithms: fitness function not working properly
I have a binary dataset of (m x n) m instances and n features with m >> n. And there is a target Variable or Class attribute, also binary. I want to do feature selection using genetic algorithm. I ...
2
votes
1
answer
919
views
Weights for violations in a fitness function
I'm working on my Final year project where I'm developing a Genetic Algorithm for timetable optimization. It's going fairly well at the minute as I am producing random chromosome's representing my ...
10
votes
2
answers
18k
views
How do I define a fitness function?
I'm working on a project which will have a selected set of data and each data will have different attributes. I will need to use a fitness function to choose the data that best matches my selected ...
1
vote
2
answers
2k
views
Solve crossword puzzle with genetic algorithm, fitness, mutation
I'm trying hard to do a lab for school. I'm trying to solve a crossword puzzle using genetic algorithms.
Problem is that is not very good (it is still too random)
I will try to give a brief ...