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

Error in filter_infrequent_flows() #52

Open
RobertoTCo opened this issue Apr 20, 2023 · 2 comments
Open

Error in filter_infrequent_flows() #52

RobertoTCo opened this issue Apr 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RobertoTCo
Copy link

Hi,

I've been trying to apply filter_infrequent_flows() function to eliminate those infrequent flows in process discovery. However, everytime I get returned the same error. You can try with the logs 'patients' or 'traffic_lines' (this last one is used as an example in the documentation).

patients %>% filter_infrequent_flows(min_n = 6) %>%process_map()

patients_act %>% filter_infrequent_flows(min_n = 6) %>%process_map()

traffic_fines %>%
     filter_infrequent_flows(min_n = 5) %>%
     process_map()

All of these examples return the same error.

"Error in `mutate()`:
ℹ In argument: `next_act = lead(activity, default = "END_ACT")`.
ℹ In group 1: `case_id = "A1"`.
Caused by error in `lead()`:
! Can't convert from `default` <character> to `x` <factor<e129f>> due to loss of generality.
• Locations: 1"

Is there another workaround I could apply to remove infrequent flows/traces? I think I could get the top most frequent cases (or otherway around) and use it to filter the log, but I should test it first.

The version of the packages I've been working with:
"[1] processcheckR_0.1.4 processmapR_0.5.2 eventdataR_0.3.1 edeaR_0.9.3 bupaR_0.5.3
[6] bupaverse_0.1.0"

@gertjanssenswillen
Copy link
Member

Seems a bug, will investigate

@gertjanssenswillen gertjanssenswillen added the bug Something isn't working label Apr 21, 2023
@RobertoTCo
Copy link
Author

For now, I've been using a workaround with trace_coverage(level="case") and filter() functions to select those case_id identifiers related to the top or bottom frequent traces. However, the function trace_coverage(level="case") does not return the cumulative sum of the relative frequencies as trace_coverage(level="trace") does. Perhaps it might be interesting to add that feature in the future? Apart from that, very powerful library.

@gertjanssenswillen gertjanssenswillen transferred this issue from bupaverse/bupaR Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants