GymCoach
근력 트레이닝 기록 및 개인 AI 코치
손목 가속도와 활동 데이터를 이용해 수면을 추정하고, 자세·활동 변화 기반 수면 시간 안내
Estimates sleep from wrist accelerometry and epoch-level activity data. Implements sleep-period-time guiders based on angle changes, posture, least-active periods, sustained inactivity, low activity,
건강RGitHub @jhuwit온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Create Sleep Measures of Actigraphy and Activity Analysis
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗actisomni estimates sleep from wrist-worn accelerometry. It provides
sleep-period-time (SPT) guiders, sustained-inactivity-bout (SIB) labels,
consensus sleep labels, diary helpers, and wrappers for the asleep and
sleeper machine-learning models.
The guider functions identify a likely main sleep window. Combine one or more guiders with a SIB label when an epoch-level sleep/wake label is needed.
actisleep?The original package name was actisleep, but that conflicted with a
previous R package: https://CRAN.R-project.org/package=ActiSleep.
Install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("jhuwit/actisomni")
For epoch-level activity data, use an activity-based guider such as L5
and then apply a SIB label. The result has one logical sleep label per
epoch.
library(actisomni)
time <- as.POSIXct("2020-01-01 18:00:00", tz = "UTC") + 0:1439 * 60
epochs <- data.frame(
time = time,
activity = c(rep(20, 240), rep(0, 420), rep(20, 780)),
sib = c(rep(FALSE, 240), rep(TRUE, 420), rep(FALSE, 780))
)
guider <- acti_sleep_l5(epochs)
epochs$sleep <- acti_sleep_label(epochs$sib, guider)
head(epochs)
#> time activity sib sleep
#> 1 2020-01-01 18:00:00 20 FALSE FALSE
#> 2 2020-01-01 18:01:00 20 FALSE FALSE
#> 3 2020-01-01 18:02:00 20 FALSE FALSE
#> 4 2020-01-01 18:03:00 20 FALSE FALSE
#> 5 2020-01-01 18:04:00 20 FALSE FALSE
#> 6 2020-01-01 18:05:00 20 FALSE FALSE
For raw X/Y/Z acceleration, acti_sleep_sib() calculates the van Hees
SIB indicator and acti_sleep_ensemble() combines compatible guiders
into a consensus label. The example recording supplied by actiread can
be used directly:
library(actiread)
raw <- actiread::acti_read_gt3x(
actiread::acti_example_gt3x(),
verbose = FALSE
)
result <- acti_sleep_ensemble(raw, epoch = "5 seconds")
result$label_data
result$labels retains one label per guider, while result$fused
contains the consensus probability and logical consensus label.
When diary times are available, create a guider directly from onset and wake times. Times are inclusive at both endpoints.
diary_window <- acti_sleep_diary(
epochs,
onset = as.POSIXct("2020-01-01 22:00:00", tz = "UTC"),
wakeup = as.POSIXct("2020-01-02 06:00:00", tz = "UTC")
)
sum(diary_window$window)
#> [1] 481
acti_asleep() and acti_sleeper() both require complete, strictly
time-ordered raw triaxial data. They return the same columns: time,
sleep, sleep_probability, sleep_stage, nonwear, and method.
The models and their Python requirements are managed by the upstream
packages. For sleeper, download the model files first and provide
their directory as model_dir.
asleep_estimate <- acti_asleep(raw, verbose = FALSE)
sleeper_estimate <- acti_sleeper(raw, model_dir = "path/to/sleeper-models")
This work was supported by NIH P30AG021334 and the Johns Hopkins Older Americans Independence Center (OAIC) Pepper Center grant.