Chris Chinedozie
2019-Sep-14 20:27 UTC
[R] How can I compare two apriori rules created from the same dataset
I have a dataset and I divided it into 2 datasets RANDOMLY A and B, where A is 70% of the main dataset and B is 30%... Then I applied Apriori algorithm on the both A and B separately, generating its rules.. I want to compare rules from dataset A to rules of dataset B example: A has the following rules [(sex=0,age=1),(sex=1,age=1,money=0),(sex=0,age=2,money=2)] B has the following rules [(sex=0,age=1,money=1),(sex=0,age=1,money=0),(sex=1,age=1,money=0)] A(sex=0,age=1) => B(sex=0,age=1,money=1) returns TRUE A(sex=1,age=1,money=0) => B(sex=1,age=1,money=0)) returns TRUE A(sex=0,age=2,money=2) => B(sex=1,age=1,money=0) returns FALSE -- Chris G. Chinedozie Universidade Federal do Rio de Janeiro [[alternative HTML version deleted]]
Bert Gunter
2019-Sep-14 20:57 UTC
[R] How can I compare two apriori rules created from the same dataset
I am guessing that you are using the arules package, correct? If not, what package? In future, please specify what package you refer to if not one of those in a standard distro. Usually, package specific questions should be directed to package maintainers (?maintainer) or support sites for the packages, but you may get lucky here. Sorry, but I can't help beyond that. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Sep 14, 2019 at 1:35 PM Chris Chinedozie <chrismomentus at gmail.com> wrote:> I have a dataset and I divided it into 2 datasets RANDOMLY A and B, where A > is 70% of the main dataset and B is 30%... Then I applied Apriori algorithm > on the both A and B separately, generating its rules.. > I want to compare rules from dataset A to rules of dataset B > example: > A has the following rules > [(sex=0,age=1),(sex=1,age=1,money=0),(sex=0,age=2,money=2)] > > B has the following rules > [(sex=0,age=1,money=1),(sex=0,age=1,money=0),(sex=1,age=1,money=0)] > A(sex=0,age=1) => B(sex=0,age=1,money=1) returns TRUE > A(sex=1,age=1,money=0) => B(sex=1,age=1,money=0)) returns TRUE > A(sex=0,age=2,money=2) => B(sex=1,age=1,money=0) returns FALSE > > > -- > Chris G. Chinedozie > Universidade Federal do Rio de Janeiro > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]
Benoit Vaillant
2019-Sep-15 11:46 UTC
[R] How can I compare two apriori rules created from the same dataset
Hello Chris, On Sat, Sep 14, 2019 at 05:27:31PM -0300, Chris Chinedozie wrote:> I have a dataset and I divided it into 2 datasets RANDOMLY A and B, where A > is 70% of the main dataset and B is 30%... Then I applied Apriori algorithm > on the both A and B separately, generating its rules..My best guess is that you don't want to do that. Association rules hugely rely on support for building the itemset. And then confidence for the orientation of the rule. Both are very simple metrics. Yet if you divide your dataset, this will lead to very different itemsets due to the algorithm.> I want to compare rules from dataset A to rules of dataset BCan you precise ? compare ??> example: > A has the following rules > [(sex=0,age=1),(sex=1,age=1,money=0),(sex=0,age=2,money=2)] > > B has the following rules > [(sex=0,age=1,money=1),(sex=0,age=1,money=0),(sex=1,age=1,money=0)]Aren't these itemsets rather than rules?> A(sex=0,age=1) => B(sex=0,age=1,money=1) returns TRUE > A(sex=1,age=1,money=0) => B(sex=1,age=1,money=0)) returns TRUE > A(sex=0,age=2,money=2) => B(sex=1,age=1,money=0) returns FALSEI don't see rules, nor sense. Can you clarify? Thanks! -- Beno?t Vaillant -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 866 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20190915/b102bb5d/attachment.sig>