A Collaborative Context Prediction Technique
Christian Voigtmann, Sian Lun Lau, Klaus David
Department of Computer Science
University of Kassel, Germany
{voigtmann, slau, david}@uni-kassel.de
Abstract—The prediction of contexts plays an important part
in the field of context aware systems and environments for
adapting services proactively to users’ needs. To the best of
our knowledge, most research literature on context prediction
focused on forecasting a user’s contexts only using his available
context history. In the case of a user suddenly changing his
behaviour in an unexpected way, the context history of the user
does not provide future context information for the observed
pattern. Hence context prediction algorithms will fail to forecast
the appropriate future context. To overcome the gap of missing
context information in the user’s context history, we propose the
Collaborative Context Prediction (CCP) approach. Our results
show that the proposed CCP approach is able to give accurate
predictions in the absence of needed context information and
outperforms the Active LeZi method.
Index Terms—context prediction, context awareness, tensor
decomposition, hosvd, collaborative.
recommendation systems [1], [2]. With regard to the abovementioned scenario, the teacher’s future context - giving a
biology class - which is based on movement patterns unknown
to the system, could be predicted by utilising the context
histories of his colleagues.
In Section II existing state of the art to context prediction
is presented. A brief introduction to the Collaboration-based
Context Prediction algorithm and to the underlying HOSVD
technique is given in Section III. Furthermore, a proof of
concept, by comparing the CCP approach to the state of the
art context predictor Active Lezi [3] is outlined in Section IV.
Both methods have been applied to a real-world context data
set, consisting of movement patterns of multiple users, and
compared to each other with regard to the obtained accuracy.
II. R ELATED W ORK
I. I NTRODCTION
With the help of predicted context information, users in
ubiquitous environments can be assisted additionally. This can
be illustrated by taking, for example, a teacher of history and
maths, who gives lessons in the same classroom daily. Before
he enters the classroom, a context aware prediction system
spanning the whole school automatically pre-initialises the
whiteboard and the students’ tablet pcs. Therefore, the latest
updates are installed on the tablet pcs and the needed teaching
materials are automatically transferred from a server to the
pcs. The teacher’s movement patterns recorded in the past are
possible context information useful for the prediction ”giving
a history lesson”.
However, if the teacher has to fill in for a colleague who
teaches biology in a classroom he has not given a lecture in
before, his current movement patterns are unknown to the context prediction system. Current context prediction approaches
that rely on the context history of a single user would fail to
forecast the user’s next context - teaching biology -. Therefore,
the pre-initialisation of the whiteboard and the tablet pcs would
not take place.
Instead of using only the context history of the user whose
next context has to be predicted, we propose using a collaborative approach. This approach enriches the context history
of the user with additional context information of other users
whose histories show similarities to the concerned user. This
method called Collaboration-based Context Prediction (CCP)
uses Higher Order Singular Value Decomposition (HOSVD)
technique. The idea of finding latent information between users
using HOSVD already has been successfully applied to tag-
In this section two existing works of research on context prediction that utilises collaborative mechanisms are introduced
first. Then some works of research related to predicting future
contexts are presented briefly.
The first research work on context prediction that considered
collaborative aspects in a process of context prediction has
been introduced in [4]. The authors suggest a method to predict
a user’s next location by using and interpreting his or her
GPS data. In this approach the gained GPS data is clustered
to meaningful locations and a Markov model is used for the
prediction process. Thereby the paper presents ideas for singleand multi-user/collaborative applications based on location
data. One outlined scenario for a collaborative application
indicates serendipitous meetings between friends similar to
Google Latitude1 , e.g. if the prediction model of Bob knows
that Alice will be at a particular place at a certain time he
could be notified if he happens to be in the vicinity at the
same time. A second research work that is trying to combine
context prediction and collaborative aspects is the SenseCast2
project at the University of Braunschweig. One of the goals
of the SenseCast project is to develop new methods for
context prediction in wireless-sensor networks by employing
collaborative strategies.
A broad overview of existing approaches to context prediction is given next. The Active LeZi [3] context predictor
that is being compared to our CCP approach in this work has
been developed in the course of the MavHome [5] project
1 http://www.google.com/latitude/
2 http://www.ibr.cs.tu-bs.de/projects/senseCast/
978-1-4244-8331-0/11/$26.00 ©2011 IEEE
conducted by Diana J. Cook. Active LeZi has been taken to
forecast devices the inhabitants of the MavHome will interact
next with, for example.
A context time-series prediction algorithm that is based
on local-alignment techniques is introduced in [6], [7]. The
approach is inspired by algorithms taken from computational
biology. On the one hand, the author evaluated his proposed
context prediction method by applying Alignment to a windpower data set to predict the wind power required in the future.
On the other hand, a data set consisting of the information
on a mobile user’s location was used to predict his location
trajectory.
In [8] a Structured Context Prediction algorithm is presented. The approach tries to overcome the trade-off for
context prediction methods needing to be generic and efficient
at the same time. Therefore, additional knowledge about
the application domain given by the developer at design
time is used. The used evaluation approach focuses on the
availability prediction of two services. Another interesting
approach to context prediction is outlined in [9]. The authors
propose a probabilistic method to forecast future contexts of
mobile users. Instead of using well-known machine learning
paradigms, they introduce a novel graphical structure with
time-based edge weights called time-inferred multiple pattern
network (TIMPN). The proof of concept was given by the
authors by applying the proposed method to real-world context
data of a mobile user.
In contrast to the collaborative approaches presented in
this section the CCP approach introduced and evaluated next
focuses on collaboration to overcome missing context information in the user’s context history to gain more reliable
prediction results.
III. I NTRODUCTION T O C OLLABORATIVE -BASED
C ONTEXT P REDICTION
We propose the Collaborative-based Context Prediction
(CCP) approach that increases the possibility for making
a currently unknown context pattern of a user available to
forecast the next future context.
The Collaborative Ubiquitous Environment presented in
figure 1 forms the foundation of the CCP approach. The
environment consists of three different entities. The first entity
is represented by the set of users U ∈ U of the Collaborative
Ubiquitous Environment, the second by the set of possible
context patterns Cp ∈ CP and the third by the set of
predictable future contexts Fc ∈ FC. Therefore the history
of a user Ui is described by Hi ⊆ CP × FC.
HOSVD is used to enrich the context history of the user
with additional latent information by using existing relations
(equal context parts) between the context histories of the
users in the Collaborative Ubiquitous Environment (see figure
1). Latent information comprises new context parts in the
context history of the user that were formerly unknown and
can be used to infer the next future context. The basic idea
of HOSVD is to restrict the dimensionality of each entity
of a Collaborative Ubiquitous Environment to a specific size
Collaborative Ubiquitous Environment
User
Context History
U1
Cp2|Fc1
Cpm-1|Fci
Cp5|Fc9
Cpm-1|Fci
U2
Cp5|Fc9
Cp7|Fc5
Cp8|Fcj
Cp3|Fc2
U3
Cp1|Fcn
Cpm|Fc1
Cpm-1|Fci
Cp8|Fcj
Un
Cp8|Fcj
Cpm-1|Fci
Cp2|Fc1
Cpm|Fc1
Fig. 1. Presents n users of a Collaborative Ubiquitous Environment with n
different context histories. Equal context parts are marked in the same colour.
Every context part in the context history Hi of the user Ui consists of two
elements. Cp ∈ CP indicates the context pattern and Fc ∈ F C indicates
the future context that follows the previous context pattern. Altogether
the Collaborative Ubiquitous Environment consists of n different users, m
different context patterns and j different future contexts.
Cp1Cp2Cp3
U1
Cpm
1
1
1
U2
1
U3
Un
1
1
Fcj
Fc2
Fc1
Fig. 2. 3-order tensor to store data of a Collaborative Ubiquitous Environment. The first dimension characterises all users U of the Collaborative
Ubiquitous Environment that provide information in the form of context data.
The second dimension represents all context patterns CP that are available
in the context histories of the users. F C symbolises the third dimension, the
future contexts, that can be inferred as the next possible context of a user
U ∈ U for a given context pattern.
where each entity contains relevant, less noisy information by
using the n-mode product outlined in equation 1. Afterwards,
the downsized information space is used to recalculate the
Collaborative Ubiquitous Environment based on the most
relevant information using the n-mode product again. For a
more profound introduction to HOSVD we refer to [10], [11].
A ×n U
(1)
To demonstrate the practical use of HOSVD this technique
is applied to the presented Collaborative Ubiquitous Environment. For the storage of the data we use a 3-order tensor
A ∈ ℜ|U |×|CP|×|F C| , compare with Figure 2.
The existing relations between the entities U, CP, FC are
stored in the tensor structure A as a one. All relations that do
not exist are treated as values of zero.
To minimise the number of unknown context patterns in
the user’s history the dimensionality sizes of the 3-order
tensor structure A are downsized. As a result a 3-order tensor
Σ ∈ ℜc1 ×c2 ×c3 is received, whose three dimensions are
c2
c1
c3
Fig. 3.
Downsized 3-order tensor structure that contains only the most
relevant data of every dimension.
...
reduced to the information that spans the space that contains
the most relevant information. The size of the dimension U
is reduced to c1 , the size of the dimension CP is reduced
to c2 and the third dimension FC is collapsed to the size of
c3 . Figure 3 shows the tensor - marked in red - with reduced
dimensionality size. Σ symbolises the approximation of the
tensor A. Afterwards HOSVD is used to retransform the tensor
Σ into the initial dimension size of the tensor A by reusing
the n-mode product as described above. The resulting tensor
A′ ∈ ℜ|U |×|CP|×|F C| finally concludes with new information
in terms of new relations between the three dimensions that
can be used to forecast the user’s next contexts.
IV. E XPERIMENTAL R ESULTS
In this section the CCP approach is compared with the
Active LeZi method concerning their accuracy in a realworld context data set. The data set used for the evaluation
process contains acceleration data that was recorded using
the accelerometer in a smartphone annotated with the movements performed by test users, such as going upstairs, going
downstairs, sitting, walking and standing. This was carried
out similarly to the experiments performed in our previous
work [12]. Smartphones used for the recording of acceleration
included a Nokia N95, a 5730 Xpressmusic and a N900.
For the purpose of this work, the Symbolic Aggregate approXimation (SAX) representation of the time series proposed
by Lin et. al [13] is used to transform the magnitude of the raw
acceleration data into a series of alphabetical symbols. Each
time series was normalised and split into windows of 4 seconds
characterising the movement patterns of a user. The Symbolic
Aggregate approXimation represents every movement pattern
as a string with a length of 32 and a total of six different
symbols {a, b, c, d, e, f}. Furthermore, we divided every
different set of recorded movement patterns into a maximum
of three sub-clusters. Sub-clusters of ”going upstairs” are
represented by the labels {C0, C1, C2}. Henceforth the subcluster labels represent the context information in the history
of the users.
Figure 4 illustrates an exemplary time series with a window
size of 4 seconds that characterises the movement pattern
”going upstairs” and its transformation using SAX. The data
snippet below shows the label, the SAX transformation of the
accelerator data and the respective sub-cluster label of a user’s
recorded movement pattern.
For this evaluation four context histories of four users
were utilised. Every context history contains approximately
GoDownStairs - baecdbbbeedfebceeaceebabfeaceeda - B1
GoDownStairs - cdcccccccbcdfaacddefbbcefacdcddb - B0
...
GoDownStairs - bacbfbabddebabbfdabdfdcabbfabcfe - B2
GoUpStairs
- ebebbcefadebbdfeafebdfcaeccccddb - C1
GoUpStairs
- ccdcdccbcefdcabfccbcfddaafdccbfd - C1
GoUpStairs
- eafbbbceccbbfddbcdeabfcbfaaedccb - C2
...
...
Fig. 4.
Illustration of acceleration data and their SAX representation.
1000 time ordered sub-cluster labels. The labels represent
the context information resulted from the recorded movement
behaviours of the users. To gain a representative number of
different evaluation sets (context histories), the data sets were
split using different sizes {3, 5, 7} for the length of the context
parts. A context part with a size of three for example, consists
of two sub-cluster labels representing the context pattern and
one sub-cluster label representing the future context. Moreover, additional evaluation sets were generated by removing
context parts that occurred successively. Data sets without
successive context parts are called single-mode data sets, data
sets with successive context parts are called all-mode data sets.
For the evaluation of the prediction accuracy of the Collaborative Context Predictor and the Active LeZi predictor
these approaches were applied to different test data sets. A
test data set consisted of intersections of exactly two users’
context histories. Intersections are context parts that occur in
both histories.
The test data sets were used to simulate missing context
information in the context history of the respective users. For
every test data set there are three training data sets that are
used to construct the prediction models for the applied context
prediction approaches. The first training data set contains the
information on the context histories of the two users the test
data set has been generated from. The second training data
set extends the information of the first training data set by
adding the context history of a third user. The third data set
extends the second by adding the history of a fourth user. For
the prediction process we use the ”leave-one-out” strategy for
both context prediction approaches. In doing so, each single
context part of the test data set is removed temporally one
after the other from the context history of the corresponding
user in the current training data set. Every time a single context
part is removed temporally, the prediction model is constructed
anew with the reduced training data set and is used to forecast
the next context of the context pattern given by the current
context part of the test data set. Finally, the predicted context
is compared to the future context also given by the current
context part afterwards.
Altogether 24 different test data sets were generated. The
test data sets resulted from different combinations of usercontext history pairs. We combined the context histories of
user one and two, user two and three, user one and three
and user two and four. In addition, each combination was
combined with the aforementioned three lengths of the context
parts and the two data set modes. The results in gained accuracy for the both context prediction approaches are presented
in the Figures 5 to 8. The number of instances in each test data
set can be found in the subtitles of the figures. The subfigures
on the left side show the results for the single-mode data set
and the subfigures on the right the achieved results for the
all-mode data set. In each case only the user dimension of the
tensors has been reduced to the size of one to construct the
models of the CCP approach based on the training data sets.
The size of the two other dimensions containing the context
patterns and the future contexts remains unchanged. If the size
of the second or the third dimension is reduced in addition
to the first dimension, the accuracy of the context prediction
process worsens.
The results presented on the eight different charts indicate
that the CCP approach outperforms Active LeZi for predicting
the future context of a user based on unknown context patterns.
The division of the context histories into context parts of
different sizes shows that the prediction results for smaller
sizes mostly achieve less accuracy than for larger sizes. That
is because, among other things, the smaller the chosen size of
the context parts, the higher the number of entries in the test
data set.
In the comparison of the single-mode data sets and the allmode data sets, it can be recognized that in most cases the
prediction for the all-mode data sets achieved better results
for context parts of size three. For the test data sets with a
context part of size five and seven respectively, the achieved
prediction results are quite similar in regard to the two modes.
Furthermore, it becomes evident that the prediction results
can be improved for any given test data set by increasing the
number of user histories used to build the respective prediction
model.
V. C ONCLUSIONS
In this paper the approach of Collaborative-based Context
Prediction was presented briefly and compared with the wellknown Active LeZi predictor. Both prediction methods have
been applied to several test data sets. Test data sets consist of
equal context parts found in the context histories of different
pairs of users. These context parts have been used to simulate
missing information in the user’s context history.
Therefore, we used the leave-one-out strategy by first
removing the context part from the context history of the
respective user. Subsequently, we have predicted the future
context of the respective context pattern by enriching the
context history of the user with extra information which was
obtained from the additional context histories of other users.
The results show that the CCP method received mostly better
results respective accuracy than the Active LeZi approach on
the test data sets. For future work fuzziness is intended to add
to a CCP approach for which context patterns in the histories
of the users do not have to match exactly to be considered as
existing relations.
ACKNOWLEDGMENTS
The authors are involved in the VENUS research project.
VENUS is a research cluster at the interdisciplinary Research Center for Information System Design (ITeG) at Kassel
University. We thank Hesse’s Ministry of Higher Education,
Research, and the Arts for funding the project as part of
the research funding program ”LOEWE - Landes-Offensive
zur Entwicklung Wissenschaftlich-ökonomischer Exzellenz”.
For further information, please visit: http://www.iteg.unikassel.de/venus.
The authors would like to acknowledge the German Federal
Ministry of Education and Research (BMBF) for funding the
project MATRIX (Forderkennzeichen 01BS0802). The authors
are responsible for the content of the publication.
R EFERENCES
[1] P. Symeonidis, A. Nanopoulos, and Y. Manolopoulos, “Tag recommendations based on tensor dimensionality reduction,” in RecSys ’08:
Proceedings of the 2008 ACM conference on Recommender systems.
New York, NY, USA: ACM, 2008, pp. 43–50.
[2] S. Rendle and L. Schmidt-Thieme, “Pairwise interaction tensor factorization for personalized tag recommendation,” in WSDM ’10: Proceedings
of the third ACM international conference on Web search and data
mining. New York, NY, USA: ACM, 2010, pp. 81–90.
[3] K. Gopalratnam and D. J. Cook, “Active lezi: An incremental parsing algorithm for sequential prediction,” in In Sixteenth International Florida
Artificial Intelligence Research Society Conference, 2003, pp. 38–42.
[4] D. Ashbrook and T. Starner, “Using gps to learn significant locations
and predict movement across multiple users,” 2003.
[5] D. C. Michael, M. Youngblood, E. O. Heierman, K. Gopalratnam,
S. Rao, A. Litvin, and F. Khawaja, “Mavhome: An agent-based smart
home,” 2003.
[6] S. Sigg, S. Haseloff, and K. David, “A novel approach to context
prediction in ubicomp environments,” in PIMRC, 2006, pp. 1–5.
[7] ——, “An alignment approach for context prediction tasks in ubicomp
environments,” IEEE Pervasive Computing, vol. 99, no. PrePrints, 2010.
[8] M. Meiners, S. Zaplata, and W. Lamersdorf, “Structured context prediction: A generic approach,” in Proceedings of the 10th IFIP International Conference on Distributed Applications and Interoperable
Systems (DAIS 2010), R. K. F. Eliassen, Ed., IFIP. Springer, 6 2010,
pp. 84–97.
[9] Y.-H. Kim, W. Kim, K. Min, and Y. Yoon, “Probabilistic context
prediction using time-inferred multiple pattern networks,” in SAC ’10:
Proceedings of the 2010 ACM Symposium on Applied Computing. New
York, NY, USA: ACM, 2010, pp. 1015–1019.
[10] L. D. Lathauwer, B. D. Moor, J. Vandewalle, and J. V, “A multilinear
singular value decomposition,” 2000.
[11] T. G. Kolda and B. W. Bader, “Tensor decompositions and applications,”
SIAM Review, vol. 51, no. 3, pp. 455–500, September 2009.
[12] S. L. Lau, I. König, K. David, B. Parandian, C. Carius-Düssel, and
M. Schultz, “Supporting patient monitoring using activity recognition
with a smartphone,” in The Seventh International Symposium on Wireless
Communication Systems (ISWCS’10), 2010.
[13] J. Lin, E. Keogh, L. Wei, and S. Lonardi, “Experiencing sax: a novel
symbolic representation of time series,” Data Mining and Knowledge
Discovery, vol. 15, no. 2, pp. 107–144, October 2007. [Online].
Available: http://dx.doi.org/10.1007/s10618-007-0064-z
Based on test dataset of user 1 and user 2 (single data)
Based on test dataset of user 1 and user 2 (all data)
100
100
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
80
Accuracy in %
Accuracy in %
80
60
40
20
60
40
20
0
0
CP=3
CP=5
CP=7
Size of Context Parts
CP=3
(a) Size of test data sets are 54, 34 and 18
Fig. 5.
Test data sets generated from the intersections of user 1 and user 2. Used with different context part sizes and data modes.
Based on test dataset of user 2 and user 3 (single data)
Based on test dataset of user 2 and user 3 (all data)
100
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
60
40
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
80
Accuracy in %
Accuracy in %
80
20
60
40
20
0
0
CP=3
CP=5
CP=7
Size of Context Parts
CP=3
(a) Size of test data sets are 32, 48 and 12
Fig. 6.
CP=5
CP=7
Size of Context Parts
(b) Size of test data sets are 32, 48 and 12
Test data sets generated from the intersections of user 2 and user 3. Used with different context part sizes and data modes.
Based on test dataset of user 1 and user 3 (single data)
Based on test dataset of user 1 and user 3 (all data)
100
100
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
60
40
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
80
Accuracy in %
80
Accuracy in %
CP=5
CP=7
Size of Context Parts
(b) Size of test data sets are 54, 34 and 18
100
20
60
40
20
0
0
CP=3
CP=5
CP=7
Size of Context Parts
CP=3
(a) Size of test data sets are 28, 44 and 10
Fig. 7.
CP=5
CP=7
Size of Context Parts
(b) Size of test data sets are 28, 44 and 10
Test data sets generated from the intersections of user 1 and user 3. Used with different context part sizes and data modes.
Based on test dataset of user 2 and user 4 (single data)
Based on test dataset of user 2 and user 4 (all data)
100
100
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
60
40
20
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
80
Accuracy in %
80
Accuracy in %
2User(CCP)
2User(AL)
3User(CCP)
3User(AL)
4User(CCP)
4User(AL)
60
40
20
0
0
CP=3
CP=5
CP=7
Size of Context Parts
(a) Size of test data sets are 38, 68 and 16
Fig. 8.
CP=3
CP=5
CP=7
Size of Context Parts
(b) Size of test data sets are 38, 68 and 16
Test data sets generated from the intersections of user 2 and user 4. Used with different context part sizes and data modes.