-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
training_test condition never true for Multi-objective optimization #166
Comments
…e Optimization. Fixes PonyGE#166
…i-objective optimization PonyGE#166. This was fixed but not pushed in original commit.
I think we are agreeing we should get rid of the training_test attribute everywhere, right? @zahidirfan could you please update the PR to make the same change in 1 more place in stats.py, and also to remove the 1 line in supervised_learning.py and regression_random_polynomial.py? I think it would be best to have all the changes in a single PR from yourself. |
@jmmcd: I have deleted the training_test attribute from the repository and added the check for DATASET_TEST to determine if the training and test datasets are included. I have checked the working by running the example using the following.
I was getting the following error and changed the grammar file.
I fixed it by changing the grammar file. I have also added the changed grammar file as a separate commit so that if it is decided not to change it, the change can be easily ignored. |
PonyGE2/src/stats/stats.py
Line 243 in f337171
The method of defining fitness functions in parameters is given in the documentation.
FITNESS_FUNCTION: [[FITNESS_FUNCTION_1_NAME], [FITNESS_FUNCTION_2_NAME]]
This results in an object : <class 'fitness.base_ff_classes.moo_ff.moo_ff'> which does not have an attribute 'training_test'.
AttributeError("'moo_ff' object has no attribute 'training_test'").
Therefore the test fitness and training fitness statistics are never generated for the multi-objective optimization
Since the training_test attribute in the fitness functions gets its value from params['DATASET_TEST']. The condition could be replaced to check if the paramater 'DATASET_TEST' has a value. However the
PonyGE2/src/stats/stats.py
Line 252 in f337171
Here we get the following error : TypeError("call() got an unexpected keyword argument 'dist'"), because the params['FITNESS'] is now an object moo_ff.
This could be resolved by updating the code with the following.
The text was updated successfully, but these errors were encountered: