简体   繁体   中英

How to create a basket from a database table in orange(python package)?

I am using Orange in python to do market basket analysis using a data in the database table. But I couldn't find a way to do that as it needs data in .basket type. Is there a way to load the data as a .basket type? I am using MsSQL as the database.

Thank you

*.basket file format seems basically just a list of values, optionally with count other than the implied 1:

v1, v2, v3=4
v2, v5
v1, v5, v6
...

IIRC, this implies a table like the following:

v1  v2  v3  v4  v5  v6
1   1   4   0   0   0
0   2   0   0   1   0
1   0   0   0   1   1

But is somewhat shorter (sparse) as all the zeroed values need not be represented.

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