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

How to find support of given sequences and subsequences? #31

Open
tlicquia opened this issue Jul 13, 2020 · 0 comments
Open

How to find support of given sequences and subsequences? #31

tlicquia opened this issue Jul 13, 2020 · 0 comments

Comments

@tlicquia
Copy link

Hi,

First, I'm hoping you can help me find the support for all sequences of any length in my database (db) that end with a particular item (e.g., 'LATE').
Is the best method to do this as shown below? (note: 'LATE' is always the final item in the sequence if it is present)
ps = PrefixSpan(db)
LATE_results = ps.frequent(1, filter=lambda patt, matches: 'LATE' in patt == True)

Second, after achieving the result above, what is the best way to take every sequence present in LATE_results, remove 'LATE' from the sequence, and then calculate the support of the remaining subsequence in the original db? I'm not sure whether to use the filter, key, or callback options for this.

Ultimately, I am trying to use your great package to perform sequential rule mining. In other words, I want to calculate support(subsequence_i --> LATE) / support(subsequence_i) for all sequences that end in 'LATE'. Another example of this would look like support (A --> B --> F --> G --> LATE) / support(A --> B --> F --> G).

Thank you in advance for any guidance you can provide!

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