Re: [R] Help regarding arules package

From: jim holtman <jholtman_at_gmail.com>
Date: Wed, 16 Jul 2008 22:12:14 -0400

How about computing the 'lhs' of the rules once and then using that information for the subsets.

On Wed, Jul 16, 2008 at 11:56 AM, Daniel Wagner <danieljm1976_at_yahoo.com> wrote:
> Dear R experts,
>
> I need help to make my little program efficient which now takes 2hrs to complete.
>
> Using arules package I developed set of rules consisted of 900 rules. Now I want to check whether a lower rule is a subset of a higher premises rule. And if it is a subset of higher premises rule then drop this rule. I am using following code but it takes too much time.
>
>
> nor<-length(rules)
> k<-rep(T, nor)
> for(i in 1:(nor-1)){
> for(j in (i+1):nor){
> if((is.subset(lhs(rules[i]),lhs(rules[j])) & is.subset(rhs(rules[i]), rhs(rules[j])))==T){
> k[i]<-F
> break
> }
> }
> }
>
> Could somebody help me.
>
> Thanks
>
> Daniel
> Amsterdam
>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 17 Jul 2008 - 02:18:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jul 2008 - 04:31:58 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive