Its my first time on here and my maths is poor so please be kind. I am working on a Masters dissertation focused on document clustering methods in which I would like to apply a weight based on the time interval between two documents.
I am looking for some help coming up with a function to express a time interval with results between 0 and 1. The reason I want to map the results to a maximum value of zero is that this is being applied as a weight to a cosine similarity metric where identical articles would receive a cosine measurement of 1 etc.
Example 1, the date difference between 31/05/2015 and 20/06/2015 is 9 days. Example 2, the date difference between 31/05/2015 and 20/01/2015 is 129 days.
I would like to apply a function whereby example 1 has a higher value (towards the 1 end of the scale) and example 2 has a lower value (towards the 0 end of the scale). If the date difference was only 1, the value of 1 should apply.
I hope this makes sense. Any help anyone can offer me would be greatly appreciated.
Thank You
Claire
Do you have a maximum and minimum date? If so, I suggest you simply divide the number by the number of days between the maximum and the minimum.