Skip to content

Commit

Permalink
Fix runtime bug in Radius of Gyration of Doryab Location.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikunjgoel95 committed Oct 10, 2020
1 parent b0cbc0a commit dcf1255
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/location_doryab/location_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,10 @@ def radius_of_gyration(locationData,sampling_frequency):

time_in_cluster = locationData[locationData["location_label"]==labels].shape[0]* sampling_frequency
rog = rog + (time_in_cluster * distance)

time_all_clusters = valid_clusters.shape[0] * sampling_frequency
if time_all_clusters == 0:
return 0
final_rog = (1/time_all_clusters) * rog

return np.sqrt(final_rog)
Expand Down

0 comments on commit dcf1255

Please sign in to comment.