xychang/RecursiveHierarchicalClustering

Time gap events

Italosayan opened this issue ยท 6 comments

image

How do I format time gap events on the input?

This is an amazing project.
Thank you!

Hi,

The code on GitHub is intended to be general purpose, which is why I did not include a time-gap.

But it is very easy to extend the code to display time gap.
If you look at visulization.py, you will see a comment saying "the second entry can be a longer description of the feature".
By changing the content of the second field in exclusions, to something like Click_on_sign_up, 7 the visualization code will translate the 7 into 1H. Note the (space)(comma) is used to separate time gap and auction fields.

To have self-defined time gaps, you need to go to whisper.js and modify actionTime.

Hope this answers your question.

Best,
Xinyi

Would you change visulization.py to something like this on line 97?
info['exclusions'][i] = exclusions = [info['exclusions'][i].split(", ")]

and the inputs to the following format?

1    Click_on_sign_up, 7(1)Other, 5(2)Other, 6(1)
2    Read_article, 8(1)Click_on_sign_up, 7(2)Other, 6(1)

Thank you!

I am not sure what you mean.

I will explain it in a bit more detail.

  1. This code on GitHub is intended to be general purpose, so I did not assume that there will be multiple events and time gap information in each feature.
  2. In exclusions:
    1. The first entry exclusions[0] contains the key associated with the feature, it is supposed to be a unique string.
    2. The second entry exclusions[1] contains a string that is used for display. When it does not contain any (space)(comma), it will be taken in by the visualizer to simply display the string.
      When it contains (space)(comma), it is separated into a list of strings, with all the strings at even indices (going from 0) interpreted as the string itself, and all the strings at odd indices interpreted as a token for time gap for the visulizer.

So you don't really need to change the input. What I would suggest doing is simply keep exclusions[0] as they originally are, and format exclusions[1] in a way that is the easiest to interpret by the one looking at the final visualization.

okok. Sounds good.

Will changing the exclusions[1] create this type of visualization on the action patterns?
screen shot 2018-01-30 at 11 52 09 am
With 2 or 3 actions on an action pattern?

Sorry for the trouble.

Yes, for example, if exlusions[1] is as follows,
"Friend Request, 5, Friend Request, 5, Friend Request"
It will create the visualization on the first row.

Thank you.