Exponentially decaying rank accourding to datetime in c#
I am looking for helpon how to give an exponentially decaying weight according to time. I am writing a small web searching program in c# and want to rank search results according to a time decaying factor. Can anybody help, i am a newbie 开发者_Go百科to ranking algorithms.
1) Subtract your time values from your reference time (in a real time environment that would be DateTime.Now
) to give you a Timespan
.
2) Using this Timespan
, use one of the Total methods (i.e. TotalHours
) to get a double value.
3) If you want to do exponentially decaying weights, then try looking at this:
Exponential Moving Averages
Exponential is called exponential because of the properties of a mathematical exponent. Take the age of the result and do the following:
rankAdjustment = age ^ age;
That will give you an adjustment to your rank that exponentially changes with length of time.
精彩评论