Hi
Can any one provide me with a tutorial except those come with the framework for defining new problem with MOEA , as I didn't understand exactly how to know and determine how many variables to use.
Determining how many variables to use is dependent on your problem. A simple answer is to define a variable for each independent parameter/control/input that can vary. It becomes a bit more complex when the variables are dependent on one another. Could you please provide more information about your particular problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem that I am trying with MOEA as follows:
I have N of (x,y) points such {(1,2),(3,3),(5,2),…….} each point from these points is related to only one of 3 classes (A,B,C).
Then the algorithm generate a number M of circles randomly over the search space , each circle represented by 3 parameters (x and y ) for the centre point of the circle and (r) for the radius.
Then the algorithm calculates how many points related to the same class are inside each circle , then labels that circle with the class that has maximum number related to it inside the circle.
After that the algorithm will choose only the best circle that represents each class.
So, at the end we will have 3 circles {(x1,y1,r1), (x2,y2,r2), (x3,y3,r3)} and (One) objective function that calculates the overall percentage of correctly classified points.
best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why is it necessary to generate M circles when only the 3 best are selected at the end? I would just let the algorithm optimize three circles to maximize classification rates. This would be encoded with 9 decision variables (either integers or doubles depending on your problem): [x1, y1, r1, x2, y2, r2, x3, y3, r3]. The circle defined by (x1, y1, r1) corresponds to class A, (x2, y2, r2) to B, and (x3, y3, r3) to C. The MOEA will adjust the location and radius of the three circles until your objective is maximized.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason of using M circles, is that with 3 randomly generated circles, you can not guarantee that there will be a circle for each one of the 3 classes, some times all the 3 circles will capture only one class and the other classes will not be represented by any circle and even sometimes neither of the class will be represented by any circle.
So that, using more number of circles then choosing the best circle representing each class will increase the opportunity of representing all the classes.
Last edit: Mohammad Kassim 2015-08-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Some thing else I would like to have detailed information about (what are and how many decision variables used with the famouse knapsack and kursawe problems?)
Thank you in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, if M is fixed, then you could just define 3*M real or int variables. Use the methods in EncodingUtils to create/read/write the variables as either ints or reals. As an example, please see the Kursawe.java file referenced below.
The knapsack problem uses a BinaryVariable containing N bits to represent the selected subset of N items. The Kursawe problem uses 3 RealVariables. For more details, see examples\org\moeaframework\examples\ga\knapsack\Knapsack.java or src/org/moeaframework/problem/misc/Kursawe.java.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Thanks for your valued support.
after following what you have suggested, I have made a remarkable progress implementing the code.
My new problem is with initializing the variables:
All the circles parameters [x1, y1, r1, x2, y2, r2, x3, y3, r3,.......] are generated randomly, x and y can get any real numbers (positives and negatives), r will be only positive real numbers and all of them are saved in an array {xi,yi,ri}
what I have tried to use so far is as follow :
for (int i = 0; i < numberOfVariables; i++) {
solution.setVariable(i, EncodingUtils.newReal(0.0, 1.0));
}
but it dosen't give me the expected rsults, so what is the correct way to initialize all the variables
Thank you
Last edit: Mohammad Kassim 2015-08-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You'll need to change EncodingUtils.newReal(0.0, 1.0) to encompass the possible range of values. Right now its only generating values between 0 and 1. You'll need to change it to EncodingUtils.newReal(-10.0, 10.0) for x's and y's (of course, replace -10 and 10 with your actual bounds). Same for r's, except the lower bound will be 0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for your cooperation.
The code now starts producing reasonable results.
My new concern is about the place where to use the decision variables, as shown below with my objective function, the decision variables (xi,yi,ri) are not used directly with the objective function, but they are used in another fitness function as a step towards the final objective function as follow:
1- First the code uses the decision variables (xi,yi,ri) as a parameters for a function that calculates how many points inside each ( ith circle).
2- Then the result of that function is passed through many steps to choose the best circle for each class, then calculating the accuracy rate for each one of these circles.
3- After that, the final objective function is the overall accuracy rate calculated using the accuracy rates of the chosen circles.
overall-accuracy = accuracy1+ accuracy2+…..+ accuracy(n) / number of instances
Solution.setObjective(0, - (overall-accuracy);
is what I have done is correct?
or it is compulsory to use the decision variables directly within the objective
function?
Thank you
Last edit: Mohammad Kassim 2015-08-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Determining how many variables to use is dependent on your problem. A simple answer is to define a variable for each independent parameter/control/input that can vary. It becomes a bit more complex when the variables are dependent on one another. Could you please provide more information about your particular problem?
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi
Thank you for your respond.
The problem that I am trying with MOEA as follows:
I have N of (x,y) points such {(1,2),(3,3),(5,2),…….} each point from these points is related to only one of 3 classes (A,B,C).
Then the algorithm generate a number M of circles randomly over the search space , each circle represented by 3 parameters (x and y ) for the centre point of the circle and (r) for the radius.
Then the algorithm calculates how many points related to the same class are inside each circle , then labels that circle with the class that has maximum number related to it inside the circle.
After that the algorithm will choose only the best circle that represents each class.
So, at the end we will have 3 circles {(x1,y1,r1), (x2,y2,r2), (x3,y3,r3)} and (One) objective function that calculates the overall percentage of correctly classified points.
best regards
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Why is it necessary to generate M circles when only the 3 best are selected at the end? I would just let the algorithm optimize three circles to maximize classification rates. This would be encoded with 9 decision variables (either integers or doubles depending on your problem): [x1, y1, r1, x2, y2, r2, x3, y3, r3]. The circle defined by (x1, y1, r1) corresponds to class A, (x2, y2, r2) to B, and (x3, y3, r3) to C. The MOEA will adjust the location and radius of the three circles until your objective is maximized.
Thank you
The reason of using M circles, is that with 3 randomly generated circles, you can not guarantee that there will be a circle for each one of the 3 classes, some times all the 3 circles will capture only one class and the other classes will not be represented by any circle and even sometimes neither of the class will be represented by any circle.
So that, using more number of circles then choosing the best circle representing each class will increase the opportunity of representing all the classes.
Last edit: Mohammad Kassim 2015-08-24
Hi
Some thing else I would like to have detailed information about (what are and how many decision variables used with the famouse knapsack and kursawe problems?)
Thank you in advance
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Ok, if M is fixed, then you could just define 3*M real or int variables. Use the methods in EncodingUtils to create/read/write the variables as either ints or reals. As an example, please see the Kursawe.java file referenced below.
The knapsack problem uses a BinaryVariable containing N bits to represent the selected subset of N items. The Kursawe problem uses 3 RealVariables. For more details, see
examples\org\moeaframework\examples\ga\knapsack\Knapsack.java
orsrc/org/moeaframework/problem/misc/Kursawe.java
.Hi
Thanks for your valued support.
after following what you have suggested, I have made a remarkable progress implementing the code.
My new problem is with initializing the variables:
All the circles parameters [x1, y1, r1, x2, y2, r2, x3, y3, r3,.......] are generated randomly, x and y can get any real numbers (positives and negatives), r will be only positive real numbers and all of them are saved in an array {xi,yi,ri}
what I have tried to use so far is as follow :
but it dosen't give me the expected rsults, so what is the correct way to initialize all the variables
Thank you
Last edit: Mohammad Kassim 2015-08-26
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
You'll need to change
EncodingUtils.newReal(0.0, 1.0)
to encompass the possible range of values. Right now its only generating values between 0 and 1. You'll need to change it toEncodingUtils.newReal(-10.0, 10.0)
for x's and y's (of course, replace -10 and 10 with your actual bounds). Same for r's, except the lower bound will be 0.Thank you very much for your cooperation.
The code now starts producing reasonable results.
My new concern is about the place where to use the decision variables, as shown below with my objective function, the decision variables (xi,yi,ri) are not used directly with the objective function, but they are used in another fitness function as a step towards the final objective function as follow:
1- First the code uses the decision variables (xi,yi,ri) as a parameters for a function that calculates how many points inside each ( ith circle).
2- Then the result of that function is passed through many steps to choose the best circle for each class, then calculating the accuracy rate for each one of these circles.
3- After that, the final objective function is the overall accuracy rate calculated using the accuracy rates of the chosen circles.
overall-accuracy = accuracy1+ accuracy2+…..+ accuracy(n) / number of instances
Solution.setObjective(0, - (overall-accuracy);
is what I have done is correct?
or it is compulsory to use the decision variables directly within the objective
function?
Thank you
Last edit: Mohammad Kassim 2015-08-28