简体   繁体   中英

What causes this error: Error cSPADE algorithm 'eid' invalid

I create a transaction in R to pass it through the cSPADE algorithm.

This is the head of the transaction:

> inspect(head(trans_matrix))
    items                             sequenceID eventID SIZE
[1] {-8.6125_41.1425}                 263685362  0       1   
[2] {-8.6125_41.1475}                 263685362  3       1   
[3] {-8.6025_41.1475,-8.6075_41.1475} 263685362  4       2   
[4] {-8.5725_41.1525}                 263685462  0       1   
[5] {-8.5775_41.1475,-8.5775_41.1525} 263685462  2       2   
[6] {-8.5825_41.1475}                 263685462  3       1   

When I run the cspade function I get the following error:

> cs <- cspade(trans_matrix, parameter = list(support = 0.4), control = list(verbose = TRUE))

parameter specification:
support : 0.4
maxsize :  10
maxlen  :  10

algorithmic control:
bfstype  : FALSE
verbose  :  TRUE
summary  : FALSE
tidLists : FALSE

preprocessing ...Error in makebin(data, file) : 'eid' invalid

I've read that the error is because it repeats sequenceID and eventID convinations, but I've been checking the dataset and it doesn't.

I've been working on the answer to the problem. I have found the solution and I am sharing it with you in case anyone has a similar problem. The cSPADE algorithm does not allow negative numbers, but what I have not taken into account is that it does not allow the number '0' either. So in the eventID you have to change that ID, just adding one to all, for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM