347 questions
0
votes
0
answers
117
views
How can I define a custom operator using radiate crate for genetic programming?
I'm trying to make a custom operator function for the Op enum in the radiate crate for genetic programming but I can't. Can someone give me some example for that?
I'm trying to implement for example ...
1
vote
1
answer
158
views
How to specify range of genes in PyGAD for genetic algorithms?
I have an optimization problem with a lot of variables. Let suppose there is just three: car speed (km/h), car weight (tons) and car price ($). Obviously, the range of each variable is different: car ...
0
votes
0
answers
50
views
Genetic Algorithm Implementation – Error in Selection/Mutation/Population Formation Steps
I’m working on a genetic algorithm for an optimization task where I need to compare different parameters across three functions, including:
Crossover: One-point (OT), two-point (DT)
Mutation rates: 0....
0
votes
1
answer
61
views
DEAP eaSimple in python crashes becouse of too many laggs
Error
I get SyntaxError: too many nested parentheses.
File /home/tilen/genetic_programming/.venv/lib/python3.10/site-packages/IPython/core/interactiveshell.py:3577 in run_code
exec(code_obj, self....
0
votes
0
answers
42
views
Schemata Theorem, Crossover Probability and Mutation Probability in different techniques
For the mutation probability, the definition I found is "Mutation probability (or ratio) is basically a measure of the likeness that random elements of your chromosome will be flipped into ...
0
votes
1
answer
31
views
Neataptic Machine-Learning - Flatten inputs or nested & based on features or samples
I am learning ML NEAT with Neataptic within NodeJS.
I am making a basic weather prediction model. Essentially predict the next temperature.
I have this type of data, where I want to give samples of ...
0
votes
1
answer
51
views
what does verbose = __debug__ mean in following code?
from deap import tools
from deap import algorithms
def eaSimpleWithElitism(population, toolbox, cxpb, mutpb, ngen, stats=None,
halloffame=None, verbose=__debug__):
"""...
0
votes
0
answers
124
views
MPI coding error : program exiting without completing execution
I am doing small coding on Genetic Algorithm and the below is my main function :
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <mpi.h>
#include <limits.h&...
1
vote
1
answer
364
views
Pygad create new population if fitness is saturated
I am using Pygad to compute an optimization problem, however the algorithm is reaching local minima (not the ideal solution) before all the generations have run. I would like to be able to check ...
0
votes
1
answer
483
views
Couldn't get more than two solutions in pymoo
I have a problem with two objectives. The problem is minimized by NSGA-2 algorithm. I run minimize with different population sizes and different termination criterias, but every time the algorithm ...
0
votes
1
answer
77
views
Allocate letters to an NxM grid to minimize the distance between letter pairs that show up frequently in a given list of words
Given a input of a lot of words and an NxM dimension I have to create an algorithm that designs the best (if possible, or one of the bests) single-finger NxM keyboard layout for mobile. Which means ...
1
vote
1
answer
151
views
PYGAD how to debug the built-in parent selection method
I am using PYGAD GA module to write a genetic programming, I want to use the tournament selection for my parent matching, I do not known how to use print() to debug the parent selection method, here ...
0
votes
1
answer
86
views
How to use linear regression B/SE estimates into a new formula to calculate Wald Ratio method statistic?
In Stata how to perform one-sample Mendelian randomization using the Wald ratio method for causal estimates, SE and P value? Is there a package or special command?
Essentially I want to perform ...
0
votes
0
answers
101
views
Why is it showing 'invalid syntax' when I am trying to run a genetic programming code using deap library?
After calling all required modules, I assined all the operators and created Fitness and Individual. After that Evaluation function was defined and toolbox was registered as follows:
# Define the ...
0
votes
0
answers
112
views
Genetic Programming with Numpy, Pandas and Swifter, how to speed up tree evaluation/fitness calculation?
I'm trying to implement a GP algorithm.
This is my first time using numpy/pandas/swifter, so perhaps that explains a lot.
I have a tree class (only relevant methods shown):
FUNCTIONS = [np.add, np....
-1
votes
1
answer
90
views
Large Datsample: failing to better visualize data point using matplotlib plot
The size of the data samples is very large, making it difficult to visualise the data points using a matplotlib plot.
Sample Code:
import matplotlib.pyplot as plt
plt.plot(myList_timestamps, ...
0
votes
0
answers
49
views
How to create Chromosomes and Fitness function for this NP-Hard Genetic algorithm problem
Hi i am very new to genetic algorithm and i am stuck with this problem:
A move is provided for a student. He has to store his things in small plastic boxes in a cardboard box with a capacity of 2 ...
0
votes
1
answer
2k
views
overlapping in matplotlib plot
I am comparing the execution time of an exhaustive search and genetic algorithm along with sample solutions.
In the graph below, I am trying to improve the readability of my graph. However, they ...
1
vote
3
answers
159
views
finding a minimum value with all header values
I am trying to find a minimum value in a dataframe with all column values.
Sample data:
**Fitness Value MSU Locations MSU Range**
1.180694 {17, 38, 15} 2.017782
1.202132 {10, ...
0
votes
1
answer
44
views
Iterating a list: getting values as[set(), set(), set(), set(), set()]
I have a list (df_pop_initial_list), and it looks like this:
[['000000000000000000000000000001011000000'],
['000000001000000000000001000000000010000'],
['000000000000000000000000000000010011000'],
[...
0
votes
1
answer
312
views
finding indexes of 1's in a bit string and storing these indexes in a list -- Index should be started from 1 not 0
I am finding indexes of 1's in a bit string successfully. However, these indexes start from 0.
Sample Data:
initial_pop
000000000000000000000000000001011000000
000000001000000000000001000000000010000
...
0
votes
1
answer
41
views
counting 1's in a bit string to keep positions in a variable and then accessing each value
I am finding 1's in a bit string and then storing them.
Sample Data:
Sample code:
def indices(chromosome):
return {i for i,c in enumerate(chromosome) if c=='1'}
for ind in df_initial_pop['...
0
votes
0
answers
2k
views
IndexError: Boolean index has wrong length: 14 instead of 15
I was trying implement a project from GitHub about genetic algorithm and particle swarm algorithm.
But I face the next error:
Knowing that I use the same dataset in the project file. Can anyone help ...
0
votes
1
answer
56
views
Not able to understand random.sample(range(1,40),3)) with sum(1<<i for i in random.sample(range(1,40),3))
I am trying to debug this piece of code and learn a little. I learn that it generates 3 unique values for i but how come the values of sum become this much big?
If I run it and debug it, it goes ...
1
vote
1
answer
108
views
Cross-over is failing binary encoded string
I am implementing Genetic Algorithm (GA).
There are 43 numbers [Ambulance Locations] to choose from (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, ...
0
votes
1
answer
117
views
Controlling Mutation in 39bit string as a candidate solution in genetic algorithm
I am working on an optimization problem. I have X number of ambulance locations, where X ranges from 1-39.
There are 43 numbers [Ambulance Locations] to choose from (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,...
0
votes
0
answers
159
views
Controlling multiple bits flipping to represent chromosomes mutation
I am working on an optimization problem. I have X number of ambulance locations, where X ranges from 1-39.
There are 43 numbers [Ambulance Locations] to choose from (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,...
0
votes
0
answers
457
views
Best way to define a fitness function which can be optimized by GA making multiple properties be close to specified values
Recently, I met such a questions, which require to optimize multiple properties of a designed material make them close to specified values.
For example, I have 3 reference property values (pv for ...
0
votes
1
answer
506
views
How to change a function code during the execution in java
I'm trying to make some kind of AI that will have acess to his own code and can modify it during the execution to be able to evolve
for example, during the runtime I want it to be able to change it's ...
1
vote
0
answers
196
views
How can I access all feasible solutions from Genetic Algorthm with DEAP library?
I am trying to apply GA for generating a set of solutions that fulfil a list of constraints. I would like to find solutions (individuals) of diets that fulfill nutritional constraints, for which I ...
0
votes
0
answers
108
views
Genetic algorithm producing irregular result in finding the maxima of a multivariable function
I'm trying to implement a genetic algorithm in order to find the maxima of this function
f(x,y,z) = x^2 + y^3 + z^4 + xyz on [0,10] [0,20] [0,30] for x,y,z respectively
my objective function is the ...
2
votes
1
answer
262
views
Python Genetic Algorithm by using PyGAD library
I have a function that I want to maximize its value.
But I don't know much how to use PyGad library. What I see on some sites is that they always use default functions like w1x1 + w2x2 + w3x3 + w4x4 + ...
0
votes
2
answers
3k
views
How can I convert Affymetrix probes into gene Symbols?
I have carried out Affymetrix data analysis with oligo and limma. Now I need to perform the gene enrichment analysis on the upregulated and downregulated genes (on EnrichR, by searching the gene ...
0
votes
1
answer
116
views
Genetic programming: Can we get multiple bit output from each individual(tree) if we provide 5 bit input?
I want to create population of trees using genetic programming. I am using deap python framework. My trees are based on combination of different logic gates and some terminals.
I want to provide each ...
0
votes
3
answers
464
views
How do I replace part of a tree with another tree at the specified index in OCaml?
I have the following tree structure:
type 'a tree =
| Function of string * 'a tree list (* function name and arguments *)
| Terminal of 'a
I use this tree structure to construct an abstract ...
0
votes
1
answer
459
views
How to represent multiple-output logic circuits in tree-based genetic programming
Consider the following digital logic circuit, which has multiple inputs and one output:
The logic circuit above can be represented in tree form:
This tree representation could then be used in a tree-...
0
votes
0
answers
281
views
Struggling with netcore GC and Large Small Lived Arrays
I'm developing an Grammatical Evolution Engine that does the following:
Parse a file with the BNF rules.
<letter> ::= a|b|c|d
Generates random solutions based in some specific rules. (...
-2
votes
1
answer
179
views
genetic algorithm improvement
1-probability that an individual Route will mutate
2-Population size of 1 generation (RoutePop)
3-Size of the tournament selection.
In the genetic algorithm, how can I select these three elements (2-2-...
0
votes
0
answers
80
views
What would be the time complexity of following Genetic Mutation
def mutation(domain, step, solution) -> list:
gene = random.randint(0, len(domain)-1)
mutant = solution
if random.random() < 0.5:
if solution[gene] != domain[gene][0]:
mutant = ...
0
votes
0
answers
168
views
When I import the Matlab data table, the numbers do not appear, instead it writes NaN
I am making a project using Genetic Algorithm in Matlab, but I am getting errors in some parts of the code and therefore I cannot reach the result.
When I import the data table, the numbers do not ...
1
vote
2
answers
752
views
GNU parallel --block and -L clarification
Given that I have a file of N size. For the sake of example 30GB file.
Facts about the file content is that it has proprotional amount of lines.
This is interleaved FastQ file. (not important for the ...
1
vote
1
answer
600
views
A query regarding NSGA 2: Tournament selection
In NSGA 2 algorithm, we employ binary tournament selection as the selection procedure to generate mating parents from a population. The offspring data set's size is the same as the size of the parents....
1
vote
1
answer
312
views
How can I get my value for generations to work for my genetic algorithm (Python)
I have created a genetic algorithm to solve the problem of watching shows in what order to maximise surplus by using a code inspired by Kie Codes by following the code within this video https://www....
3
votes
2
answers
486
views
How can I select features for Symbolic Regression
How can I select features for Symbolic Regression ?
I have 30 features, I want to use only the most sensitive features for Symbolic Regression.
As an example, this dataset can be used which is similar ...
0
votes
1
answer
241
views
Genetic Programming, On-line Learning, gplearn
I recently discovered the GP and find it fascinating. To explicitly learn the mathematical expression is quite different from the implicit learning neural networks do! I'm interested in how GP works ...
1
vote
0
answers
1k
views
Error in cor(exprs(gse), use = "c") : no complete element pairs
I'm trying to plot a heat map for a "GSE133399", I retrieved the GSE using GEOquery package and then assigned to an object and then tried to plot a heatmap, but I was not successful, I used ...
0
votes
2
answers
482
views
Can I get the index of an object in an instance array by knowing a value of the object?
Is there a way of getting the index of an instance in an instance array by only knowing a property of that object?
I have something like this:
class NodeGene:
def __init__(self):
self....
4
votes
3
answers
2k
views
Modified version of Student Project Allocation algorithm
I am working on a project for a non-profit organization where they are trying to help students with special needs to match to different project topics. Each student will have four preferences and a ...
1
vote
2
answers
274
views
How to deal with unfeasible individuals in Genetic Algorithm?
I'm trying to optimize a thermal power plant in a thermoeconomic way using Genetic Algorithms. Creating population gets me with a lot of unfeasible Individuals (e.g: ValueErros, TypeError etc.). I ...
1
vote
1
answer
1k
views
Visualizing nested function calls in python
I need a way to visualize nested function calls in python, preferably in a tree-like structure. So, if I have a string that contains f(g(x,h(y))), I'd like to create a tree that makes the levels more ...