0

I have this dataset (just a sample):

product1,product2,product3
product1,product4
product1,product2
product4,product3,product1,product2

The products are grouped by transaction. I want to create some data visualization using this dataset but I don't any tool or any type of visualization that allows creating some visualization with this structure...

Anyone can suggest me an option?

Thanks!

I feel desperate because they can not find anything that suits this data structure

Spacedman
  • 1,982
  • 11
  • 16
SaCvP
  • 173
  • 2
  • 12
  • 1
    But what do you want this visualisation for? What are you trying to find out? A visualisation is an answer to a question, and you haven't told us the question. – Spacedman Oct 11 '16 at 19:49
  • @Spacedman I want to find the strenght like a heat-map or a grid chart...A visualization that allows me to conclude what the most frequently item purchase together...but with this strucuture I can't find any tool – SaCvP Oct 11 '16 at 21:49
  • a similar question was asked recently [here](http://datascience.stackexchange.com/a/14409/23305), this would work for a not too large number of items – oW_ Oct 11 '16 at 23:20
  • How can a visualisation be any better than a sorted table of pair-wise occurrences? – Spacedman Oct 12 '16 at 07:13
  • @Spacedman Which type of tool/language did you recommend to produce that table? – SaCvP Oct 12 '16 at 08:12
  • Any language really. What do you know? Its a one-liner in the Unix shell using `awk`, for example: `awk -F, '{split($0,a,",");asort(a);for(i=1;i<=NF;i++){for(j=i+1;j<=NF;j++){print a[i],a[j]}} }' < sample.txt | sort | uniq -c| sort -rn` - produces a list of pairs with occurrence counts. – Spacedman Oct 12 '16 at 11:13
  • I guess you can use word cloud if you want to group by transaction for each – Balamurugan P Oct 14 '16 at 07:20

2 Answers2

1

Considering data stored in CSV format like below without headers you can use below R code to plot simple bar chart. It will plot occurrences of transactions grouped by unique transactions.

product1,product2,product3
product1,product4
product1,product2
product4,product3,product1,product2
product1,product2,product3
product1,product4
product1,product4

R Code -

transactions <- read.csv("filepath/transactions.csv", header = FALSE)
transactions$V1
plot(transactions$V1)

Bar Chart-

enter image description here

0

You can use plotly for making interactive visualization and charts. You can also give a try to Linkurious. Hope it helps. Cheers! :)

Abhishek
  • 1,949
  • 3
  • 14
  • 21