4 ms·
How does grade work? Can you customize how it ranks results?
by faitswulff 8y ago
How does grade work? Can you customize how it ranks results?
- i_don_t_know 8y agoIf you want to rank results differently, you'd apply a function to each element of the original vector that computes the rank / weight of that element. Then you sort by weights, and apply the result to the original vector. Something like: input[<{...compute weight of element x...}'input]
- toastking 8y agoThis is also how filtering works, you map a function that returns 0 or 1 over the list. Then you can call where (&) and it will give you the indices where the function evaluates true. Index by that and you'll filter a list.