seqefsub(TraMineR)
seqefsub()所属R语言包:TraMineR
Searching for frequent subsequences
寻找频繁子序列
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Returns the list of subsequences with minimal support sorted in decreasing order of support. Various time constraints can be set to restrict the search to specific time periods or subsequence durations. The function permits also to get information on specified subsequences.
返回列表中的子序列的支持递减的顺序排序最小的支持。可以设置各种时间限制来限制搜索在特定时间段或子序列的持续时间。该功能允许在指定的子序列来获取信息。
用法----------Usage----------
seqefsub(seq, strsubseq = NULL, minSupport = NULL,
pMinSupport = NULL, constraint = seqeconstraint(), maxK = -1,
weighted = TRUE)
参数----------Arguments----------
参数:seq
A list of event sequences
列表的事件序列
参数:strsubseq
A list of specific subsequences to look for. See details.
具体的子序列列表中去寻找。查看详细信息。
参数:minSupport
The minimum support (in number of sequences)
最低支持(序列数)
参数:pMinSupport
The minimum support (in percentage, will be rounded)
最小支持度(以百分比表示,将四舍五入)
参数:constraint
A time constraint object as returned by seqeconstraint
时间约束对象返回seqeconstraint
参数:maxK
The maximum number of events allowed in a subsequence
一个子序列中允许的最大数目的事件
参数:weighted
Logical. If TRUE, seqefsub use the weights specified in seq (see seqeweight).
逻辑。如果TRUE,seqefsub使用seq(见seqeweight指定的权重的)。
Details
详细信息----------Details----------
There are two usages of this function. The first is for searching subsequences satisfying a support condition. By default, the support is counted per sequence and not per occurrence, i.e. when a sequence contains twice a same subsequence it is counted only once. Use the countMethod argument of seqeconstraint to change that. The minimal required support can be set with pMinSupport as a proportion (between 0 and 1) in which case it will be rounded, or through minSupport as a number of sequences. Time constraints can also be imposed with the constraint argument, which must be the outcome of a call to the seqeconstraint function).
这个函数有两种用法。第一个问题是寻找满足支持条件的子序列。默认情况下,支持每个序列计算,而不是按发生时,即当一个序列包含两次相同的序列仅计数一次。使用countMethod的seqeconstraint参数改变这种状况。可以设置与pMinSupport,因为,在这种情况下,它将被舍入的比例(在0和1之间),或通过minSupport作为一个的序列数所需的最小支持。由于时间紧张,也可以并处constraint参数,该参数必须是结果的调用seqeconstraint功能的)。
The second possibility is for searching sequences that contain specified subsequences. This is done by passing the list of subsequences with the strsubseq argument. The subsequences must be in the same format as that used to display subsequences (see str.seqelist). Each transition (group of events) should be enclosed in parentheses () and separated with commas, and the succession of transitions should be denoted by a '-' indicating a time gap. For instance "(FullTime)-(PartTime, Children)" stands for the subsequence "FullTime" followed by the transition defined by the two simultaneously occurring events "PartTime" and "Children".
第二个可能性是,用于搜索包含指定的子序列的序列。这样做是通过子序列strsubseq参数列表。子序列必须是相同的格式,用于显示的子序列(见str.seqelist)。每一个的过渡(组事件),应括在括号(),并用逗号分隔,并应继承的转换表示用 - 表示一个时间上的差距。比如“(全日制) - (兼职,儿童)”代表在随后进行的“全职杀手”,然后两个同时发生的事件“兼职”和“儿童”定义的过渡。
Information about the sequences that contain the subsequences can then be obtained with the seqeapplysub function.
关于包含该子序列的序列的信息,然后可以得到seqeapplysub功能。
Subsets of the returned subseqelist can be accessed with the [] operator (see example). There are print and plot methods for subsequelist.
子集返回的subseqelist可以访问[]运算符(请参见示例)。有打印和图方法subsequelist。
值----------Value----------
A subseqelist object which contain at least the following objects:
Asubseqelist对象至少包含以下对象:
参数:seqe
The list of sequences in which the subsequences were searched (a seqelist event sequence object).
的序列,其中的子序列搜索(seqelist事件序列对象)的列表。
参数:subseq
A list of subsequences (a seqelist event sequence object).
的子序列(seqelist事件序列对象)的列表。
参数:data
A data frame containing details (support, frequency, ...) about the subsequences
一个数据框包含的详细信息(支持,频率,...)的子序列
参数:constraint
The constraint object used when searching the subsequences.
搜索的子序列的约束对象时使用。
参数:type
The type of search: 'frequent' or 'user'
搜索类型:“频繁”或“用户”
参见----------See Also----------
See plot.subseqelist to plot the result. See seqecreate for creating event sequences. See seqeapplysub to count the number of occurrences of frequent subsequences in each sequence. See is.seqelist about seqelist.
见plot.subseqelist绘制的结果。见seqecreate用于创建事件序列。 seqeapplysub数一数每个序列的子序列中频繁出现的。请参阅is.seqelistseqelist。
实例----------Examples----------
data(actcal.tse)
actcal.seqe <- seqecreate(actcal.tse)
##Searching for frequent subsequences, that is, appearing at least 20 times[#搜索频繁的子序列,即,出现至少20倍]
fsubseq <- seqefsub(actcal.seqe, minSupport=20)
##The same using a percentage[#同样的百分比]
fsubseq <- seqefsub(actcal.seqe, pMinSupport=0.01)
##Getting a string representation of subsequences[#获取的字符串表示形式的子序列]
##Ten first subsequences[十子序列]
fsubseq[1:10]
##Using time constraints[#使用时间限制]
##Looking for subsequence starting in summer (between june and september)[#寻找序列开始在夏季(六月至九月)]
fsubseq <- seqefsub(actcal.seqe, minSupport=10,
constraint=seqeconstraint(ageMin=6, ageMax=9))
fsubseq[1:10]
##Looking for subsequence contained in summer (between june and september)[#寻找序列中包含的夏季(六月至九月)]
fsubseq <- seqefsub(actcal.seqe, minSupport=10,
constraint=seqeconstraint(ageMin=6, ageMax=9, ageMaxEnd=9))
fsubseq[1:10]
##Looking for subsequence enclosed in a 6 month period[#寻找序列在6个月期间内]
## and with a maximum gap of 2 month[#和具有最大间隙的2个月]
fsubseq <- seqefsub(actcal.seqe, minSupport=10,
constraint=seqeconstraint(maxGap=2, windowSize=6))
fsubseq[1:10]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|