-
Notifications
You must be signed in to change notification settings - Fork 626
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
Add more window transform examples #3572
Comments
The window_student_rank.vl.json doesn't show anything -- so I'm gonna remove it first. Please correct it and submit them in a follow-up PR. I also wonder why the frame for rank and count isn't the same. (Maybe it's correct, but I want to understand why -- given that it's not showing anything I suspect that it's wrong.)
|
Rank and Count have different frames because they compute two different things. Rank Window Transform computes "how many students am I better than?" (rank) and the Count Window Transform computes "how many students total?" (totalStudents) To get the Top K, I select (totalStudents - Rank) < K. Which means the top scoring student would be better than all students, so Rank would be equal to TotalStudents. The second student will have a Rank of Total Students - 1, so totalStudents - (totalStudents - 1) = 1, and so forth. This way the best student will get 0, the second best will get 1, and we can filter all these values while the value produced is less than K to get the top K students. The fix here was to change I have a WIP PR for these changes and other examples: #3573 |
You rationale still doesn't explain why rank would use |
I wasn't sure whether I can change it to |
I d say test and see what s right. |
Update on this: After checking with the vega channel, rank does not rely on the frame. So I moved the example to have |
window
in the transform array #2488 (comment) (Good data would be sport league ranking)(Add to window.md)
The text was updated successfully, but these errors were encountered: