Empty association rules

131 views
Skip to first unread message

Gabriel Siqueira

unread,
Sep 6, 2017, 5:17:01 PM9/6/17
to mlxtend
Hi,

I'm working through an example of Market Basket (association) analysis using mlxtend I found here and using this dataset.
I'm replicating exactly what is being suggested in this article but the last step doesn't work as expected for me. Here's what I'm doing:


This works as expected. Then, like in the example, I try to generate the rules but all I get is an empty dataframe, even if removing the lift threshold from the image below:

This was done using Jupyter Notebook and Python 3.6.2, both installed through the latest version of Anaconda. I've tried using the latest stable version of mlxtend and the latest dev version.

This is my first time using mlxtend and I'd appreciate some pointers on what I'm doing wrong and what could I try to solve this.

Thanks!

Sebastian Raschka

unread,
Sep 6, 2017, 5:40:42 PM9/6/17
to Gabriel Siqueira, mlxtend
Hm, that's weird. I just executed the code examples from the tutorial link you provided and it works fine for me. What's weird is that frequent_itemsets only has 5 rows in your case (unless you shortened it, it should be 50); maybe there was an error in parsing the excel table, or you only read in a subset of it?
Or maybe you did something to the frequent_itemsets between cell 7-12?

Best,
Sebastian

> On Sep 6, 2017, at 5:17 PM, Gabriel Siqueira <gdssi...@gmail.com> wrote:
>
> Hi,
>
> I'm working through an example of Market Basket (association) analysis using mlxtend I found here and using this dataset.
> I'm replicating exactly what is being suggested in this article but the last step doesn't work as expected for me. Here's what I'm doing:
>
>
>
>
> This works as expected. Then, like in the example, I try to generate the rules but all I get is an empty dataframe, even if removing the lift threshold from the image below:
>
>
> This was done using Jupyter Notebook and Python 3.6.2, both installed through the latest version of Anaconda. I've tried using the latest stable version of mlxtend and the latest dev version.
>
> This is my first time using mlxtend and I'd appreciate some pointers on what I'm doing wrong and what could I try to solve this.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "mlxtend" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mlxtend+u...@googlegroups.com.
> To post to this group, send email to mlx...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mlxtend/fbb2f06c-af40-4048-9d56-cdd365c6732a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Gabriel Siqueira

unread,
Sep 6, 2017, 5:53:36 PM9/6/17
to mlxtend, gdssi...@gmail.com
You're right. Thank you for the prompt response.

I didn't do anything between 7 and 12 - the numbering difference is due to me having taken the SS at a different time and having executed a few other cells a couple of times more inbetween.

Now the mistake is in a previous step, where the example filters the data set by country (France). I removed the filtering by country to try and get a general trend, but apparently I broke something while doing that. Filtering a single country works fine.
I'll try and fix my code and report back if I succeed.

Thanks again!
Reply all
Reply to author
Forward
0 new messages