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

Result differ from R #6

Open
MikeChenfu opened this issue Jul 3, 2019 · 2 comments
Open

Result differ from R #6

MikeChenfu opened this issue Jul 3, 2019 · 2 comments

Comments

@MikeChenfu
Copy link

Hello, I test the code and compare the results with R. Why is the number of result values different from R's result? I am a beginner to the NSGA. I appreciate if anyone has idea about it. Many thanks.

@Mirror-HHf
Copy link

您好,我测试了代码并将结果与​​R比较。为什么结果值的数量与R的结果不同?我是NSGA的初学者。如果有人对此有想法,我将不胜感激。非常感谢。

我在学习nsga2的时候,也发现这里可能有个错误,可否给个联系方式一起交流一下?

@antonkravtsevich
Copy link

antonkravtsevich commented Jan 9, 2020

Hello, I test the code and compare the results with R. Why is the number of result values different from R's result? I am a beginner to the NSGA. I appreciate if anyone has idea about it. Many thanks.

It seems like there is an issue in crowding_distance function - values for different axis is mixed together. There should be

    for k in range(1,len(front)-1):
        distance[k] = distance[k]+ (values1[sorted1[k+1]] - values1[sorted1[k-1]])/(max(values1)-min(values1))
    for k in range(1,len(front)-1):
        distance[k] = distance[k]+ (values2[sorted2[k+1]] - values2[sorted2[k-1]])/(max(values2)-min(values2))

instead of

    for k in range(1,len(front)-1):
        distance[k] = distance[k]+ (values1[sorted1[k+1]] - values2[sorted1[k-1]])/(max(values1)-min(values1))
    for k in range(1,len(front)-1):
        distance[k] = distance[k]+ (values1[sorted2[k+1]] - values2[sorted2[k-1]])/(max(values2)-min(values2))

I'm not for 100% sure that this is accurate fix, but it based on original paper (http://www.dmi.unict.it/mpavone/nc-cs/materiale/NSGA-II.pdf, p. 185, bottom of the page).

Hope it will help!

UPD: Just found out that there is already a pull request 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

3 participants