简体   繁体   中英

How to extract frequent itemsets from a column in a CSV file with Orange3?

The frequent itemset widget in Oragne3 expects its input from a File widget. The file containing the “transactions” is supposed to be a basket like in the example:

Bread, Milk
Bread, Diapers, Beer, Eggs
Milk, Diapers, Beer, Cola
Bread, Milk, Diapers, Beer
Bread, Milk, Diapers, Cola

But my file actually has a column with a user id and a second column with the actual transaction, something like this:

XYZ001, "Bread, Milk"
XYZ002, "Bread, Diapers, Beer, Eggs"
XYZ003, "Milk, Diapers, Beer, Cola"
XYZ004, "Bread, Milk, Diapers, Beer"
XYZ005, "Bread, Milk, Diapers, Cola"

How can I pass the transaction (second column) to the frequent itemset widget?

Transform your basket file like this:

user=1, Bread, Milk
user=2, Bread, Diapers, Beer, Eggs
user=3, Milk, Diapers, Beer, Cola
user=4, Bread, Milk, Diapers, Beer
user=5, Bread, Milk, Diapers, Cola

Then do whatever you want to (ie strip) the user column?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM