-
Notifications
You must be signed in to change notification settings - Fork 23
feat: label propagation algorithm #78
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
Conversation
| } | ||
|
|
||
| /** | ||
| * 标签传播算法 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否能统一为英文注释~
| * ... | ||
| * } | ||
| */ | ||
| const neighbors: { [key: ID]: { [key: ID]: number } } = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为新版的 ID 支持数字,这里使用对象,key 可能出现无法区分 0 和 "0" 的情况。可以测试看看会不会有这个问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实是会存在这个问题,我修改一下
packages/graph/src/utils.ts
Outdated
| return Math.sqrt(res); | ||
| } | ||
|
|
||
| export const uniqueId = (index: number = 0) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
咦我记得有 uniqueId 这个工具方法呀,在 @antv/util 里面
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okok 我改一下,我看之前的是自己写的就直接挪过来了
packages/graph/src/utils.ts
Outdated
| return Math.sqrt(res); | ||
| } | ||
|
|
||
| export const uniqueId = (index: number = 0) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那这段是不是可以删掉了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的问题😭
算法在大规模数据时跑的结果不同,可能是由于label propagation算法对输入数据太敏感,目前正在排查中