rapids/0.2/setup/configuration/index.html

1864 lines
71 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.1.4+insiders-1.9.0">
<title>Configuration - RAPIDS</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.a2a6bca7.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.c308bc62.min.css">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
<link rel="stylesheet" href="../../stylesheets/extra.css">
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="blue" data-md-color-accent="blue">
<script>var palette=JSON.parse(localStorage.getItem("__palette")||"{}");if(void 0!==palette.color)for(var key in palette.color)document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#configuration" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href="../.." title="RAPIDS" class="md-header-nav__button md-logo" aria-label="RAPIDS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 18.31V20a2 2 0 01-2 2H7a2 2 0 01-2-2v-3.7c-.46-.18-1.05-.3-2-.3a1 1 0 01-1-1 1 1 0 011-1c.82 0 1.47.08 2 .21V12.3c-.46-.18-1.05-.3-2-.3a1 1 0 01-1-1 1 1 0 011-1c.82 0 1.47.08 2 .21V8.3C4.54 8.12 3.95 8 3 8a1 1 0 01-1-1 1 1 0 011-1c.82 0 1.47.08 2 .21V4a2 2 0 012-2h10a2 2 0 012 2v2.16c1.78.31 2.54.97 2.71 1.13.39.39.39 1.03 0 1.42-.39.39-.91.38-1.42 0 0 0-1.04-.71-3.29-.71-1.26 0-2.09.41-3.05.9-1.04.51-2.21 1.1-3.95 1.1-.36 0-.69 0-1-.04V7.95c.3.05.63.05 1 .05 1.26 0 2.09-.41 3.05-.89C14.09 6.59 15.27 6 17 6V4H7v16h10v-2c1.5 0 1.97.29 2 .31M17 10c-1.73 0-2.91.59-3.95 1.11-.96.48-1.79.89-3.05.89-.37 0-.7 0-1-.05v2.01c.31.04.64.04 1 .04 1.74 0 2.91-.59 3.95-1.1.96-.48 1.79-.9 3.05-.9 2.25 0 3.29.71 3.29.71.51.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.42C21.5 11.08 20.25 10 17 10m0 4c-1.73 0-2.91.59-3.95 1.11-.96.48-1.79.89-3.05.89-.37 0-.7 0-1-.05v2.01c.31.04.64.04 1 .04 1.74 0 2.91-.59 3.95-1.1.96-.48 1.79-.9 3.05-.9 2.25 0 3.29.71 3.29.71.51.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.42C21.5 15.08 20.25 14 17 14z"/></svg>
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<div class="md-header-nav__topic">
<span class="md-ellipsis">
RAPIDS
</span>
</div>
<div class="md-header-nav__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Configuration
</span>
</div>
</div>
</div>
<div class="md-header-nav__options">
<button class="md-header-nav__button md-icon" title="Switch to light mode" aria-label="Switch to light mode" data-md-option="palette" data-md-color-scheme="default" data-md-color-primary="blue" data-md-color-accent="blue" data-md-state="hidden">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 7H7a5 5 0 00-5 5 5 5 0 005 5h10a5 5 0 005-5 5 5 0 00-5-5m0 8a3 3 0 01-3-3 3 3 0 013-3 3 3 0 013 3 3 3 0 01-3 3z"/></svg>
</button>
<button class="md-header-nav__button md-icon" title="Switch to dark mode" aria-label="Switch to dark mode" data-md-option="palette" data-md-color-scheme="slate" data-md-color-primary="blue" data-md-color-accent="blue" data-md-state="hidden">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m10-3a5 5 0 015 5 5 5 0 01-5 5H7a5 5 0 01-5-5 5 5 0 015-5h10M7 9a3 3 0 00-3 3 3 3 0 003 3h10a3 3 0 003-3 3 3 0 00-3-3H7z"/></svg>
</button>
</div>
<label class="md-header-nav__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header-nav__source">
<a href="https://github.com/carissalow/rapids/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05L244 40.45a28.87 28.87 0 00-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 01-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 000 40.81l195.61 195.6a28.86 28.86 0 0040.8 0l194.69-194.69a28.86 28.86 0 000-40.81z"/></svg>
</div>
<div class="md-source__repository">
carissalow/rapids
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="RAPIDS" class="md-nav__button md-logo" aria-label="RAPIDS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 18.31V20a2 2 0 01-2 2H7a2 2 0 01-2-2v-3.7c-.46-.18-1.05-.3-2-.3a1 1 0 01-1-1 1 1 0 011-1c.82 0 1.47.08 2 .21V12.3c-.46-.18-1.05-.3-2-.3a1 1 0 01-1-1 1 1 0 011-1c.82 0 1.47.08 2 .21V8.3C4.54 8.12 3.95 8 3 8a1 1 0 01-1-1 1 1 0 011-1c.82 0 1.47.08 2 .21V4a2 2 0 012-2h10a2 2 0 012 2v2.16c1.78.31 2.54.97 2.71 1.13.39.39.39 1.03 0 1.42-.39.39-.91.38-1.42 0 0 0-1.04-.71-3.29-.71-1.26 0-2.09.41-3.05.9-1.04.51-2.21 1.1-3.95 1.1-.36 0-.69 0-1-.04V7.95c.3.05.63.05 1 .05 1.26 0 2.09-.41 3.05-.89C14.09 6.59 15.27 6 17 6V4H7v16h10v-2c1.5 0 1.97.29 2 .31M17 10c-1.73 0-2.91.59-3.95 1.11-.96.48-1.79.89-3.05.89-.37 0-.7 0-1-.05v2.01c.31.04.64.04 1 .04 1.74 0 2.91-.59 3.95-1.1.96-.48 1.79-.9 3.05-.9 2.25 0 3.29.71 3.29.71.51.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.42C21.5 11.08 20.25 10 17 10m0 4c-1.73 0-2.91.59-3.95 1.11-.96.48-1.79.89-3.05.89-.37 0-.7 0-1-.05v2.01c.31.04.64.04 1 .04 1.74 0 2.91-.59 3.95-1.1.96-.48 1.79-.9 3.05-.9 2.25 0 3.29.71 3.29.71.51.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.42C21.5 15.08 20.25 14 17 14z"/></svg>
</a>
RAPIDS
</label>
<div class="md-nav__source">
<a href="https://github.com/carissalow/rapids/" title="Go to repository" class="md-source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05L244 40.45a28.87 28.87 0 00-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 01-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 000 40.81l195.61 195.6a28.86 28.86 0 0040.8 0l194.69-194.69a28.86 28.86 0 000-40.81z"/></svg>
</div>
<div class="md-source__repository">
carissalow/rapids
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" checked>
<label class="md-nav__link" for="nav-2">
Setup
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Setup" data-md-level="1">
<label class="md-nav__title" for="nav-2">
<span class="md-nav__icon md-icon"></span>
Setup
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../file-structure/" class="md-nav__link">
File Structure
</a>
</li>
<li class="md-nav__item">
<a href="../installation/" class="md-nav__link">
Installation
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Configuration
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
Configuration
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#database-credentials" class="md-nav__link">
Database credentials
</a>
</li>
<li class="md-nav__item">
<a href="#timezone-of-your-study" class="md-nav__link">
Timezone of your study
</a>
<nav class="md-nav" aria-label="Timezone of your study">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#single-timezone" class="md-nav__link">
Single timezone
</a>
</li>
<li class="md-nav__item">
<a href="#multiple-timezones" class="md-nav__link">
Multiple timezones
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#participant-files" class="md-nav__link">
Participant files
</a>
<nav class="md-nav" aria-label="Participant files">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#structure-of-participants-files" class="md-nav__link">
Structure of participants files
</a>
</li>
<li class="md-nav__item">
<a href="#automatic-creation-of-participant-files" class="md-nav__link">
Automatic creation of participant files
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#time-segments" class="md-nav__link">
Time Segments
</a>
<nav class="md-nav" aria-label="Time Segments">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#segment-examples" class="md-nav__link">
Segment Examples
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#device-data-source-configuration" class="md-nav__link">
Device Data Source Configuration
</a>
</li>
<li class="md-nav__item">
<a href="#sensor-and-features-to-process" class="md-nav__link">
Sensor and Features to Process
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../execution/" class="md-nav__link">
Execution
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3" >
<label class="md-nav__link" for="nav-3">
Example Workflows
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Example Workflows" data-md-level="1">
<label class="md-nav__title" for="nav-3">
<span class="md-nav__icon md-icon"></span>
Example Workflows
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../workflow-examples/minimal/" class="md-nav__link">
Minimal
</a>
</li>
<li class="md-nav__item">
<a href="../../workflow-examples/analysis/" class="md-nav__link">
Analysis
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" >
<label class="md-nav__link" for="nav-4">
Behavioral Features
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Behavioral Features" data-md-level="1">
<label class="md-nav__title" for="nav-4">
<span class="md-nav__icon md-icon"></span>
Behavioral Features
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/feature-introduction/" class="md-nav__link">
Introduction
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4-2" type="checkbox" id="nav-4-2" >
<label class="md-nav__link" for="nav-4-2">
Phone
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Phone" data-md-level="2">
<label class="md-nav__title" for="nav-4-2">
<span class="md-nav__icon md-icon"></span>
Phone
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/phone-accelerometer/" class="md-nav__link">
Phone Accelerometer
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-activity-recognition/" class="md-nav__link">
Phone Activity Recognition
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-applications-foreground/" class="md-nav__link">
Phone Applications Foreground
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-battery/" class="md-nav__link">
Phone Battery
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-bluetooth/" class="md-nav__link">
Phone Bluetooth
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-calls/" class="md-nav__link">
Phone Calls
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-conversation/" class="md-nav__link">
Phone Conversation
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-data-yield/" class="md-nav__link">
Phone Data Yield
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-light/" class="md-nav__link">
Phone Light
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-locations/" class="md-nav__link">
Phone Locations
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-messages/" class="md-nav__link">
Phone Messages
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-screen/" class="md-nav__link">
Phone Screen
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-wifi-connected/" class="md-nav__link">
Phone WiFI Connected
</a>
</li>
<li class="md-nav__item">
<a href="../../features/phone-wifi-visible/" class="md-nav__link">
Phone WiFI Visible
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4-3" type="checkbox" id="nav-4-3" >
<label class="md-nav__link" for="nav-4-3">
Fitbit
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Fitbit" data-md-level="2">
<label class="md-nav__title" for="nav-4-3">
<span class="md-nav__icon md-icon"></span>
Fitbit
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/fitbit-heartrate-summary/" class="md-nav__link">
Fitbit Heart Rate Summary
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-heartrate-intraday/" class="md-nav__link">
Fitbit Heart Rate Intraday
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-sleep-summary/" class="md-nav__link">
Fitbit Sleep Summary
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-steps-summary/" class="md-nav__link">
Fitbit Steps Summary
</a>
</li>
<li class="md-nav__item">
<a href="../../features/fitbit-steps-intraday/" class="md-nav__link">
Fitbit Steps Intraday
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../features/add-new-features/" class="md-nav__link">
Add New Features
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" >
<label class="md-nav__link" for="nav-5">
Visualizations
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Visualizations" data-md-level="1">
<label class="md-nav__title" for="nav-5">
<span class="md-nav__icon md-icon"></span>
Visualizations
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../visualizations/data-quality-visualizations/" class="md-nav__link">
Data Quality
</a>
</li>
<li class="md-nav__item">
<a href="../../visualizations/feature-visualizations/" class="md-nav__link">
Features
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6" >
<label class="md-nav__link" for="nav-6">
Developers
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Developers" data-md-level="1">
<label class="md-nav__title" for="nav-6">
<span class="md-nav__icon md-icon"></span>
Developers
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../developers/git-flow/" class="md-nav__link">
Git Flow
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/remote-support/" class="md-nav__link">
Remote Support
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/virtual-environments/" class="md-nav__link">
Virtual Environments
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/documentation/" class="md-nav__link">
Documentation
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/testing/" class="md-nav__link">
Testing
</a>
</li>
<li class="md-nav__item">
<a href="../../developers/test-cases/" class="md-nav__link">
Test cases
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7" >
<label class="md-nav__link" for="nav-7">
Others
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Others" data-md-level="1">
<label class="md-nav__title" for="nav-7">
<span class="md-nav__icon md-icon"></span>
Others
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../migrating-from-old-versions/" class="md-nav__link">
Migrating from beta
</a>
</li>
<li class="md-nav__item">
<a href="../../code_of_conduct/" class="md-nav__link">
Code of Conduct
</a>
</li>
<li class="md-nav__item">
<a href="../../faq/" class="md-nav__link">
FAQ
</a>
</li>
<li class="md-nav__item">
<a href="../../team/" class="md-nav__link">
Team
</a>
</li>
<li class="md-nav__item">
<a href="../../change-log/" class="md-nav__link">
Change Log
</a>
</li>
<li class="md-nav__item">
<a href="../../citation/" class="md-nav__link">
Citation
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#database-credentials" class="md-nav__link">
Database credentials
</a>
</li>
<li class="md-nav__item">
<a href="#timezone-of-your-study" class="md-nav__link">
Timezone of your study
</a>
<nav class="md-nav" aria-label="Timezone of your study">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#single-timezone" class="md-nav__link">
Single timezone
</a>
</li>
<li class="md-nav__item">
<a href="#multiple-timezones" class="md-nav__link">
Multiple timezones
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#participant-files" class="md-nav__link">
Participant files
</a>
<nav class="md-nav" aria-label="Participant files">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#structure-of-participants-files" class="md-nav__link">
Structure of participants files
</a>
</li>
<li class="md-nav__item">
<a href="#automatic-creation-of-participant-files" class="md-nav__link">
Automatic creation of participant files
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#time-segments" class="md-nav__link">
Time Segments
</a>
<nav class="md-nav" aria-label="Time Segments">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#segment-examples" class="md-nav__link">
Segment Examples
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#device-data-source-configuration" class="md-nav__link">
Device Data Source Configuration
</a>
</li>
<li class="md-nav__item">
<a href="#sensor-and-features-to-process" class="md-nav__link">
Sensor and Features to Process
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/carissalow/rapids/edit/master/docs/setup/configuration.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
</a>
<h1 id="configuration">Configuration<a class="headerlink" href="#configuration" title="Permanent link">&para;</a></h1>
<p>You need to follow these steps to configure your RAPIDS deployment before you can extract behavioral features</p>
<ol>
<li>Add your <a href="#database-credentials">database credentials</a></li>
<li>Choose the <a href="#timezone-of-your-study">timezone of your study</a></li>
<li>Create your <a href="#participant-files">participants files</a></li>
<li>Select what <a href="#time-segments">time segments</a> you want to extract features on</li>
<li>Modify your <a href="#device-data-source-configuration">device data source configuration</a></li>
<li>Select what <a href="#sensor-and-features-to-process">sensors and features</a> you want to process</li>
</ol>
<p>When you are done with this configuration, go to <a href="../execution">executing RAPIDS</a>.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>Every time you see <code>config["KEY"]</code> or <code>[KEY]</code> in these docs we are referring to the corresponding key in the <code>config.yaml</code> file.</p>
</div>
<hr />
<h2 id="database-credentials">Database credentials<a class="headerlink" href="#database-credentials" title="Permanent link">&para;</a></h2>
<ol>
<li>Create an empty file called <code class="highlight">.env</code> in your RAPIDS root directory</li>
<li>Add the following lines and replace your database-specific credentials (user, password, host, and database):</li>
</ol>
<div class="highlight"><pre><span></span><code><span class="p p-Indicator">[</span><span class="nv">MY_GROUP</span><span class="p p-Indicator">]</span>
<span class="l l-Scalar l-Scalar-Plain">user=MY_USER</span>
<span class="l l-Scalar l-Scalar-Plain">password=MY_PASSWORD</span>
<span class="l l-Scalar l-Scalar-Plain">host=MY_HOST</span>
<span class="l l-Scalar l-Scalar-Plain">port=3306</span>
<span class="l l-Scalar l-Scalar-Plain">database=MY_DATABASE</span>
</code></pre></div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The label <code>MY_GROUP</code> is arbitrary but it has to match the following <code>config.yaml</code> key:</p>
<div class="highlight"><pre><span></span><code><span class="nt">DATABASE_GROUP</span><span class="p">:</span> <span class="nl">&amp;database_group</span>
<span class="l l-Scalar l-Scalar-Plain">MY_GROUP</span>
</code></pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can ignore this step if you are only processing Fitbit data in CSV files.</p>
</div>
<hr />
<h2 id="timezone-of-your-study">Timezone of your study<a class="headerlink" href="#timezone-of-your-study" title="Permanent link">&para;</a></h2>
<h3 id="single-timezone">Single timezone<a class="headerlink" href="#single-timezone" title="Permanent link">&para;</a></h3>
<p>If your study only happened in a single time zone, select the appropriate code form this <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">list</a> and change the following config key. Double check your timezone code pick, for example US Eastern Time is <code>America/New_York</code> not <code>EST</code></p>
<div class="highlight"><pre><span></span><code><span class="nt">TIMEZONE</span><span class="p">:</span> <span class="nl">&amp;timezone</span>
<span class="l l-Scalar l-Scalar-Plain">America/New_York</span>
</code></pre></div>
<h3 id="multiple-timezones">Multiple timezones<a class="headerlink" href="#multiple-timezones" title="Permanent link">&para;</a></h3>
<p>Support coming soon.</p>
<hr />
<h2 id="participant-files">Participant files<a class="headerlink" href="#participant-files" title="Permanent link">&para;</a></h2>
<p>Participant files link together multiple devices (smartphones and wearables) to specific participants and identify them throughout RAPIDS. You can create these files manually or <a href="#automatic-creation-of-participant-files">automatically</a>. Participant files are stored in <code>data/external/participant_files/pxx.yaml</code> and follow a unified <a href="#structure-of-participants-files">structure</a>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The list <code>PIDS</code> in <code>config.yaml</code> needs to have the participant file names of the people you want to process. For example, if you created <code>p01.yaml</code>, <code>p02.yaml</code> and <code>p03.yaml</code> files in <code>/data/external/participant_files/</code>, then <code>PIDS</code> should be:
<div class="highlight"><pre><span></span><code><span class="nt">PIDS</span><span class="p">:</span> <span class="p p-Indicator">[</span><span class="nv">p01</span><span class="p p-Indicator">,</span> <span class="nv">p02</span><span class="p p-Indicator">,</span> <span class="nv">p03</span><span class="p p-Indicator">]</span>
</code></pre></div></p>
</div>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Attribute <em>values</em> of the <code>[PHONE]</code> and <code>[FITBIT]</code> sections in every participant file are optional which allows you to analyze data from participants that only carried smartphones, only Fitbit devices, or both.</p>
</div>
<details class="hint"><summary>Optional: Migrating participants files with the old format</summary><p>If you were using the pre-release version of RAPIDS with participant files in plain text (as opposed to yaml), you can run the following command and your old files will be converted into yaml files stored in <code>data/external/participant_files/</code></p>
<div class="highlight"><pre><span></span><code>python tools/update_format_participant_files.py
</code></pre></div>
</details>
<h3 id="structure-of-participants-files">Structure of participants files<a class="headerlink" href="#structure-of-participants-files" title="Permanent link">&para;</a></h3>
<div class="admonition example">
<p class="admonition-title">Example of the structure of a participant file</p>
<p>In this example, the participant used an android phone, an ios phone, and a fitbit device throughout the study between Apr 23<sup>rd</sup> 2020 and Oct 28<sup>th</sup> 2020</p>
<div class="highlight"><pre><span></span><code><span class="nt">PHONE</span><span class="p">:</span>
<span class="nt">DEVICE_IDS</span><span class="p">:</span> <span class="p p-Indicator">[</span><span class="nv">a748ee1a-1d0b-4ae9-9074-279a2b6ba524</span><span class="p p-Indicator">,</span> <span class="nv">dsadas-2324-fgsf-sdwr-gdfgs4rfsdf43</span><span class="p p-Indicator">]</span>
<span class="nt">PLATFORMS</span><span class="p">:</span> <span class="p p-Indicator">[</span><span class="nv">android</span><span class="p p-Indicator">,</span><span class="nv">ios</span><span class="p p-Indicator">]</span>
<span class="nt">LABEL</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test01</span>
<span class="nt">START_DATE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">2020-04-23</span>
<span class="nt">END_DATE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">2020-10-28</span>
<span class="nt">FITBIT</span><span class="p">:</span>
<span class="nt">DEVICE_IDS</span><span class="p">:</span> <span class="p p-Indicator">[</span><span class="nv">fitbit1</span><span class="p p-Indicator">]</span>
<span class="nt">LABEL</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">test01</span>
<span class="nt">START_DATE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">2020-04-23</span>
<span class="nt">END_DATE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">2020-10-28</span>
</code></pre></div>
</div>
<p><strong>For <code>[PHONE]</code></strong></p>
<table>
<thead>
<tr>
<th>Key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[DEVICE_IDS]</code></td>
<td>An array of the strings that uniquely identify each smartphone, you can have more than one for when participants changed phones in the middle of the study, in this case, data from all their devices will be joined and relabeled with the last 1 on this list.</td>
</tr>
<tr>
<td><code>[PLATFORMS]</code></td>
<td>An array that specifies the OS of each smartphone in <code>[DEVICE_IDS]</code> , use a combination of <code>android</code> or <code>ios</code> (we support participants that changed platforms in the middle of your study!). If you have an <code>aware_device</code> table in your database you can set <code>[PLATFORMS]: [multiple]</code> and RAPIDS will infer them automatically.</td>
</tr>
<tr>
<td><code>[LABEL]</code></td>
<td>A string that is used in reports and visualizations.</td>
</tr>
<tr>
<td><code>[START_DATE]</code></td>
<td>A string with format <code>YYY-MM-DD</code> . Only data collected <em>after</em> this date will be included in the analysis</td>
</tr>
<tr>
<td><code>[END_DATE]</code></td>
<td>A string with format <code>YYY-MM-DD</code> . Only data collected <em>before</em> this date will be included in the analysis</td>
</tr>
</tbody>
</table>
<p><strong>For <code>[FITBIT]</code></strong></p>
<table>
<thead>
<tr>
<th>Key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[DEVICE_IDS]</code></td>
<td>An array of the strings that uniquely identify each Fitbit, you can have more than one in case the participant changed devices in the middle of the study, in this case, data from all devices will be joined and relabeled with the last <code>device_id</code> on this list.</td>
</tr>
<tr>
<td><code>[LABEL]</code></td>
<td>A string that is used in reports and visualizations.</td>
</tr>
<tr>
<td><code>[START_DATE]</code></td>
<td>A string with format <code>YYY-MM-DD</code> . Only data collected <em>after</em> this date will be included in the analysis</td>
</tr>
<tr>
<td><code>[END_DATE]</code></td>
<td>A string with format <code>YYY-MM-DD</code> . Only data collected <em>before</em> this date will be included in the analysis</td>
</tr>
</tbody>
</table>
<h3 id="automatic-creation-of-participant-files">Automatic creation of participant files<a class="headerlink" href="#automatic-creation-of-participant-files" title="Permanent link">&para;</a></h3>
<p>You have two options a) use the <code>aware_device</code> table in your database or b) use a CSV file. In either case, in your <code>config.yaml</code>, set <code>[PHONE_SECTION][ADD]</code> or <code>[FITBIT_SECTION][ADD]</code> to <code>TRUE</code> depending on what devices you used in your study. Set <code>[DEVICE_ID_COLUMN]</code> to the name of the column that uniquely identifies each device and include any device ids you want to ignore in <code>[IGNORED_DEVICE_IDS]</code>.</p>
<div class="tabbed-set" data-tabs="1:2"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><label for="__tabbed_1_1">aware_device table</label><div class="tabbed-content">
<p>Set the following keys in your <code>config.yaml</code></p>
<div class="highlight"><pre><span></span><code><span class="nt">CREATE_PARTICIPANT_FILES</span><span class="p">:</span>
<span class="nt">SOURCE</span><span class="p">:</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">AWARE_DEVICE_TABLE</span>
<span class="nt">DATABASE_GROUP</span><span class="p">:</span> <span class="nv">*database_group</span>
<span class="nt">CSV_FILE_PATH</span><span class="p">:</span> <span class="s">&quot;&quot;</span>
<span class="nt">TIMEZONE</span><span class="p">:</span> <span class="nv">*timezone</span>
<span class="nt">PHONE_SECTION</span><span class="p">:</span>
<span class="nt">ADD</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">TRUE</span> <span class="c1"># or FALSE</span>
<span class="nt">DEVICE_ID_COLUMN</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">device_id</span> <span class="c1"># column name</span>
<span class="nt">IGNORED_DEVICE_IDS</span><span class="p">:</span> <span class="p p-Indicator">[]</span>
<span class="nt">FITBIT_SECTION</span><span class="p">:</span>
<span class="nt">ADD</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">TRUE</span> <span class="c1"># or FALSE</span>
<span class="nt">DEVICE_ID_COLUMN</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fitbit_id</span> <span class="c1"># column name</span>
<span class="nt">IGNORED_DEVICE_IDS</span><span class="p">:</span> <span class="p p-Indicator">[]</span>
</code></pre></div>
<p>Then run </p>
<div class="highlight"><pre><span></span><code>snakemake -j1 create_participants_files
</code></pre></div>
</div>
<input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><label for="__tabbed_1_2">CSV file</label><div class="tabbed-content">
<p>Set the following keys in your <code>config.yaml</code>. </p>
<p><div class="highlight"><pre><span></span><code><span class="nt">CREATE_PARTICIPANT_FILES</span><span class="p">:</span>
<span class="nt">SOURCE</span><span class="p">:</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">CSV_FILE</span>
<span class="nt">DATABASE_GROUP</span><span class="p">:</span> <span class="s">&quot;&quot;</span>
<span class="nt">CSV_FILE_PATH</span><span class="p">:</span> <span class="s">&quot;your_path/to_your.csv&quot;</span>
<span class="nt">TIMEZONE</span><span class="p">:</span> <span class="nv">*timezone</span>
<span class="nt">PHONE_SECTION</span><span class="p">:</span>
<span class="nt">ADD</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">TRUE</span> <span class="c1"># or FALSE</span>
<span class="nt">DEVICE_ID_COLUMN</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">device_id</span> <span class="c1"># column name</span>
<span class="nt">IGNORED_DEVICE_IDS</span><span class="p">:</span> <span class="p p-Indicator">[]</span>
<span class="nt">FITBIT_SECTION</span><span class="p">:</span>
<span class="nt">ADD</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">TRUE</span> <span class="c1"># or FALSE</span>
<span class="nt">DEVICE_ID_COLUMN</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">fitbit_id</span> <span class="c1"># column name</span>
<span class="nt">IGNORED_DEVICE_IDS</span><span class="p">:</span> <span class="p p-Indicator">[]</span>
</code></pre></div>
Your CSV file (<code>[SOURCE][CSV_FILE_PATH]</code>) should have the following columns but you can omit any values you don&rsquo;t have on each column:</p>
<table>
<thead>
<tr>
<th>Column</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>phone device id</td>
<td>The name of this column has to match <code>[PHONE_SECTION][DEVICE_ID_COLUMN]</code>. Separate multiple ids with <code>;</code></td>
</tr>
<tr>
<td>fitbit device id</td>
<td>The name of this column has to match <code>[FITBIT_SECTION][DEVICE_ID_COLUMN]</code>. Separate multiple ids with <code>;</code></td>
</tr>
<tr>
<td>pid</td>
<td>Unique identifiers with the format pXXX (your participant files will be named with this string</td>
</tr>
<tr>
<td>platform</td>
<td>Use <code>android</code>, <code>ios</code> or <code>multiple</code> as explained above, separate values with <code>;</code></td>
</tr>
<tr>
<td>label</td>
<td>A human readable string that is used in reports and visualizations.</td>
</tr>
<tr>
<td>start_date</td>
<td>A string with format <code>YYY-MM-DD</code>.</td>
</tr>
<tr>
<td>end_date</td>
<td>A string with format <code>YYY-MM-DD</code>.</td>
</tr>
</tbody>
</table>
<div class="admonition example">
<p class="admonition-title">Example</p>
<div class="highlight"><pre><span></span><code>device_id,pid,label,platform,start_date,end_date,fitbit_id
a748ee1a-1d0b-4ae9-9074-279a2b6ba524;dsadas-2324-fgsf-sdwr-gdfgs4rfsdf43,p01,julio,android;ios,2020-01-01,2021-01-01,fitbit1
4c4cf7a1-0340-44bc-be0f-d5053bf7390c,p02,meng,ios,2021-01-01,2022-01-01,fitbit2
</code></pre></div>
</div>
<p>Then run </p>
<div class="highlight"><pre><span></span><code>snakemake -j1 create_participants_files
</code></pre></div>
</div>
</div>
<hr />
<h2 id="time-segments">Time Segments<a class="headerlink" href="#time-segments" title="Permanent link">&para;</a></h2>
<p>Time segments (or epochs) are the time windows on which you want to extract behavioral features. For example, you might want to process data on every day, every morning, or only during weekends. RAPIDS offers three categories of time segments that are flexible enough to cover most use cases: <strong>frequency</strong> (short time windows every day), <strong>periodic</strong> (arbitrary time windows on any day), and <strong>event</strong> (arbitrary time windows around events of interest). See also our <a href="#segment-examples">examples</a>.</p>
<div class="tabbed-set" data-tabs="2:3"><input checked="checked" id="__tabbed_2_1" name="__tabbed_2" type="radio" /><label for="__tabbed_2_1">Frequency Segments</label><div class="tabbed-content">
<p>These segments are computed on every day and all have the same duration (for example 30 minutes). Set the following keys in your <code>config.yaml</code></p>
<div class="highlight"><pre><span></span><code><span class="nt">TIME_SEGMENTS</span><span class="p">:</span> <span class="nl">&amp;time_segments</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">FREQUENCY</span>
<span class="nt">FILE</span><span class="p">:</span> <span class="s">&quot;data/external/your_frequency_segments.csv&quot;</span>
<span class="nt">INCLUDE_PAST_PERIODIC_SEGMENTS</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">FALSE</span>
</code></pre></div>
<p>The file pointed by <code>[TIME_SEGMENTS][FILE]</code> should have the following format and can only have 1 row.</p>
<table>
<thead>
<tr>
<th>Column</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>label</td>
<td>A string that is used as a prefix in the name of your time segments</td>
</tr>
<tr>
<td>length</td>
<td>An integer representing the duration of your time segments in minutes</td>
</tr>
</tbody>
</table>
<div class="admonition example">
<p class="admonition-title">Example</p>
<div class="highlight"><pre><span></span><code>label,length
thirtyminutes,30
</code></pre></div>
<p>This configuration will compute 48 time segments for every day when any data from any participant was sensed. For example:</p>
<div class="highlight"><pre><span></span><code>start_time,length,label
00:00,30,thirtyminutes0000
00:30,30,thirtyminutes0001
01:00,30,thirtyminutes0002
01:30,30,thirtyminutes0003
...
</code></pre></div>
</div>
</div>
<input id="__tabbed_2_2" name="__tabbed_2" type="radio" /><label for="__tabbed_2_2">Periodic Segments</label><div class="tabbed-content">
<p>These segments can be computed every day, or on specific days of the week, month, quarter, and year. Their minimum duration is 1 minute but they can be as long as you want. Set the following keys in your <code>config.yaml</code>.</p>
<div class="highlight"><pre><span></span><code><span class="nt">TIME_SEGMENTS</span><span class="p">:</span> <span class="nl">&amp;time_segments</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">PERIODIC</span>
<span class="nt">FILE</span><span class="p">:</span> <span class="s">&quot;data/external/your_periodic_segments.csv&quot;</span>
<span class="nt">INCLUDE_PAST_PERIODIC_SEGMENTS</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">FALSE</span> <span class="c1"># or TRUE</span>
</code></pre></div>
<p>If <code>[INCLUDE_PAST_PERIODIC_SEGMENTS]</code> is set to <code>TRUE</code>, RAPIDS will consider instances of your segments back enough in the past as to include the first row of data of each participant. For example, if the first row of data from a participant happened on Saturday March 7<sup>th</sup> 2020 and the requested segment duration is 7 days starting on every Sunday, the first segment to be considered would start on Sunday March 1<sup>st</sup> if <code>[INCLUDE_PAST_PERIODIC_SEGMENTS]</code> is <code>TRUE</code> or on Sunday March 8<sup>th</sup> if <code>FALSE</code>.</p>
<p>The file pointed by <code>[TIME_SEGMENTS][FILE]</code> should have the following format and can have multiple rows.</p>
<table>
<thead>
<tr>
<th>Column</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>label</td>
<td>A string that is used as a prefix in the name of your time segments. It has to be <strong>unique</strong> between rows</td>
</tr>
<tr>
<td>start_time</td>
<td>A string with format <code>HH:MM:SS</code> representing the starting time of this segment on any day</td>
</tr>
<tr>
<td>length</td>
<td>A string representing the length of this segment.It can have one or more of the following strings <strong><code>XXD XXH XXM XXS</code></strong> to represent days, hours, minutes and seconds. For example <code>7D 23H 59M 59S</code></td>
</tr>
<tr>
<td>repeats_on</td>
<td>One of the follow options <code>every_day</code>, <code>wday</code>, <code>qday</code>, <code>mday</code>, and <code>yday</code>. The last four represent a week, quarter, month and year day</td>
</tr>
<tr>
<td>repeats_value</td>
<td>An integer complementing <code>repeats_on</code>. If you set <code>repeats_on</code> to <code>every_day</code> set this to <code>0</code>, otherwise <code>1-7</code> represent a <code>wday</code> starting from Mondays, <code>1-31</code> represent a <code>mday</code>, <code>1-91</code> represent a <code>qday</code>, and <code>1-366</code> represent a <code>yday</code></td>
</tr>
</tbody>
</table>
<div class="admonition example">
<p class="admonition-title">Example</p>
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
daily,00:00:00,23H 59M 59S,every_day,0
morning,06:00:00,5H 59M 59S,every_day,0
afternoon,12:00:00,5H 59M 59S,every_day,0
evening,18:00:00,5H 59M 59S,every_day,0
night,00:00:00,5H 59M 59S,every_day,0
</code></pre></div>
<p>This configuration will create five segments instances (<code>daily</code>, <code>morning</code>, <code>afternoon</code>, <code>evening</code>, <code>night</code>) on any given day (<code>every_day</code> set to 0). The <code>daily</code> segment will start at midnight and will last <code>23:59:59</code>, the other four segments will start at 6am, 12pm, 6pm, and 12am respectively and last for <code>05:59:59</code>. </p>
</div>
</div>
<input id="__tabbed_2_3" name="__tabbed_2" type="radio" /><label for="__tabbed_2_3">Event segments</label><div class="tabbed-content">
<p>These segments can be computed before or after an event of interest (defined as any UNIX timestamp). Their minimum duration is 1 minute but they can be as long as you want. The start of each segment can be shifted backwards or forwards from the specified timestamp. Set the following keys in your <code>config.yaml</code>.</p>
<div class="highlight"><pre><span></span><code><span class="nt">TIME_SEGMENTS</span><span class="p">:</span> <span class="nl">&amp;time_segments</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">EVENT</span>
<span class="nt">FILE</span><span class="p">:</span> <span class="s">&quot;data/external/your_event_segments.csv&quot;</span>
<span class="nt">INCLUDE_PAST_PERIODIC_SEGMENTS</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">FALSE</span> <span class="c1"># or TRUE</span>
</code></pre></div>
<p>The file pointed by <code>[TIME_SEGMENTS][FILE]</code> should have the following format and can have multiple rows.</p>
<table>
<thead>
<tr>
<th>Column</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>label</td>
<td>A string that is used as a prefix in the name of your time segments. If labels are unique, every segment is independent; if two or more segments have the same label, their data will be grouped when computing auxiliary data for features like the <code>most frequent contact</code> for calls (the most frequent contact will be computed across all these segments). There cannot be two <em>overlaping</em> event segments with the same label (RAPIDS will throw an error)</td>
</tr>
<tr>
<td>event_timestamp</td>
<td>A UNIX timestamp that represents the moment an event of interest happened (clinical relapse, survey, readmission, etc.). The corresponding time segment will be computed around this moment using <code>length</code>, <code>shift</code>, and <code>shift_direction</code></td>
</tr>
<tr>
<td>length</td>
<td>A string representing the length of this segment. It can have one or more of the following keys <code>XXD XXH XXM XXS</code> to represent a number of days, hours, minutes, and seconds. For example <code>7D 23H 59M 59S</code></td>
</tr>
<tr>
<td>shift</td>
<td>A string representing the time shift from <code>event_timestamp</code>. It can have one or more of the following keys <code>XXD XXH XXM XXS</code> to represent a number of days, hours, minutes and seconds. For example <code>7D 23H 59M 59S</code>. Use this value to change the start of a segment with respect to its <code>event_timestamp</code>. For example, set this variable to <code>1H</code> to create a segment that starts 1 hour from an event of interest (<code>shift_direction</code> determines if it&rsquo;s before or after).</td>
</tr>
<tr>
<td>shift_direction</td>
<td>An integer representing whether the <code>shift</code> is before (<code>-1</code>) or after (<code>1</code>) an <code>event_timestamp</code></td>
</tr>
<tr>
<td>device_id</td>
<td>The device id (smartphone or fitbit) to whom this segment belongs to. You have to create a line in this event segment file for each event of a participant that you want to analyse. If you have participants with multiple device ids you can choose any of them</td>
</tr>
</tbody>
</table>
<div class="admonition example">
<p class="admonition-title">Example</p>
<div class="highlight"><pre><span></span><code>label,event_timestamp,length,shift,shift_direction,device_id
stress1,1587661220000,1H,5M,1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
stress2,1587747620000,4H,4H,-1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
stress3,1587906020000,3H,5M,1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
stress4,1584291600000,7H,4H,-1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
stress5,1588172420000,9H,5M,-1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
mood,1587661220000,1H,0,0,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
mood,1587747620000,1D,0,0,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
mood,1587906020000,7D,0,0,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
</code></pre></div>
<p>This example will create eight segments for a single participant (<code>a748ee1a...</code>), five independent <code>stressX</code> segments with various lengths (1,4,3,7, and 9 hours). Segments <code>stress1</code>, <code>stress3</code>, and <code>stress5</code> are shifted forwards by 5 minutes and <code>stress2</code> and <code>stress4</code> are shifted backwards by 4 hours (that is, if the <code>stress4</code> event happened on March 15<sup>th</sup> at 1pm EST (<code>1584291600000</code>), the time segment will start on that day at 9am and end at 4pm). </p>
<p>The three <code>mood</code> segments are 1 hour, 1 day and 7 days long and have no shift. In addition, these <code>mood</code> segments are grouped together, meaning that although RAPIDS will compute features on each one of them, some necessary information to compute a few of such features will be extracted from all three segments, for example the phone contact that called a participant the most or the location clusters visited by a participant.</p>
</div>
</div>
</div>
<h3 id="segment-examples">Segment Examples<a class="headerlink" href="#segment-examples" title="Permanent link">&para;</a></h3>
<div class="tabbed-set" data-tabs="3:7"><input checked="checked" id="__tabbed_3_1" name="__tabbed_3" type="radio" /><label for="__tabbed_3_1">5-minutes</label><div class="tabbed-content">
<p>Use the following <code>Frequency</code> segment file to create 288 (12 * 60 * 24) 5-minute segments starting from midnight of every day in your study
<div class="highlight"><pre><span></span><code>label,length
fiveminutes,5
</code></pre></div></p>
</div>
<input id="__tabbed_3_2" name="__tabbed_3" type="radio" /><label for="__tabbed_3_2">Daily</label><div class="tabbed-content">
<p>Use the following <code>Periodic</code> segment file to create daily segments starting from midnight of every day in your study
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
daily,00:00:00,23H 59M 59S,every_day,0
</code></pre></div></p>
</div>
<input id="__tabbed_3_3" name="__tabbed_3" type="radio" /><label for="__tabbed_3_3">Morning</label><div class="tabbed-content">
<p>Use the following <code>Periodic</code> segment file to create morning segments starting at 06:00:00 and ending at 11:59:59 of every day in your study
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
morning,06:00:00,5H 59M 59S,every_day,0
</code></pre></div></p>
</div>
<input id="__tabbed_3_4" name="__tabbed_3" type="radio" /><label for="__tabbed_3_4">Overnight</label><div class="tabbed-content">
<p>Use the following <code>Periodic</code> segment file to create overnight segments starting at 20:00:00 and ending at 07:59:59 (next day) of every day in your study
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
morning,20:00:00,11H 59M 59S,every_day,0
</code></pre></div></p>
</div>
<input id="__tabbed_3_5" name="__tabbed_3" type="radio" /><label for="__tabbed_3_5">Weekly</label><div class="tabbed-content">
<p>Use the following <code>Periodic</code> segment file to create <strong>non-overlapping</strong> weekly segments starting at midnight of every <strong>Monday</strong> in your study
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
weekly,00:00:00,6D 23H 59M 59S,wday,1
</code></pre></div>
Use the following <code>Periodic</code> segment file to create <strong>overlapping</strong> weekly segments starting at midnight of <strong>every day</strong> in your study
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
weekly,00:00:00,6D 23H 59M 59S,every_day,0
</code></pre></div></p>
</div>
<input id="__tabbed_3_6" name="__tabbed_3" type="radio" /><label for="__tabbed_3_6">Week-ends</label><div class="tabbed-content">
<p>Use the following <code>Periodic</code> segment file to create week-end segments starting at midnight of every <strong>Saturday</strong> in your study
<div class="highlight"><pre><span></span><code>label,start_time,length,repeats_on,repeats_value
weekend,00:00:00,1D 23H 59M 59S,wday,6
</code></pre></div></p>
</div>
<input id="__tabbed_3_7" name="__tabbed_3" type="radio" /><label for="__tabbed_3_7">Around surveys</label><div class="tabbed-content">
<p>Use the following <code>Event</code> segment file to create two 2-hour segments that start 1 hour before surveys answered by 3 participants
<div class="highlight"><pre><span></span><code>label,event_timestamp,length,shift,shift_direction,device_id
survey1,1587661220000,2H,1H,-1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
survey2,1587747620000,2H,1H,-1,a748ee1a-1d0b-4ae9-9074-279a2b6ba524
survey1,1587906020000,2H,1H,-1,rqtertsd-43ff-34fr-3eeg-efe4fergregr
survey2,1584291600000,2H,1H,-1,rqtertsd-43ff-34fr-3eeg-efe4fergregr
survey1,1588172420000,2H,1H,-1,klj34oi2-8frk-2343-21kk-324ljklewlr3
survey2,1584291600000,2H,1H,-1,klj34oi2-8frk-2343-21kk-324ljklewlr3
</code></pre></div></p>
</div>
</div>
<hr />
<h2 id="device-data-source-configuration">Device Data Source Configuration<a class="headerlink" href="#device-data-source-configuration" title="Permanent link">&para;</a></h2>
<p>You might need to modify the following config keys in your <code>config.yaml</code> depending on what devices your participants used and where you are storing your data. You can ignore <code>[PHONE_DATA_CONFIGURATION]</code> or <code>[FITBIT_DATA_CONFIGURATION]</code> if you are not working with either devices.</p>
<div class="tabbed-set" data-tabs="4:2"><input checked="checked" id="__tabbed_4_1" name="__tabbed_4" type="radio" /><label for="__tabbed_4_1">Phone</label><div class="tabbed-content">
<p>The relevant <code>config.yaml</code> section looks like this by default:</p>
<div class="highlight"><pre><span></span><code><span class="nt">PHONE_DATA_CONFIGURATION</span><span class="p">:</span>
<span class="nt">SOURCE</span><span class="p">:</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">DATABASE</span>
<span class="nt">DATABASE_GROUP</span><span class="p">:</span> <span class="nv">*database_group</span>
<span class="nt">DEVICE_ID_COLUMN</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">device_id</span> <span class="c1"># column name</span>
<span class="nt">TIMEZONE</span><span class="p">:</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">SINGLE</span> <span class="c1"># SINGLE (MULTIPLE support coming soon)</span>
<span class="nt">VALUE</span><span class="p">:</span> <span class="nv">*timezone</span>
</code></pre></div>
<p><strong>Parameters for <code>[PHONE_DATA_CONFIGURATION]</code></strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[SOURCE] [TYPE]</code></td>
<td>Only <code>DATABASE</code> is supported (phone data will be pulled from a database)</td>
</tr>
<tr>
<td><code>[SOURCE] [DATABASE_GROUP]</code></td>
<td><code>*database_group</code> points to the value defined before in <a href="#database-credentials">Database credentials</a></td>
</tr>
<tr>
<td><code>[SOURCE] [DEVICE_ID_COLUMN]</code></td>
<td>A column that contains strings that uniquely identify smartphones. For data collected with AWARE this is usually <code>device_id</code></td>
</tr>
<tr>
<td><code>[TIMEZONE] [TYPE]</code></td>
<td>Only <code>SINGLE</code> is supported for now</td>
</tr>
<tr>
<td><code>[TIMEZONE] [VALUE]</code></td>
<td><code>*timezone</code> points to the value defined before in <a href="#timezone-of-your-study">Timezone of your study</a></td>
</tr>
</tbody>
</table>
</div>
<input id="__tabbed_4_2" name="__tabbed_4" type="radio" /><label for="__tabbed_4_2">Fitbit</label><div class="tabbed-content">
<p>The relevant <code>config.yaml</code> section looks like this by default:</p>
<div class="highlight"><pre><span></span><code><span class="nt">FITBIT_DATA_CONFIGURATION</span><span class="p">:</span>
<span class="nt">SOURCE</span><span class="p">:</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">DATABASE</span> <span class="c1"># DATABASE or FILES (set each [FITBIT_SENSOR][TABLE] attribute with a table name or a file path accordingly)</span>
<span class="nt">COLUMN_FORMAT</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">JSON</span> <span class="c1"># JSON or PLAIN_TEXT</span>
<span class="nt">DATABASE_GROUP</span><span class="p">:</span> <span class="nv">*database_group</span>
<span class="nt">DEVICE_ID_COLUMN</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">device_id</span> <span class="c1"># column name</span>
<span class="nt">TIMEZONE</span><span class="p">:</span>
<span class="nt">TYPE</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">SINGLE</span> <span class="c1"># Fitbit devices don&#39;t support time zones so we read this data in the timezone indicated by VALUE </span>
<span class="nt">VALUE</span><span class="p">:</span> <span class="nv">*timezone</span>
</code></pre></div>
<p><strong>Parameters for For <code>[FITBIT_DATA_CONFIGURATION]</code></strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[SOURCE]</code> <code>[TYPE]</code></td>
<td><code>DATABASE</code> or <code>FILES</code> (set each <code>[FITBIT_SENSOR]</code> <code>[TABLE]</code> attribute accordingly with a table name or a file path)</td>
</tr>
<tr>
<td><code>[SOURCE]</code> <code>[COLUMN_FORMAT]</code></td>
<td><code>JSON</code> or <code>PLAIN_TEXT</code>. Column format of the source data. If you pulled your data directly from the Fitbit API the column containing the sensor data will be in <code>JSON</code> format</td>
</tr>
<tr>
<td><code>[SOURCE]</code> <code>[DATABASE_GROUP]</code></td>
<td><code>*database_group</code> points to the value defined before in <a href="#database-credentials">Database credentials</a>. Only used if <code>[TYPE]</code> is <code>DATABASE</code> .</td>
</tr>
<tr>
<td><code>[SOURCE]</code> <code>[DEVICE_ID_COLUMN]</code></td>
<td>A column that contains strings that uniquely identify Fitbit devices.</td>
</tr>
<tr>
<td><code>[TIMEZONE]</code> <code>[TYPE]</code></td>
<td>Only <code>SINGLE</code> is supported (Fitbit devices always store data in local time).</td>
</tr>
<tr>
<td><code>[TIMEZONE]</code> <code>[VALUE]</code></td>
<td><code>*timezone</code> points to the value defined before in <a href="#timezone-of-your-study">Timezone of your study</a></td>
</tr>
</tbody>
</table>
</div>
</div>
<hr />
<h2 id="sensor-and-features-to-process">Sensor and Features to Process<a class="headerlink" href="#sensor-and-features-to-process" title="Permanent link">&para;</a></h2>
<p>Finally, you need to modify the <code>config.yaml</code> section of the sensors you want to extract behavioral features from. All sensors follow the same naming nomenclature (<code>DEVICE_SENSOR</code>) and parameter structure which we explain in the <a href="../../features/feature-introduction/">Behavioral Features Introduction</a>. </p>
<div class="admonition done">
<p class="admonition-title">Done</p>
<p>Head over to <a href="../execution/">Execution</a> to learn how to execute RAPIDS.</p>
</div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../installation/" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
Installation
</div>
</div>
</a>
<a href="../execution/" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
Execution
</div>
</div>
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
Released under AGPL
</div>
Made with
<a href="https://squidfunk.github.io/mkdocs-material-insiders/" target="_blank" rel="noopener">
Material for MkDocs Insiders
</a>
</div>
<div class="md-footer-social">
<a href="https://twitter.com/julio_ui" target="_blank" rel="noopener" title="twitter.com" class="md-footer-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<script src="../../assets/javascripts/vendor.12f39d2a.min.js"></script>
<script src="../../assets/javascripts/bundle.d371fdb2.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
<script>
app = initialize({
base: "../..",
features: ['navigation.sections', 'search.suggest', 'search.highlight'],
search: Object.assign({
worker: "../../assets/javascripts/worker/search.0f64ce30.min.js"
}, typeof search !== "undefined" && search),
version: {'method': 'mike'}
})
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="../../javascripts/extra.js"></script>
</body>
</html>