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

Feat: Get related items of a given item order by support #4

Open
artsnr1 opened this issue Nov 12, 2020 · 0 comments
Open

Feat: Get related items of a given item order by support #4

artsnr1 opened this issue Nov 12, 2020 · 0 comments

Comments

@artsnr1
Copy link

artsnr1 commented Nov 12, 2020

Currently it gives me all possible itemsets.
What I want is a function that accepts an item and returns all its pairs (excluding itself) sorted in order of support
getRelatedItems(item, maxItems?)

var transactions = [
[1, 3, 4],
[2, 3, 5],
[1, 2, 3, 5],
[2, 5],
[1, 2, 3, 5]
];
getRelatedItems(1) // Output: [3, 5, 2]
getRelatedItems(2) // Output: [5, 3, 1]
getRelatedItems(3) // Output: [5, 2, 1]
getRelatedItems(4) // Output: []
getRelatedItems(5) // Output: [2, 3, 1]

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