Skip to content

Instantly share code, notes, and snippets.

@cicimen
Last active February 14, 2023 17:28
Show Gist options
  • Save cicimen/d668c4d962828a22965d2c5dae4fce96 to your computer and use it in GitHub Desktop.
Save cicimen/d668c4d962828a22965d2c5dae4fce96 to your computer and use it in GitHub Desktop.
interoceptive_accuracy
# 1. person
recorded_heart_beats = [50.0, 45.0, 40.0]
real_heart_beats = [50.0, 45.0, 40.0]
temp = 0.0
for i in range(len(recorded_heart_beats)):
temp = temp + (1 - abs(recorded_heart_beats[i] - real_heart_beats[i]) / real_heart_beats[i])
interoceptive_accuracy = temp / len(recorded_heart_beats)
print("interoceptive_accuracy 1. person")
print(interoceptive_accuracy) # 1.0
# 2. person
recorded_heart_beats = [40.0, 50.0, 45.0]
real_heart_beats = [50.0, 45.0, 40.0]
temp = 0.0
for i in range(len(recorded_heart_beats)):
temp = temp + (1 - abs(recorded_heart_beats[i] - real_heart_beats[i]) / real_heart_beats[i])
interoceptive_accuracy = temp / len(recorded_heart_beats)
print("interoceptive_accuracy 2. person")
print(interoceptive_accuracy) # 0.8546296296296297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment