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
• 10,290 points
83 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,000 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer
0 votes
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,000 points
195 views
0 votes
1 answer
0 votes
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,000 points
191 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,000 points
16 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,000 points
51 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,000 points
162 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,000 points
39 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.