# Applying Data Mining Techniques to Identify Suitable Activities

Authors: Yu-Fang Yeh; Ching-Pao Chang
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

Identifying suitable physical activities is crucial for personal health management. However, a big challenge in identifying suitable physical activities is the influencing factors are extremely complex. Therefore, this study aims to propose an approach to facilitate the construction of suitable physical activity models. In the approach, association rule mining and clustering technique are applied to analyze personal activity-physiological information. To demonstrate how the proposed approach can be used for constructing the activity models, an experiment using mobile devices to collect personal activity-physiological information was designed. The revealed models can be used to not only understand personal health conditions but also provide useful information about proper and improper physical activities.


---

## Body

## 1. Introduction

Providing high quality healthcare with limited medical resources is a crucial concern for medical institutes [1–3]. Many medical institutes integrate user records and medical information to provide health management decision support [4, 5]. Many researches use wireless and sensor network technology for remote health monitoring [6, 7]. The collected physiological data are submitted to a medical center for medical diagnosis [8, 9]. Bauer et al. used a multilayer network to collect and analyze physiological data to provide useful information [10]. Although the collected data can be evaluated by medical personnel, it still requires significant efforts to provide useful information individually [11]. Tremblay et al. proposed the architecture of a health agent that analyzes the collected physiological data to facilitate personal health management [12]. Sim et al. proposed an evidence-based approach in which expert judgment is applied to data collected from user action and medical evidence to facilitate decision-making pertaining to personal activities [13]. The challenge in the evidence-based approach is that the data used to construct personal models are collected by users, and the characteristics of the same data may be different when the sources (users) differ. To overcome this problem, Li et al. proposed a personal activity analysis process, which includes an interviewing and investigation stage to collect and verify data, an information integration stage to analyze the data, and a reflection stage to take decisions on personal health management [14]. However, the analysis process requires considerable efforts to support the data collection, validation, and analysis.This study proposes an approach to the construction of activity models; in the approach, a data mining technique is applied to personal physiological data for the construction of personal activity models (PAMs). The proposed approach is based on modeling techniques to measure suitability of activities and construct activity models [15, 16]. Many modeling techniques can be used to measure the attributes of activities. For example, the regression analysis is a simple technique that can be used to obtain the relationship (linear or exponential) among attributes. The constructed models can be used to predict subsequent values of certain attributes [17]. Multivariate analysis is another technique used to analyze the relationship among multiple variables; for example, the analysis of variance (ANOVA) can be used to test the variances of means of variables [18].Data mining techniques are commonly used to construct prediction models; for example, the classification technique is used to construct a decision tree that can be used to predict subsequent data. Before the modeling process, the collected data are preprocessed according to the mining technique used. The modeling process attempts to identify the association rules between these items [19, 20]. Association rule mining is another mining technique that can be used to construct prediction models by using the relational dataset. By appropriately setting the confidence and support, association rule mining can be used to identify many useful rules [21]. Clustering is another mining technique that groups collected data into several clusters according to the data characteristics. These clusters can be used to predict subsequent data [22, 23].The main advantage of the proposed approach is that the obtained PAMs can be used not only to identify suitable activities but also to facilitate medical evaluation by medical personnel. The PAM can be constructed using real-time data collected from mobile devices. To demonstrate the performance of the proposed approach, the modeling techniques are applied in an experiment pertaining to health management. The results show that the constructed models can be used to select suitable activities. The remaining part of this paper is ordered as follows: the architecture of the proposed approach is introduced in Section2, and the results and discussion are provided; finally, suggestions for further studies and conclusions pertaining to the proposed approach are presented.


## 2. Methods

This study proposed an approach to construct activity models; in the approach, modeling techniques are applied on the collected physiological data. The architecture of the proposed approach is depicted in Figure1; personal physiological data and activity data are collected using wearable devices based on the predefined schema. The collected data are preprocessed and analyzed to construct the PAMs. The obtained models provide information that can be used to identify the proper activity or avoid improper activities. The proposed approach mainly involves the data collection (physiological data and activity data) and activity modeling. Physiological data, such as blood pressure, heart rate, and blood glucose, can be treated as retroactive information, and they can be collected automatically using mobile devices. The activity data can be treated as proactive information and represent the activities of the user. In addition to physiological data and activity data, environmental information, such as the environmental temperature and humidity, can also be collected for the modeling process. The collected data are preprocessed according to the predefined schema and are used to construct the PAMs. The obtained models provide information for medical advice and recommendations for medical consultants. The medical recommendations are expressed as rules. The suitable activity identification (SAI) component identifies suitable activity according to the rules of medical advice and the obtained PAMs. The information can be used for selecting suitable activities.Figure 1
Architecture of the PAM approach.Details of the implementation of these components, including data collection, data preprocessing, activity modeling, and SAI, are depicted in the following subsections.


### 2.1. Modeling Techniques

To facilitate data collection, a set of attributes should be defined to describe the physiological data and activities. The physiological data may be collected by different types of devices at different timestamps. The collected data are integrated and preprocessed according to the analysis engine. Table1 shows integrated data collected at different timestamps; T={t1,…,tr} denotes the timestamps, E={a1e,…,ahe} denotes the attributes of environmental data, and P={a1p,…,akp} denotes the attributes of physiological data. The variables eij and vij denote environmental data and physiological data that can be collected automatically in a specified time interval by using wearable mobile devices. The environmental data also contain information on the device location (obtained from Global Positioning System), which indicates the location where the user performs activities.Table 1
Example of integrating collected data.
Time
Environment information
Physiological information
Activity information
Attr.
a
1
e
⋯
a
h
e
a
1
p
⋯
a
k
p
a
1
a
⋯
a
n
a
t
1
s
11
⋯
s
1
h
v
11
⋯
v
1
k
u
11
⋯
u
1
n
t
2
s
21
⋯
s
2
h
v
2
1
⋯
v
2
k
u
21
⋯
u
2
k
t
3
s
31
⋯
s
3
h
v
31
⋯
v
3
k
u
31
⋯
u
3
k
⋮
⋮
⋮
⋮
t
r
s
r
1
⋯
s
r
h
v
r
1
⋯
v
r
k
u
r
1
⋯
u
r
kThe activity data contain information on the activities performed, while the physiological data contains information on the user’s physiological status, which can be treated as an outcome of the performed activities. The performed activities cannot be recorded using a single term. The characteristics of an activity may be different for different persons. For example, the characteristics of the activity “jogging” are different for two different persons, and characteristics such as speed, duration, and direction (uphill or downhill) may affect the outcomes of the activities. For activity modeling, this study used the attributes of movement, such as the speed, direction, and acceleration, to represent the activities performed by users. The information can be collected using the sensors of wearable mobile devices, such as the G-sensor. In Table1, A={a1a,…,ana} denotes the attributes of activity, and uij denotes the collected activity data.The data, including the environmental, physiological, and activity data, are collected by wearable devices at different timestamps. An activity can be represented as a sequence of activity data. For example, letU={u1,…,ur} denote the collected activity data and let M={m1,…,mk} denote the set of activities performed by the user, where mi={uj,…,uk}⊂U denotes an activity contained in U. An activity can be represented as a sequence of {ui} (for some i). The algorithm used to identify the possible activities is shown as follows.(1)
Assume that the set of clustersCu={c1u,…,cru} is obtained by applying the clustering technique to the collected activity data U.(2)
The elements ofU are considered to represent clusters of Cu; that is, Uc={ciu∣ciuCu}.(3)
UseUc to identify the frequent itemsets L={l1,…,ln}, where li⊂Uc, such that the number of occurrences (support) of the patterns is greater than a preselected threshold δl.The modeling process identifies the relationship betweenL and the physiological information. Each activity is assigned a tag by the user for easy identification. For example, an activity can be expressed as (tagi,ti), where tagi denotes the activity tag (such as jogging or climbing) and ti denotes the timestamp. The steps used to link the tags to the obtained activity patterns are shown in Figure 2; tδ denotes the preselected duration and is less than the duration of possible activities. For a tag (tagi,ti), a sequence of activity clusters Ui={ciu,…,cju} within the time interval [ti,ti+tδ] is selected. For the pattern li that is satisfied, Ui is linked to tagi. A pattern lk is said to satisfy an activity cluster Ui if all elements of lk are contained in Ui in order.Figure 2
Linking the tags to the obtained activity patterns.The main purpose of data preprocessing is to apply the cluster technique to the collected data to identify possible activities that can be linked to the physiological data. The identified activities can be used to construct PAMs.


### 2.2. Activity Modeling

The main purpose of personal activity modeling is to find the relationship between activity and physiological data. The collected physiological data are grouped according to the activity transactions, such as the set of activity clusters within a time intervaltδ. For example, in Figure 3, the activity clusters {ciu,…,ci1u} form an activity transaction; {vi,…,vi1} denote the set of physiological data based on the activity transaction and can be treated as representing the personal physiological state in the time interval [ti,ti+tδ] (the effects of the performed activities). For personal activity analysis, the last k physiological data {vi1-k,…,vi1} are selected to represent the effects of the activity transaction and are denoted by a centroid. The personal activity modeling process can be divided into the following steps.Figure 3
Clustering the collected physiological data based on timestamps.In the first step, the clustering technique is applied to the physiological data of all activity transactions to obtainphysiological clustersCv={civ∣civ∈Cv}, which indicate the effects of certain activities. Figure 3 shows the physiological clusters Vc={civ∣civ∈Cv} obtained from the collected physiological data. The purpose of this step is to distribute the collected physiological data among several clusters, with all the data contained in a cluster having similar characteristics (attributes).In the second step, the clustering technique is applied to the environmental data to obtainenvironment clusters. Since the effects of an activity may be influenced by environmental parameters, such as temperature or humidity, the environment clusters can be used to group the activity data. For an activity transaction, a sequence of environmental data, such as {si,…,si1}, can be selected and represented by a center oi. The clustering technique can be applied to these centers {o1,…,on} to obtain environment clusters E={ei,…,en}. Therefore, an activity transaction can be represented as tri=({ciu,…,ci1u},ei;civ,[bi]), where a suitability tag bi∈{1,0,-1} can be attached to civ. The identified transactions of activities are denoted as TR={tr1,…,trn}.In the third step, the association rule mining technique is applied to the obtained transactions TR to construct PAMs. The PAMs can be expressed as a set of rules, and each rule contains antecedent and subsequent items. The following algorithm is used to generate the antecedent items.(1)
Calculate the support (the number) for each activity clusterciu∈Uc using the obtained transactions TR and select the items with a support greater than suppa (preselected) to form the first-level large itemset L1.(2)
Generate the second-level itemsetL1×L1, and select the items with a support greater than suppa to form the second-level large itemset L2.(3)
The process is repeated until no more large itemsets can be formed. The lastn-level large itemset is denoted as Ln.The obtained large itemsetLn contains the items, such as (ciu,…,cju), that appear in the collected dataset frequently. The PAMs can represent the relationship between activities and physiological clusters. The physiological clusters Vc denote the subsequent items, and the algorithm used to construct PAMs is as follows.(1)
Calculate the support for each physiological clusterciv∈Vc, and select the items with support greater than suppa to form the large itemset LR.(2)
Generate the candidate rulesLn×LR, and, for each item ri∈Ln×LR, count the number of appearances in TR. The total number of appearances shown in the antecedent part is denoted as na, and the number of appearances shown in both antecedent and subsequent parts is denoted as nb. The confidence of the rule ri is calculated as nb/na. A rule is selected if itsconfidence is greater than the preselected thresholdconfidence.An obtained ruleri can be expressed as {ciu,…,cju}→{civ}, indicating that an activity li with the pattern {ciu,…,cju} causes physiological effect civ. The environmental information can be used to indicate the environment where the obtained rules can be applied and where the confidences of these rules with the environment cluster ei are recalculated. The confidence of the suitability of the rules can be evaluated using the attached suitability tag, and the confidences of the rules with the suitability tag bi∈B={1,0,-1} are recalculated. The rule ri with an environment cluster and a suitability tag can be expressed as {ciu,…,cju,[ei]}→{civ,[bi]}, and the generated activity rule set is denoted as R.


### 2.3. Activity Identification

The obtained PAMs provide information that can be used to evaluate of suitability of subsequent activities. The evaluation process can be done before or during an activity, and it can be described as follows. First, when applying the obtained rules to select suitable activities, the environmental data collected at the current timestamp are clustered and used to select rules. For example, in Figure4, let {si-k,…,si} denote the data collected from the current environment and let it be represented as ei′∈E; the rules with the same environmental data are selected such that ei′=ei (the same cluster). Ls={l1,…,lk} denotes the possible activity patterns.Figure 4
Identification of suitable activities and evaluation of the current activity.Second, the obtained rules can be used to evaluate the suitability of the activity. Since the activity data are collected during activities, the collected data can be used to evaluate the suitability of the activity. As shown in Figure4, let Ui′={ci-ku,…,ciu} denote the activity cluster of the data collected in the time interval [ti-δ,ti] when an activity is being performed. Since the activity is being performed by the user, the new data Ui′ are collected continuously. The collected data may contain only the first several activity clusters of certain rules (ri∈R, for some i). Therefore, these rules can be selected as candidate rules of Ui′, and the evaluation results can be derived by considering the selected rules. For example, let the rule ri={li,ei}→{bi} be selected as a candidate rule. If ciu∈li and ciu∈Ui′, then any cju∈li(j<i) is also contained in Ui′ (Ui′ contains the first several activity clusters of the rule ri). Let L1 denote the candidate rules that are suitable (for bi=1), and let L-1 denote the candidate rules that are unsuitable. Then, L1 and L-1 can be used to evaluate the suitability of the activity.


## 2.1. Modeling Techniques

To facilitate data collection, a set of attributes should be defined to describe the physiological data and activities. The physiological data may be collected by different types of devices at different timestamps. The collected data are integrated and preprocessed according to the analysis engine. Table1 shows integrated data collected at different timestamps; T={t1,…,tr} denotes the timestamps, E={a1e,…,ahe} denotes the attributes of environmental data, and P={a1p,…,akp} denotes the attributes of physiological data. The variables eij and vij denote environmental data and physiological data that can be collected automatically in a specified time interval by using wearable mobile devices. The environmental data also contain information on the device location (obtained from Global Positioning System), which indicates the location where the user performs activities.Table 1
Example of integrating collected data.
Time
Environment information
Physiological information
Activity information
Attr.
a
1
e
⋯
a
h
e
a
1
p
⋯
a
k
p
a
1
a
⋯
a
n
a
t
1
s
11
⋯
s
1
h
v
11
⋯
v
1
k
u
11
⋯
u
1
n
t
2
s
21
⋯
s
2
h
v
2
1
⋯
v
2
k
u
21
⋯
u
2
k
t
3
s
31
⋯
s
3
h
v
31
⋯
v
3
k
u
31
⋯
u
3
k
⋮
⋮
⋮
⋮
t
r
s
r
1
⋯
s
r
h
v
r
1
⋯
v
r
k
u
r
1
⋯
u
r
kThe activity data contain information on the activities performed, while the physiological data contains information on the user’s physiological status, which can be treated as an outcome of the performed activities. The performed activities cannot be recorded using a single term. The characteristics of an activity may be different for different persons. For example, the characteristics of the activity “jogging” are different for two different persons, and characteristics such as speed, duration, and direction (uphill or downhill) may affect the outcomes of the activities. For activity modeling, this study used the attributes of movement, such as the speed, direction, and acceleration, to represent the activities performed by users. The information can be collected using the sensors of wearable mobile devices, such as the G-sensor. In Table1, A={a1a,…,ana} denotes the attributes of activity, and uij denotes the collected activity data.The data, including the environmental, physiological, and activity data, are collected by wearable devices at different timestamps. An activity can be represented as a sequence of activity data. For example, letU={u1,…,ur} denote the collected activity data and let M={m1,…,mk} denote the set of activities performed by the user, where mi={uj,…,uk}⊂U denotes an activity contained in U. An activity can be represented as a sequence of {ui} (for some i). The algorithm used to identify the possible activities is shown as follows.(1)
Assume that the set of clustersCu={c1u,…,cru} is obtained by applying the clustering technique to the collected activity data U.(2)
The elements ofU are considered to represent clusters of Cu; that is, Uc={ciu∣ciuCu}.(3)
UseUc to identify the frequent itemsets L={l1,…,ln}, where li⊂Uc, such that the number of occurrences (support) of the patterns is greater than a preselected threshold δl.The modeling process identifies the relationship betweenL and the physiological information. Each activity is assigned a tag by the user for easy identification. For example, an activity can be expressed as (tagi,ti), where tagi denotes the activity tag (such as jogging or climbing) and ti denotes the timestamp. The steps used to link the tags to the obtained activity patterns are shown in Figure 2; tδ denotes the preselected duration and is less than the duration of possible activities. For a tag (tagi,ti), a sequence of activity clusters Ui={ciu,…,cju} within the time interval [ti,ti+tδ] is selected. For the pattern li that is satisfied, Ui is linked to tagi. A pattern lk is said to satisfy an activity cluster Ui if all elements of lk are contained in Ui in order.Figure 2
Linking the tags to the obtained activity patterns.The main purpose of data preprocessing is to apply the cluster technique to the collected data to identify possible activities that can be linked to the physiological data. The identified activities can be used to construct PAMs.


## 2.2. Activity Modeling

The main purpose of personal activity modeling is to find the relationship between activity and physiological data. The collected physiological data are grouped according to the activity transactions, such as the set of activity clusters within a time intervaltδ. For example, in Figure 3, the activity clusters {ciu,…,ci1u} form an activity transaction; {vi,…,vi1} denote the set of physiological data based on the activity transaction and can be treated as representing the personal physiological state in the time interval [ti,ti+tδ] (the effects of the performed activities). For personal activity analysis, the last k physiological data {vi1-k,…,vi1} are selected to represent the effects of the activity transaction and are denoted by a centroid. The personal activity modeling process can be divided into the following steps.Figure 3
Clustering the collected physiological data based on timestamps.In the first step, the clustering technique is applied to the physiological data of all activity transactions to obtainphysiological clustersCv={civ∣civ∈Cv}, which indicate the effects of certain activities. Figure 3 shows the physiological clusters Vc={civ∣civ∈Cv} obtained from the collected physiological data. The purpose of this step is to distribute the collected physiological data among several clusters, with all the data contained in a cluster having similar characteristics (attributes).In the second step, the clustering technique is applied to the environmental data to obtainenvironment clusters. Since the effects of an activity may be influenced by environmental parameters, such as temperature or humidity, the environment clusters can be used to group the activity data. For an activity transaction, a sequence of environmental data, such as {si,…,si1}, can be selected and represented by a center oi. The clustering technique can be applied to these centers {o1,…,on} to obtain environment clusters E={ei,…,en}. Therefore, an activity transaction can be represented as tri=({ciu,…,ci1u},ei;civ,[bi]), where a suitability tag bi∈{1,0,-1} can be attached to civ. The identified transactions of activities are denoted as TR={tr1,…,trn}.In the third step, the association rule mining technique is applied to the obtained transactions TR to construct PAMs. The PAMs can be expressed as a set of rules, and each rule contains antecedent and subsequent items. The following algorithm is used to generate the antecedent items.(1)
Calculate the support (the number) for each activity clusterciu∈Uc using the obtained transactions TR and select the items with a support greater than suppa (preselected) to form the first-level large itemset L1.(2)
Generate the second-level itemsetL1×L1, and select the items with a support greater than suppa to form the second-level large itemset L2.(3)
The process is repeated until no more large itemsets can be formed. The lastn-level large itemset is denoted as Ln.The obtained large itemsetLn contains the items, such as (ciu,…,cju), that appear in the collected dataset frequently. The PAMs can represent the relationship between activities and physiological clusters. The physiological clusters Vc denote the subsequent items, and the algorithm used to construct PAMs is as follows.(1)
Calculate the support for each physiological clusterciv∈Vc, and select the items with support greater than suppa to form the large itemset LR.(2)
Generate the candidate rulesLn×LR, and, for each item ri∈Ln×LR, count the number of appearances in TR. The total number of appearances shown in the antecedent part is denoted as na, and the number of appearances shown in both antecedent and subsequent parts is denoted as nb. The confidence of the rule ri is calculated as nb/na. A rule is selected if itsconfidence is greater than the preselected thresholdconfidence.An obtained ruleri can be expressed as {ciu,…,cju}→{civ}, indicating that an activity li with the pattern {ciu,…,cju} causes physiological effect civ. The environmental information can be used to indicate the environment where the obtained rules can be applied and where the confidences of these rules with the environment cluster ei are recalculated. The confidence of the suitability of the rules can be evaluated using the attached suitability tag, and the confidences of the rules with the suitability tag bi∈B={1,0,-1} are recalculated. The rule ri with an environment cluster and a suitability tag can be expressed as {ciu,…,cju,[ei]}→{civ,[bi]}, and the generated activity rule set is denoted as R.


## 2.3. Activity Identification

The obtained PAMs provide information that can be used to evaluate of suitability of subsequent activities. The evaluation process can be done before or during an activity, and it can be described as follows. First, when applying the obtained rules to select suitable activities, the environmental data collected at the current timestamp are clustered and used to select rules. For example, in Figure4, let {si-k,…,si} denote the data collected from the current environment and let it be represented as ei′∈E; the rules with the same environmental data are selected such that ei′=ei (the same cluster). Ls={l1,…,lk} denotes the possible activity patterns.Figure 4
Identification of suitable activities and evaluation of the current activity.Second, the obtained rules can be used to evaluate the suitability of the activity. Since the activity data are collected during activities, the collected data can be used to evaluate the suitability of the activity. As shown in Figure4, let Ui′={ci-ku,…,ciu} denote the activity cluster of the data collected in the time interval [ti-δ,ti] when an activity is being performed. Since the activity is being performed by the user, the new data Ui′ are collected continuously. The collected data may contain only the first several activity clusters of certain rules (ri∈R, for some i). Therefore, these rules can be selected as candidate rules of Ui′, and the evaluation results can be derived by considering the selected rules. For example, let the rule ri={li,ei}→{bi} be selected as a candidate rule. If ciu∈li and ciu∈Ui′, then any cju∈li(j<i) is also contained in Ui′ (Ui′ contains the first several activity clusters of the rule ri). Let L1 denote the candidate rules that are suitable (for bi=1), and let L-1 denote the candidate rules that are unsuitable. Then, L1 and L-1 can be used to evaluate the suitability of the activity.


## 3. Results

To demonstrate the construction of the PAMs using the proposed approach, an experiment was designed. Table2 shows the set of attributes used to collect data, anddata sources column denotes the sources from where data are collected. The environmental attributes consist of the environmental temperature (ETemp) and humidity (Humid). The physiological attributes include the blood pressure (SBP and DBP), heart rate (HB), and body temperature (BTemp). The activity attributes include the x-, y-, and z-axis (ActX, ActY, and ActZ) values of the accelerator, and ActTag denotes the activity tag.Table 2
The selected attributes of the experiment.
Number
Data sources
Attr.
Description
1
Timestamps
MTime
The timestamp of records
2
Env. data
ETemp
The environmental temperature
3
Env. data
Humid
The environmental humidity
4
Phy. data
SBP
The systolic blood pressure
5
Phy. data
DBP
The diastolic blood pressure
6
Phy. data
HB
The heart beat
7
Phy. data
BTemp
The body temperature
8
Act. data
ActX
Thex-axis value of accelerator
9
Act. data
ActY
They-axis value of accelerator
10
Act. data
ActZ
Thez-axis value of accelerator
11
Act. data
ActTag
The activity tagsThe activity data are collected (every second) using a mobile device. An activity tag is assigned by the user before performing the activity; for example, go uphill (U), downhill (D), or on a smooth road (F). The physiological data are collected (every 5 s) using an electric sphygmomanometer, and they are transmitted to a mobile device over a Bluetooth interface. The environmental data, including temperature and humidity, are also collected, and they are transmitted to the mobile device using a Bluetooth interface. The collected data consist of 143 data items collected over five different days. Table3 shows an example of the collected data based on the attributes shown in Table 2. The collected data are preprocessed and used to construct PAMs.Table 3
Example of collected data.
Number
MTime
ETemp
Humi
ActX
ActY
ActZ
ActTag
BTemp
SBP
DBP
HB
0
2014/4/21  11:23:17 PM
24.2
63.2
−0.96
0.88
7.73
U
36.1
115
62
76
1
2014/4/21  11:23:18 PM
24.2
63.2
−0.23
1.62
8.69
U
36.1
115
62
76
2
2014/4/21  11:23:19 PM
24.2
63.2
−1.69
1.88
7.73
U
36.1
115
62
76
3
2014/4/21  11:23:20 PM
24.2
63.2
0.04
1.62
9.19
U
36.1
115
62
76
4
2014/4/21  11:23:21 PM
24.2
63.2
0.81
0.69
6.81
U
36.1
117
62
76
5
2014/4/21  11:23:22 PM
24.2
63.1
0.69
−1.00
14.38
U
36.1
117
74
78
6
2014/4/21  11:23:23 PM
24.2
63.1
0.35
2.12
10.81
U
36.1
117
74
78
7
2014/4/21  11:23:24 PM
24.2
63.1
−0.54
1.23
6.31
U
36.0
117
74
78
8
2014/4/21  11:23:25 PM
24.2
63.2
−1.27
0.12
14.08
U
36.0
117
74
78
9
2014/4/21  11:23:26 PM
24.2
63.2
0.62
1.73
5.92
U
36.0
117
74
78
10
2014/4/21  11:23:27 PM
24.2
63.2
1.15
1.12
9.31
U
36.0
125
73
86
11
2014/4/21  11:23:28 PM
24.2
63.2
−0.73
1.85
8.50
U
36.0
125
73
86
12
2014/4/21  11:23:29 PM
24.2
63.1
−0.54
0.46
8.88
U
36.0
125
73
86
13
2014/4/21  11:23:30 PM
24.2
63.1
−0.81
−0.12
11.73
U
35.9
125
73
86
14
2014/4/21  11:23:31 PM
24.2
63.2
0.42
−0.62
9.11
U
35.9
125
73
86
15
2014/4/21  11:23:32 PM
24.2
63.2
0.38
1.62
8.27
U
35.9
119
78
85
16
2014/4/21  11:23:33 PM
24.2
63.2
0.31
3.42
6.77
D
35.9
119
78
85
17
2014/4/21  11:23:34 PM
24.2
63.2
0.19
1.23
6.31
D
35.9
119
78
85
18
2014/4/21  11:23:35 PM
24.2
63.2
0.31
0.15
5.04
D
35.9
119
78
85
19
2014/4/21  11:23:36 PM
24.2
63.2
2.58
2.88
14.42
D
35.9
119
78
85


## 4. Discussion

### 4.1. Suitable Activity Identification

The activity data, including ActX, ActY, and ActZ, are used to cluster the collected data. Table 4 shows the activity clusters obtained from the collected data shown in Table 2; the number of clusters is selected as 5 (denoted by the numbers 0 to 4). ActTag is not used as the attribute for clustering and is intended only for helping the user recognize the activity.Table 4
The activity clusters obtained from collected data.
Data number
MTime
ActX
ActY
ActZ
ActTag
Cluster
0
2014/4/21  11:23:17 PM
−0.96
0.88
7.73
U
0
1
2014/4/21  11:23:18 PM
−0.23
1.62
8.69
U
2
2
2014/4/21  11:23:19 PM
−1.69
1.88
7.73
U
0
3
2014/4/21  11:23:20 PM
0.04
1.62
9.19
U
2
4
2014/4/21  11:23:21 PM
0.81
0.69
6.81
U
4
5
2014/4/21  11:23:22 PM
0.69
−1.00
14.38
U
3
6
2014/4/21  11:23:23 PM
0.35
2.12
10.81
U
2The clustered activities are used to form activity transactions for a transaction length of 6. The items of a new transaction are selected from the previous transaction by shifting the items to the right by one item. For example, the first transaction is selected from item 0 to item 5(0,2,0,2,4,3), while the next transaction is selected from 1 to 6 (2,0,2,4,3,2). An activity tag, denoted as TranTag, is attached to each transaction for recognizing the transaction. TranTag can be determined by the number of activity tags appearing in the transaction. The obtained transactions can be used to name the identified activities. In addition to the activity tags, a physiological cluster is associated with each transaction for indicating the effects of the activity transaction. The physiological clusters of the transactions are selected as follows. First, for each transaction, the last three physiological data items are selected and used for calculating a centroid. The centroid can be used to represent the effects of the transaction. Second, the obtained centroids are clustered. Table 5 shows an example of physiological clusters obtained by applying k-means (the number of clusters is 5) to the physiological centroids of the transactions.Table 5
The physiological clusters.
Tran. number
Physiological centroid
Phy. cluster
0
36.100, 115.000, 62.000, 76.000
0
1
36.100, 116.000, 68.000, 77.000
1
2
36.050, 117.000, 74.000, 78.000
1
7
36.000, 121.000, 73.500, 82.000
3
8
35.950, 125.000, 73.000, 86.000
3
9
35.900, 125.000, 73.000, 86.000
3
17
35.900, 119.500, 78.000, 79.000
4
18
35.900, 119.500, 78.000, 79.000
4
71
36.200, 123.000, 72.500, 79.500
2
72
36.150, 126.000, 73.000, 79.000
2
73
36.100, 126.000, 73.000, 79.000
2The environment clusters are obtained using the collected environmental data. The centroids of these environmental data are computed and clustered. Examples of obtained environment centroids and clusters are shown in Table6; the environmental parameters, including temperature and humidity, do not change rapidly and are clustered into two clusters (denoted as 0 and 1). The transaction tags, physiological clusters, and environment clusters are added to the transactions ({ciu,…,cju},ei;civ,[bi]). The suitability tags bi are assigned by medical personnel according to the physiological cluster of the transaction. Table 7 shows an example of obtained transactions, and the total number of obtained transactions is 137.Table 6
The environment clusters.
Tran. number
Environment centroid
Env. cluster
0
24.200, 63.183
1
1
24.200, 63.167
1
2
24.200, 63.150
1
43
28.100, 83.200
0
44
28.100, 83.200
0
45
28.100, 83.200
0Table 7
The activity transactions.
Tran.number
Activity transaction
TranTag
Phy.cluster
Env. cluster
0
0, 2, 0, 2, 4, 3
U
0
1
1
2, 0, 2, 4, 3, 2
U
1
1
2
0, 2, 4, 3, 2, 4
U
1
1
7
4, 3, 4, 2, 2, 1
U
3
1
17
4, 4, 3, 4, 3, 3
D
4
1


### 4.2. Personal Activity Modeling

The activity transaction with physiological clusters{ciu,…,cju}→{civ} can be used to construct PAMs. Table 8 shows the PAMs obtained using association mining; the minimum support is 0.04 and the minimum confidence is 80%.Activity items denote the antecedent items, while thephy. item represents the subsequent item of the rule.Support indicates the frequency of appearance of the patterns, whileconfidence denotes the accuracy of the rule. For example, rule 2 indicates that an activity with the pattern {2,0,0} may yield physiological cluster 0 with 7% support and 90% confidence. This pattern can further be extended to {2,0,0,0}, which also yields cluster 0 with support 5% and confidence 100%.Table 8
Activity models with physiological clusters.
Rulenumber
Activity items
Phy. item
Support
Confidence
0
0, 0, 0
→
0
0.1314
1.0000
1
0, 1, 3
→
2
0.0438
1.0000
2
2, 0, 0
→
0
0.0730
0.9000
3
2, 0, 1
→
2
0.0511
0.8571
4
4, 2, 0
→
1
0.0511
1.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
7
2, 0, 0, 0
→
0
0.0511
1.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
9
2, 2, 0, 0
→
0
0.0511
1.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
11
2, 2, 2, 2
→
0
0.0803
1.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000The environment clustersei of the transaction indicate the situation in which the activities are performed. Different environment clusters may be associated with different effects. Therefore, the environment clusters should be considered while applying the rule on prediction of suitable activity. The confidences of the obtained rules with environment clusters are shown in Table 9; no minimum confidence is used to filter the rules. For example, according to rule 2, an activity with the pattern p1={2,0,0} may yield physiological cluster 0 with confidence 90%, with all transactions with pattern p1 (100%) contained in environment cluster 0. However, when rule 3 is applied, an activity with the pattern p2={2,0,1} may yield physiological cluster 2 with confidence 86%, with only 71% of transactions with pattern p2 being contained in environment cluster 0.Table 9
Confidence of activity models with environment clusters.
Rule number
Activity items
Phy. item
Support
Confidence
Env. confidence
Cluster 0
Cluster 1
0
0, 0, 0
→
0
0.1314
1.0000
1.0000
0.0000
1
0, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
2
2, 0, 0
→
0
0.0730
0.9000
1.0000
0.0000
3
2, 0, 1
→
2
0.0511
0.8571
0.7143
0.2857
4
4, 2, 0
→
1
0.0511
1.0000
1.0000
0.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
1.0000
0.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
7
2, 0, 0, 0
→
0
0.0511
1.0000
1.0000
0.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
0.8571
0.1429
9
2, 2, 0, 0
→
0
0.0511
1.0000
1.0000
0.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
0.8889
0.1111
11
2, 2, 2, 2
→
0
0.0803
1.0000
1.0000
0.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
1.0000
0.0000
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
1.0000
0.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000
1.0000
0.0000For determining the suitability of activities, the physiological clusters are evaluated by medical personnel and suitability tags are attached to the transactions. In this study, the suitability tags are evaluated according to the obtained physiological centroids and clusters (as shown in Table10). The suitability tag is 0 for physiological clusters 0 and 1, 1 for physiological clusters 2 and 3, and −1 for physiological cluster 4. An example of activity transactions with suitability tags (without minimum confidence) is shown in Table 11, in which the confidences for suitability tags −1, 0, and 1 are shown in columns 7, 8, and 9, respectively.Table 10
The activity transactions with suitability tags.
Tran. number
Activity transaction
TranTag
Phy. cluster
Env. cluster
Suitability tag
0
0, 2, 0, 2, 4, 3
U
0
0
0
1
2, 0, 2, 4, 3, 2
U
1
0
0
2
0, 2, 4, 3, 2, 4
U
1
0
0
7
4, 3, 4, 2, 2, 1
U
3
0
1
17
4, 4, 3, 4, 3, 3
D
4
0
−1
30
2, 2, 1, 0, 4, 1
D
2
0
1Table 11
Confidence of activity models with suitability tags.
Rule number
Activity items
Phy. item
Support
Confidence
Confidences for suitability tags
−1
0
1
0
0, 0, 0
→
0
0.1314
1.0000
0.0000
1.0000
0.0000
1
0, 1, 3
→
2
0.0438
1.0000
0.0000
0.0000
1.0000
2
2, 0, 0
→
0
0.0730
0.9000
0.0000
0.9000
0.1000
3
2, 0, 1
→
2
0.0511
0.8571
0.0000
0.1429
0.8571
4
4, 2, 0
→
1
0.0511
1.0000
0.0000
1.0000
0.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
0.0000
1.0000
0.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
0.0000
0.0000
1.0000
7
2, 0, 0, 0
→
0
0.0511
1.0000
0.0000
1.0000
0.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
0.0000
1.0000
0.0000
9
2, 2, 0, 0
→
0
0.0511
1.0000
0.0000
1.0000
0.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
0.0000
1.0000
0.0000
11
2, 2, 2, 2
→
0
0.0803
1.0000
0.0000
1.0000
0.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
0.0000
1.0000
0.0000
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
0.0000
1.0000
0.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000
0.0000
1.0000
0.0000The confidences for suitability tags indicate the probability of the corresponding rule yielding suitable physiological clusters. For example, theconfidence of the suitability tag 0 of rule 2 is 90% which means the probability to cause the physiological cluster 2 is approximately 90%. An activity satisfying a rule with higher suitability can be treated as suitable activities for users. Therefore, rules 1, 3, and 6 shown in Table 11 can be used to identify suitable activities. An activity satisfying the patterns of suitable rules can be identified as suitable activity.The TranTag associated with each transaction can be used to name the identified activities. Table12 shows the confidences for different activity tags, including D (downhill), U (uphill), and F (smooth road). The activity tags with high confidences can be used for naming the identified activities, such as F for rules 0 and 5 and D for rule 4. The D and U activities may contain pattern {0,1,3}.Table 12
The activity models with activity tags.
Rule number
Activity items
Phy. item
Support
Confidence
Conf. for activity tags
D
U
F
0
0, 0, 0
→
0
0.1314
1.0000
0.0000
0.0000
1.0000
1
0, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
0.0000
2
2, 0, 0
→
0
0.0730
0.9000
0.0000
0.1000
0.9000
3
2, 0, 1
→
2
0.0511
0.8571
0.2857
0.5714
0.1429
4
4, 2, 0
→
1
0.0511
1.0000
1.0000
0.0000
0.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
0.0000
0.0000
1.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
0.0000
7
2, 0, 0, 0
→
0
0.0511
1.0000
0.0000
0.0000
1.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
0.0000
0.1429
0.8571
9
2, 2, 0, 0
→
0
0.0511
1.0000
0.0000
0.0000
1.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
0.1111
0.0000
0.8889
11
2, 2, 2, 2
→
0
0.0803
1.0000
0.0000
0.0000
1.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
0.0714
0.0714
0.8571
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
0.0000
0.0000
1.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000
0.0000
0.0000
1.0000


### 4.3. Suitable Activity Identification

The obtained PAMs can be used to identify suitable activities. In this subsection, the application of the obtained PAMs to another test dataset is discussed for demonstrating how the proposed approach can be applied to identify suitable activities. The attributes of the test dataset are displayed in Table1. The test dataset contains 70 data items collected from different activities, including 28 U activities, 28 D activities, and 14 F activities (the dataset is available at http://mgiga.com.tw/PAM/). The test dataset are divided into 10 transactions, and each transaction (containing 7 data items) denotes an activity.Each activity can be treated as a sequence of activity items. The performed activity items in the sequence are used to evaluate theactivity (which is currently being performed), while the physiological data of the last three activities are used to validate the evaluations (the selection of the physiological data of a transaction is identical to the process presented in Section 4.1). Table 13 shows an example of a test dataset. The suitable activity identification process can be described as follows.Table 13
Example of collected testing data.
Number
MTime
ETemp
Humi
ActX
ActY
ActZ
ActTag
BTemp
SBP
DBP
HB
7
10:46:11 PM
25.0
67.4
0.19
−1.04
13.73
U
35.9
120
76
78
8
10:46:12 PM
25.0
67.4
0.88
−0.58
7.35
U
35.9
120
76
78
9
10:46:13 PM
25.0
67.4
−0.58
0.08
9.15
U
35.9
120
76
78
10
10:46:14 PM
25.0
67.5
−1.73
−0.04
6.73
U
35.9
124
72
80
11
10:46:15 PM
25.1
67.5
−0.35
0.96
14.58
U
35.9
124
72
80
12
10:46:16 PM
25.1
67.5
0.04
1.65
12.84
U
35.9
124
72
80
13
10:46:17 PM
25.1
67.5
0.96
0.65
6.08
U
35.9
124
72
80First, the collected activity items are clustered based on the centroids of the activity clusters of the obtained PAMs. Table14 shows the centroids of the activity clusters obtained in Section 4.2. Thenorm denotes the module of the centroid of each cluster that indicates the strength of the activities. The rule r6={0,4,1,3} shown in Table 11 can be expressed as the dash line shown in Figure 5, while the solid line depicts the rule r8={0,2,1,3}. Second, the PAMs (shown in Table 12) are applied to the current activity clusters, and they provide information (suitability) on the current activity. For example, when the first activity item {0.19,-1.04,13.73} is collected and classified into cluster 3, there is no rule shown in Table 11 which can be selected. The second activity item {0.88,-0.58,7.35} is then collected and classified as 0. The activity transaction is {3,0}, and rules 0, 1, 5, and 6 are selected; among these rules, no rule is unsuitable, while rules 1 and 6 are suitable. Therefore, the performing activity may be a suitable activity, and the information provided for the user is “suitable.” Data items 3, 4, and 5 are collected and classified into clusters 1, 0, and 3, respectively. The activity transaction is {3,0,1,0,3}, and only suitable rule 1 is selected. The activity can be evaluated as “suitable.” The last two activity items are classified into clusters 3 and 4, and no further rule is selected for this activity. The test transactions are depicted in Table 15; the third column denotes the prediction results obtained using the collected activity data. The fourth and fifth columns denote the applied rule and suitability confidence, respectively. Transactions 3 and 6 cannot be predicted because no activity pattern can be found in the obtained rules.Table 14
Centroids of the activity clusters of activity models.
Cluster
ActX
ActY
ActZ
Norm
0
−0.493
0.918
7.632
7.70
1
−0.002
−0.134
9.590
9.59
2
−0.302
1.652
9.702
9.85
3
0.358
0.792
13.053
13.08
4
0.343
1.200
6.407
6.53Table 15
Test transactions.
Tran. number
Transaction
Suitability prediction
Applied  rule
Suitability  confidence
0
1, 4, 1, 2, 1, 0, 3
0
4
100%
1
3, 0, 1, 0, 3, 3, 4
1
1
100%
2
2, 4, 0, 3, 0, 2, 3
0
2
90%
3
4, 3, 0, 4, 2, 2, 4
—
—
—
4
0, 1, 0, 4, 1, 2, 3
1
6
100%
5
0, 2, 4, 0, 1, 2, 4
1
3
86%
6
2, 2, 4, 4, 0, 3, 4
—
—
—
7
0, 4, 3, 2, 4, 0, 3
0
4
100%
8
4, 3, 3, 3, 2, 1, 0
0
4
100%
9
3, 1, 4, 4, 4, 2, 0
0
4
100%Figure 5
The visualization of rules with different activity clusters.To validate the prediction results, certain physiological data items were selected and the centroids were classified into physiological clusters of PAMs; the centroids of these clusters are shown in Table16. The physiological clusters of the test transactions are shown in Table 17, which also shows the environmental data classified into cluster 0. The suitability tag (column 6) for each transaction was based on the physiological cluster (column 4). The prediction results (column 3) were compared with the suitability tag (column 6), and it was observed that 80% of the activities could be predicted correctly and that all suitable activities could be identified, such as transactions 1, 4, and 5. The remaining 20% activity transactions, that is, transactions 3 and 6, could not be predicted by using the obtained rules, because no obtained rules could be applied on transactions 3 and 6. However, new transactions can be added into the activity records to update the original models so that the updated models can be used to predict subsequent activity records. The obtained PAMs are used to evaluate the activities performed, and they provide evaluation results to users. The constructed PAMs can be updated using subsequent activity data.Table 16
Centroids of the physiological clusters of activity models.
Cluster
BTemp
SBP
DBP
HB
0
35.8
112
63
77
1
36.1
119
72
77
2
36.0
124
71
79
3
35.9
123
75
84
4
36.0
120
78
74Table 17
The predicting results obtained by using 10 test transactions.
Tran. number
Transactions
Predictions
Phy. cluster
Env. cluster
Suitability tag
0
1, 4, 1, 2, 1, 0, 3
0
1
0
0
1
3, 0, 1, 0, 3, 3, 4
1
2
0
1
2
2, 4, 0, 3, 0, 2, 3
0
1
0
0
3
4, 3, 0, 4, 2, 2, 4
—
1
0
0
4
0, 1, 0, 4, 1, 2, 3
1
2
0
1
5
0, 2, 4, 0, 1, 2, 4
1
2
0
1
6
2, 2, 4, 4, 0, 3, 4
—
1
0
0
7
0, 4, 3, 2, 4, 0, 3
0
1
0
0
8
4, 3, 3, 3, 2, 1, 0
0
1
0
0
9
3, 1, 4, 4, 4, 2, 0
0
1
0
0Table18 presents the results of test transactions which were obtained by the proposed approach on the dataset with 400 activity records to construct PAMs, and then the constructed PAMs were used to evaluate 138 activity records. All suitable activities were predicted correctly by PAMs.Table 18
The predicting results obtained by using 20 test transactions.
Tran. number
Transactions
Pred.
Suit. tag
1
0, 0, 4, 3, 3, 2, 0
1
1
2
0, 0, 4, 2, 4, 1, 0
1
1
3
2, 2, 3, 2, 0, 0, 2
1
1
4
2, 3, 1, 2, 0, 0, 2
0
0
5
3, 2, 0, 0, 0, 2, 3
0
0
6
4, 1, 0, 0, 2, 3, 1
0
0
7
0, 0, 0, 2, 4, 4, 3
0
0
8
1, 1, 0, 0, 4, 4, 3
0
0
9
1, 1, 0, 0, 0, 4, 3
0
0
10
4, 1, 0, 0, 2, 3, 2
0
0
11
0, 0, 0, 4, 2, 2, 2
0
0
12
0, 0, 4, 4, 2, 1, 1
0
0
13
0, 0, 2, 3, 1, 0, 0
0
0
14
4, 2, 1, 1, 0, 0, 0
0
0
15
3, 3, 1, 0, 0, 0, 1
0
0
16
3, 2, 2, 0, 0, 0, 0
0
0
17
4, 2, 3, 4, 0, 0, 0
0
0
18
4, 2, 4, 4, 0, 4, 2
0
0
19
4, 2, 3, 4, 0, 0, 0
0
0
20
4, 3, 3, 2, 0
1
1


## 4.1. Suitable Activity Identification

The activity data, including ActX, ActY, and ActZ, are used to cluster the collected data. Table 4 shows the activity clusters obtained from the collected data shown in Table 2; the number of clusters is selected as 5 (denoted by the numbers 0 to 4). ActTag is not used as the attribute for clustering and is intended only for helping the user recognize the activity.Table 4
The activity clusters obtained from collected data.
Data number
MTime
ActX
ActY
ActZ
ActTag
Cluster
0
2014/4/21  11:23:17 PM
−0.96
0.88
7.73
U
0
1
2014/4/21  11:23:18 PM
−0.23
1.62
8.69
U
2
2
2014/4/21  11:23:19 PM
−1.69
1.88
7.73
U
0
3
2014/4/21  11:23:20 PM
0.04
1.62
9.19
U
2
4
2014/4/21  11:23:21 PM
0.81
0.69
6.81
U
4
5
2014/4/21  11:23:22 PM
0.69
−1.00
14.38
U
3
6
2014/4/21  11:23:23 PM
0.35
2.12
10.81
U
2The clustered activities are used to form activity transactions for a transaction length of 6. The items of a new transaction are selected from the previous transaction by shifting the items to the right by one item. For example, the first transaction is selected from item 0 to item 5(0,2,0,2,4,3), while the next transaction is selected from 1 to 6 (2,0,2,4,3,2). An activity tag, denoted as TranTag, is attached to each transaction for recognizing the transaction. TranTag can be determined by the number of activity tags appearing in the transaction. The obtained transactions can be used to name the identified activities. In addition to the activity tags, a physiological cluster is associated with each transaction for indicating the effects of the activity transaction. The physiological clusters of the transactions are selected as follows. First, for each transaction, the last three physiological data items are selected and used for calculating a centroid. The centroid can be used to represent the effects of the transaction. Second, the obtained centroids are clustered. Table 5 shows an example of physiological clusters obtained by applying k-means (the number of clusters is 5) to the physiological centroids of the transactions.Table 5
The physiological clusters.
Tran. number
Physiological centroid
Phy. cluster
0
36.100, 115.000, 62.000, 76.000
0
1
36.100, 116.000, 68.000, 77.000
1
2
36.050, 117.000, 74.000, 78.000
1
7
36.000, 121.000, 73.500, 82.000
3
8
35.950, 125.000, 73.000, 86.000
3
9
35.900, 125.000, 73.000, 86.000
3
17
35.900, 119.500, 78.000, 79.000
4
18
35.900, 119.500, 78.000, 79.000
4
71
36.200, 123.000, 72.500, 79.500
2
72
36.150, 126.000, 73.000, 79.000
2
73
36.100, 126.000, 73.000, 79.000
2The environment clusters are obtained using the collected environmental data. The centroids of these environmental data are computed and clustered. Examples of obtained environment centroids and clusters are shown in Table6; the environmental parameters, including temperature and humidity, do not change rapidly and are clustered into two clusters (denoted as 0 and 1). The transaction tags, physiological clusters, and environment clusters are added to the transactions ({ciu,…,cju},ei;civ,[bi]). The suitability tags bi are assigned by medical personnel according to the physiological cluster of the transaction. Table 7 shows an example of obtained transactions, and the total number of obtained transactions is 137.Table 6
The environment clusters.
Tran. number
Environment centroid
Env. cluster
0
24.200, 63.183
1
1
24.200, 63.167
1
2
24.200, 63.150
1
43
28.100, 83.200
0
44
28.100, 83.200
0
45
28.100, 83.200
0Table 7
The activity transactions.
Tran.number
Activity transaction
TranTag
Phy.cluster
Env. cluster
0
0, 2, 0, 2, 4, 3
U
0
1
1
2, 0, 2, 4, 3, 2
U
1
1
2
0, 2, 4, 3, 2, 4
U
1
1
7
4, 3, 4, 2, 2, 1
U
3
1
17
4, 4, 3, 4, 3, 3
D
4
1


## 4.2. Personal Activity Modeling

The activity transaction with physiological clusters{ciu,…,cju}→{civ} can be used to construct PAMs. Table 8 shows the PAMs obtained using association mining; the minimum support is 0.04 and the minimum confidence is 80%.Activity items denote the antecedent items, while thephy. item represents the subsequent item of the rule.Support indicates the frequency of appearance of the patterns, whileconfidence denotes the accuracy of the rule. For example, rule 2 indicates that an activity with the pattern {2,0,0} may yield physiological cluster 0 with 7% support and 90% confidence. This pattern can further be extended to {2,0,0,0}, which also yields cluster 0 with support 5% and confidence 100%.Table 8
Activity models with physiological clusters.
Rulenumber
Activity items
Phy. item
Support
Confidence
0
0, 0, 0
→
0
0.1314
1.0000
1
0, 1, 3
→
2
0.0438
1.0000
2
2, 0, 0
→
0
0.0730
0.9000
3
2, 0, 1
→
2
0.0511
0.8571
4
4, 2, 0
→
1
0.0511
1.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
7
2, 0, 0, 0
→
0
0.0511
1.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
9
2, 2, 0, 0
→
0
0.0511
1.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
11
2, 2, 2, 2
→
0
0.0803
1.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000The environment clustersei of the transaction indicate the situation in which the activities are performed. Different environment clusters may be associated with different effects. Therefore, the environment clusters should be considered while applying the rule on prediction of suitable activity. The confidences of the obtained rules with environment clusters are shown in Table 9; no minimum confidence is used to filter the rules. For example, according to rule 2, an activity with the pattern p1={2,0,0} may yield physiological cluster 0 with confidence 90%, with all transactions with pattern p1 (100%) contained in environment cluster 0. However, when rule 3 is applied, an activity with the pattern p2={2,0,1} may yield physiological cluster 2 with confidence 86%, with only 71% of transactions with pattern p2 being contained in environment cluster 0.Table 9
Confidence of activity models with environment clusters.
Rule number
Activity items
Phy. item
Support
Confidence
Env. confidence
Cluster 0
Cluster 1
0
0, 0, 0
→
0
0.1314
1.0000
1.0000
0.0000
1
0, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
2
2, 0, 0
→
0
0.0730
0.9000
1.0000
0.0000
3
2, 0, 1
→
2
0.0511
0.8571
0.7143
0.2857
4
4, 2, 0
→
1
0.0511
1.0000
1.0000
0.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
1.0000
0.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
7
2, 0, 0, 0
→
0
0.0511
1.0000
1.0000
0.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
0.8571
0.1429
9
2, 2, 0, 0
→
0
0.0511
1.0000
1.0000
0.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
0.8889
0.1111
11
2, 2, 2, 2
→
0
0.0803
1.0000
1.0000
0.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
1.0000
0.0000
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
1.0000
0.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000
1.0000
0.0000For determining the suitability of activities, the physiological clusters are evaluated by medical personnel and suitability tags are attached to the transactions. In this study, the suitability tags are evaluated according to the obtained physiological centroids and clusters (as shown in Table10). The suitability tag is 0 for physiological clusters 0 and 1, 1 for physiological clusters 2 and 3, and −1 for physiological cluster 4. An example of activity transactions with suitability tags (without minimum confidence) is shown in Table 11, in which the confidences for suitability tags −1, 0, and 1 are shown in columns 7, 8, and 9, respectively.Table 10
The activity transactions with suitability tags.
Tran. number
Activity transaction
TranTag
Phy. cluster
Env. cluster
Suitability tag
0
0, 2, 0, 2, 4, 3
U
0
0
0
1
2, 0, 2, 4, 3, 2
U
1
0
0
2
0, 2, 4, 3, 2, 4
U
1
0
0
7
4, 3, 4, 2, 2, 1
U
3
0
1
17
4, 4, 3, 4, 3, 3
D
4
0
−1
30
2, 2, 1, 0, 4, 1
D
2
0
1Table 11
Confidence of activity models with suitability tags.
Rule number
Activity items
Phy. item
Support
Confidence
Confidences for suitability tags
−1
0
1
0
0, 0, 0
→
0
0.1314
1.0000
0.0000
1.0000
0.0000
1
0, 1, 3
→
2
0.0438
1.0000
0.0000
0.0000
1.0000
2
2, 0, 0
→
0
0.0730
0.9000
0.0000
0.9000
0.1000
3
2, 0, 1
→
2
0.0511
0.8571
0.0000
0.1429
0.8571
4
4, 2, 0
→
1
0.0511
1.0000
0.0000
1.0000
0.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
0.0000
1.0000
0.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
0.0000
0.0000
1.0000
7
2, 0, 0, 0
→
0
0.0511
1.0000
0.0000
1.0000
0.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
0.0000
1.0000
0.0000
9
2, 2, 0, 0
→
0
0.0511
1.0000
0.0000
1.0000
0.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
0.0000
1.0000
0.0000
11
2, 2, 2, 2
→
0
0.0803
1.0000
0.0000
1.0000
0.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
0.0000
1.0000
0.0000
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
0.0000
1.0000
0.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000
0.0000
1.0000
0.0000The confidences for suitability tags indicate the probability of the corresponding rule yielding suitable physiological clusters. For example, theconfidence of the suitability tag 0 of rule 2 is 90% which means the probability to cause the physiological cluster 2 is approximately 90%. An activity satisfying a rule with higher suitability can be treated as suitable activities for users. Therefore, rules 1, 3, and 6 shown in Table 11 can be used to identify suitable activities. An activity satisfying the patterns of suitable rules can be identified as suitable activity.The TranTag associated with each transaction can be used to name the identified activities. Table12 shows the confidences for different activity tags, including D (downhill), U (uphill), and F (smooth road). The activity tags with high confidences can be used for naming the identified activities, such as F for rules 0 and 5 and D for rule 4. The D and U activities may contain pattern {0,1,3}.Table 12
The activity models with activity tags.
Rule number
Activity items
Phy. item
Support
Confidence
Conf. for activity tags
D
U
F
0
0, 0, 0
→
0
0.1314
1.0000
0.0000
0.0000
1.0000
1
0, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
0.0000
2
2, 0, 0
→
0
0.0730
0.9000
0.0000
0.1000
0.9000
3
2, 0, 1
→
2
0.0511
0.8571
0.2857
0.5714
0.1429
4
4, 2, 0
→
1
0.0511
1.0000
1.0000
0.0000
0.0000
5
0, 0, 0, 0
→
0
0.0584
1.0000
0.0000
0.0000
1.0000
6
0, 4, 1, 3
→
2
0.0438
1.0000
0.5000
0.5000
0.0000
7
2, 0, 0, 0
→
0
0.0511
1.0000
0.0000
0.0000
1.0000
8
2, 0, 2, 2
→
0
0.0511
0.8571
0.0000
0.1429
0.8571
9
2, 2, 0, 0
→
0
0.0511
1.0000
0.0000
0.0000
1.0000
10
2, 2, 2, 0
→
0
0.0657
0.8889
0.1111
0.0000
0.8889
11
2, 2, 2, 2
→
0
0.0803
1.0000
0.0000
0.0000
1.0000
12
1, 1, 1, 1
→
0
0.1022
0.9286
0.0714
0.0714
0.8571
13
2, 2, 2, 2, 2
→
0
0.0438
1.0000
0.0000
0.0000
1.0000
14
1, 1, 1, 1, 1
→
0
0.0584
1.0000
0.0000
0.0000
1.0000


## 4.3. Suitable Activity Identification

The obtained PAMs can be used to identify suitable activities. In this subsection, the application of the obtained PAMs to another test dataset is discussed for demonstrating how the proposed approach can be applied to identify suitable activities. The attributes of the test dataset are displayed in Table1. The test dataset contains 70 data items collected from different activities, including 28 U activities, 28 D activities, and 14 F activities (the dataset is available at http://mgiga.com.tw/PAM/). The test dataset are divided into 10 transactions, and each transaction (containing 7 data items) denotes an activity.Each activity can be treated as a sequence of activity items. The performed activity items in the sequence are used to evaluate theactivity (which is currently being performed), while the physiological data of the last three activities are used to validate the evaluations (the selection of the physiological data of a transaction is identical to the process presented in Section 4.1). Table 13 shows an example of a test dataset. The suitable activity identification process can be described as follows.Table 13
Example of collected testing data.
Number
MTime
ETemp
Humi
ActX
ActY
ActZ
ActTag
BTemp
SBP
DBP
HB
7
10:46:11 PM
25.0
67.4
0.19
−1.04
13.73
U
35.9
120
76
78
8
10:46:12 PM
25.0
67.4
0.88
−0.58
7.35
U
35.9
120
76
78
9
10:46:13 PM
25.0
67.4
−0.58
0.08
9.15
U
35.9
120
76
78
10
10:46:14 PM
25.0
67.5
−1.73
−0.04
6.73
U
35.9
124
72
80
11
10:46:15 PM
25.1
67.5
−0.35
0.96
14.58
U
35.9
124
72
80
12
10:46:16 PM
25.1
67.5
0.04
1.65
12.84
U
35.9
124
72
80
13
10:46:17 PM
25.1
67.5
0.96
0.65
6.08
U
35.9
124
72
80First, the collected activity items are clustered based on the centroids of the activity clusters of the obtained PAMs. Table14 shows the centroids of the activity clusters obtained in Section 4.2. Thenorm denotes the module of the centroid of each cluster that indicates the strength of the activities. The rule r6={0,4,1,3} shown in Table 11 can be expressed as the dash line shown in Figure 5, while the solid line depicts the rule r8={0,2,1,3}. Second, the PAMs (shown in Table 12) are applied to the current activity clusters, and they provide information (suitability) on the current activity. For example, when the first activity item {0.19,-1.04,13.73} is collected and classified into cluster 3, there is no rule shown in Table 11 which can be selected. The second activity item {0.88,-0.58,7.35} is then collected and classified as 0. The activity transaction is {3,0}, and rules 0, 1, 5, and 6 are selected; among these rules, no rule is unsuitable, while rules 1 and 6 are suitable. Therefore, the performing activity may be a suitable activity, and the information provided for the user is “suitable.” Data items 3, 4, and 5 are collected and classified into clusters 1, 0, and 3, respectively. The activity transaction is {3,0,1,0,3}, and only suitable rule 1 is selected. The activity can be evaluated as “suitable.” The last two activity items are classified into clusters 3 and 4, and no further rule is selected for this activity. The test transactions are depicted in Table 15; the third column denotes the prediction results obtained using the collected activity data. The fourth and fifth columns denote the applied rule and suitability confidence, respectively. Transactions 3 and 6 cannot be predicted because no activity pattern can be found in the obtained rules.Table 14
Centroids of the activity clusters of activity models.
Cluster
ActX
ActY
ActZ
Norm
0
−0.493
0.918
7.632
7.70
1
−0.002
−0.134
9.590
9.59
2
−0.302
1.652
9.702
9.85
3
0.358
0.792
13.053
13.08
4
0.343
1.200
6.407
6.53Table 15
Test transactions.
Tran. number
Transaction
Suitability prediction
Applied  rule
Suitability  confidence
0
1, 4, 1, 2, 1, 0, 3
0
4
100%
1
3, 0, 1, 0, 3, 3, 4
1
1
100%
2
2, 4, 0, 3, 0, 2, 3
0
2
90%
3
4, 3, 0, 4, 2, 2, 4
—
—
—
4
0, 1, 0, 4, 1, 2, 3
1
6
100%
5
0, 2, 4, 0, 1, 2, 4
1
3
86%
6
2, 2, 4, 4, 0, 3, 4
—
—
—
7
0, 4, 3, 2, 4, 0, 3
0
4
100%
8
4, 3, 3, 3, 2, 1, 0
0
4
100%
9
3, 1, 4, 4, 4, 2, 0
0
4
100%Figure 5
The visualization of rules with different activity clusters.To validate the prediction results, certain physiological data items were selected and the centroids were classified into physiological clusters of PAMs; the centroids of these clusters are shown in Table16. The physiological clusters of the test transactions are shown in Table 17, which also shows the environmental data classified into cluster 0. The suitability tag (column 6) for each transaction was based on the physiological cluster (column 4). The prediction results (column 3) were compared with the suitability tag (column 6), and it was observed that 80% of the activities could be predicted correctly and that all suitable activities could be identified, such as transactions 1, 4, and 5. The remaining 20% activity transactions, that is, transactions 3 and 6, could not be predicted by using the obtained rules, because no obtained rules could be applied on transactions 3 and 6. However, new transactions can be added into the activity records to update the original models so that the updated models can be used to predict subsequent activity records. The obtained PAMs are used to evaluate the activities performed, and they provide evaluation results to users. The constructed PAMs can be updated using subsequent activity data.Table 16
Centroids of the physiological clusters of activity models.
Cluster
BTemp
SBP
DBP
HB
0
35.8
112
63
77
1
36.1
119
72
77
2
36.0
124
71
79
3
35.9
123
75
84
4
36.0
120
78
74Table 17
The predicting results obtained by using 10 test transactions.
Tran. number
Transactions
Predictions
Phy. cluster
Env. cluster
Suitability tag
0
1, 4, 1, 2, 1, 0, 3
0
1
0
0
1
3, 0, 1, 0, 3, 3, 4
1
2
0
1
2
2, 4, 0, 3, 0, 2, 3
0
1
0
0
3
4, 3, 0, 4, 2, 2, 4
—
1
0
0
4
0, 1, 0, 4, 1, 2, 3
1
2
0
1
5
0, 2, 4, 0, 1, 2, 4
1
2
0
1
6
2, 2, 4, 4, 0, 3, 4
—
1
0
0
7
0, 4, 3, 2, 4, 0, 3
0
1
0
0
8
4, 3, 3, 3, 2, 1, 0
0
1
0
0
9
3, 1, 4, 4, 4, 2, 0
0
1
0
0Table18 presents the results of test transactions which were obtained by the proposed approach on the dataset with 400 activity records to construct PAMs, and then the constructed PAMs were used to evaluate 138 activity records. All suitable activities were predicted correctly by PAMs.Table 18
The predicting results obtained by using 20 test transactions.
Tran. number
Transactions
Pred.
Suit. tag
1
0, 0, 4, 3, 3, 2, 0
1
1
2
0, 0, 4, 2, 4, 1, 0
1
1
3
2, 2, 3, 2, 0, 0, 2
1
1
4
2, 3, 1, 2, 0, 0, 2
0
0
5
3, 2, 0, 0, 0, 2, 3
0
0
6
4, 1, 0, 0, 2, 3, 1
0
0
7
0, 0, 0, 2, 4, 4, 3
0
0
8
1, 1, 0, 0, 4, 4, 3
0
0
9
1, 1, 0, 0, 0, 4, 3
0
0
10
4, 1, 0, 0, 2, 3, 2
0
0
11
0, 0, 0, 4, 2, 2, 2
0
0
12
0, 0, 4, 4, 2, 1, 1
0
0
13
0, 0, 2, 3, 1, 0, 0
0
0
14
4, 2, 1, 1, 0, 0, 0
0
0
15
3, 3, 1, 0, 0, 0, 1
0
0
16
3, 2, 2, 0, 0, 0, 0
0
0
17
4, 2, 3, 4, 0, 0, 0
0
0
18
4, 2, 4, 4, 0, 4, 2
0
0
19
4, 2, 3, 4, 0, 0, 0
0
0
20
4, 3, 3, 2, 0
1
1


## 5. Conclusion

This study proposes an analyzing approach for planning suitable physical activities. The approach uses techniques of association rule mining and clustering on a dataset of activity and physiological information to construct physical activity models (PAMs), which can be used to predict suitable physical activities for personal health and leisure management.A potential limitation of this study is the prediction models are constructed using historic activity data and thus subsequent activities with unknown patterns cannot be predicted. Although collecting large amount of activity data may address this problem, new patterns still possibly occur in subsequent activities. Another limitation of this study is that the obtained physiological clusters require medical personnel to determinate the suitability tag to construct prediction models. Further research should apply the knowledge transfer techniques on obtained rule sets to infer new rules for subsequent activities with new activity patterns. Furthermore, the similarity measure techniques should be applied to measure the similarity of obtained and new-build physiological clusters to reduce the efforts of tagging process.



---

*Source: 618061-2015-10-28.xml*