2014-12-10 7 views
1

데이터를 cSPADE 호환 형식으로 변환하는 데 문제가 있습니다. Error in cspade(dataset1, parameter = list(support = 0.4), control = list(verbose = TRUE)) : slot transactionInfo: missing 'sequenceID' or 'eventID'arcsSequences - "transactions"형식으로 변환하는 중 오류가 발생했습니다.

,536 -

내 데이터 프레임 그것은 오류가 발생합니다

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

내가 사용 , dataset1<- as(dataset, "transactions")

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

을 실행 - 같은 - 보이는

누구나 위의 데이터 세트를 cSPADE 호환 형식으로 변환 할 수있는 방법에 대해 도움을받을 수 있습니까? 이와

답변

2

itry이 형식

소스 데이터 세트 :

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

첫번째 열은 시퀀스 ID를 나타는 제 2 열은 시퀀스의 길이, 시퀀스의 다음 요소 인 . 다음 :

data <- read_baskets(con = "./input_file.txt", info = c("sequenceID","eventID","SIZE")) 
rules<- cspade(data, 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 ... 1 partition(s), 0 MB [0.1s] 
mining transactions ... 0 MB [0.06s] 
reading sequences ... [0s] 

total elapsed time: 0.16s 

> inspect(rules) 
items support 
1 <{B}> 0.3333333 
2 <{C}> 0.3333333 
3 <{Q}> 0.3333333 
4 <{B, 
C}> 0.3333333 
+0

너무 감사 :

이 내 출력입니다! 그것은 효과가 있었다. –

관련 문제