Error saying missing sequenceID or eventID when trying to convert my data into cSPADE compatible format

0 votes

I'm unable to convert my data into cSPADE compatible format.

My data frame looks like-

 key type1 type2 type3 
 A-1  A     B     C
 B-2  P     Q    NA
 C-3  X     NA   NA

When I use, dataset1<- as(dataset, "transactions") and run-

rules<- cspade(dataset1, parameter = list(support = 0.4), control = list(verbose = TRUE))

It throws an error - 

Error in cspade(dataset1, parameter = list(support = 0.4), control = list(verbose = TRUE)) : slot transactionInfo: missing 'sequenceID' or 'eventID'
Nov 15, 2018 in Data Analytics by Ali
• 11,360 points
1,170 views

1 answer to this question.

0 votes

Try this:

source dataset in this format:

1 3 A B C
2 2 P Q    
3 1 X

the first column is for the id of sequence, the second columns is for the length of sequence and then the elements of sequences. Then:

data <- read_baskets(con = "./input_file.txt", info = c("sequenceID","eventID","SIZE"))
rules<- cspade(data, parameter = list(support = 0.4), control = list(verbose = TRUE))
answered Nov 15, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

+1 vote
1 answer
0 votes
1 answer
+1 vote
1 answer

Error saying cannot open file 'file.pdf' when trying to save a plot in ggplot

You could try adding the following line ...READ MORE

answered Nov 9, 2018 in Data Analytics by Maverick
• 10,840 points
7,541 views
0 votes
1 answer
+1 vote
1 answer

Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
4,368 views
+1 vote
2 answers
0 votes
1 answer

Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
549 views
0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
1,414 views
0 votes
1 answer

Error saying "duplicate 'row.names' are not allowed" when trying to setup my data for the mlogit-package

Take out the chid.var argument in your call to mlogit.data, ...READ MORE

answered Nov 12, 2018 in Data Analytics by Maverick
• 10,840 points
1,753 views
0 votes
1 answer

Error saying "Failed to get an access token." when trying to access my Google Analytics API

Try this: library(RGoogleAnalytics) oauth_token <- Auth( client.id = ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
1,029 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP