Skip to content
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

MultiStatistics class supports different functions for each Statistics object #720

Open
TianYuanSX opened this issue Aug 8, 2023 · 0 comments

Comments

@TianYuanSX
Copy link

Thanks for making such a good EC platform!

Currently, class MultiStatistics can contain multi Statistics object, but all Statistics object must registered the same function.
Sometimes, we may need to assign different functions for each Statistic object.
For example, a Genetic Programming algorithm, if I want to analysis the terminal occurrence of the current population, I need to count the occurrences of each terminal, the statistics result looks like a dict {"terminalA": 10, "terminalB":18, ...} .
Besides, I also want to record the min/max/average fitness.
If I use a MultiStatistics object, the numpy.mean/min/max/std works for fitness, but doesn't works for counting the terminal occurrences (a customized sum is needed).

Of course, I could create seperate Statistics objects that can assign respective funtions but I need to change the signature/arguments of algorithms to allow multi Statistics objects.

Could the Statistics objects in MultiStatistics object register different functions? Or is there any good solutions for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant