Class: Wikipedia::VandalismDetection::Features::TimeOfDay
- Defined in:
- lib/wikipedia/vandalism_detection/features/time_of_day.rb
Overview
This feature calculates the time of day of new revision edit as decimal value .
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#calculate(edit) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/wikipedia/vandalism_detection/features/time_of_day.rb', line 11 def calculate(edit) super = edit.new_revision. time = DateTime.parse() time.hour.to_f + (time.min / 60.0) + (time.sec / 360.0) end |