Extract Patterns from the device log data

176 views Asked by At

I am working on a project, in which we have to extract the patterns(User behavior) from the device log data. Device log contains different device actions with a timestamp like when the devices was switched on or when they was switched off.

For example:
When a person enters a room. He first switches on the light and then he 
switches on the fan or Whenever the temp is less than 20 C, he switches off
the AC.

I am thinking to use Bayesian Networks to extract these patterns.

  • Learn Bayes Network from data (using Weka or Netica).

  • Arcs in Bayes Network will give the patterns/dependencies among different devices.

    Is this the right approach ??

Edit: The chronological order between devices matters.

1

There are 1 answers

7
bakkal On BEST ANSWER

Is this the right approach?

There's many possible approaches, but here's a very simple and effective one that fits the domain:

Given the nature of the application, chronological order doesn't really matter, it doesn't matter if the Fan gets turned on before the Light e.g.

Also given that you can have e.g. a motion sensor to trigger a routine that reads the sensors, and perhaps a periodic temperature check, you can use the network below to act upon the extracted patterns (no need to complicate it further with chronological order and event tracking, we extract data to act upon, and event order in this domain isn't interesting)

For example: When a person enters a room. He first switches on the light and then he switches on the fan or Whenever the temp is less than 20 C, he switches off the AC.

Raw devices log might look something like this, T/F being True/False:

Person in room | Temperature | Light | Fan | AC
-----------------------------------------------
T              | 20          | T     | T   | T
T              | 19          | T     | T   | F
F              | 18          | F     | F   | F 

With sufficient samples you can train a model on the above, e.g. Naive bayes is not sensitive to irrelevant features/inputs, so e.g. if you look at my first raw table above that includes all the variables and try to predict AC, with sufficient data it will understand that some inputs are not very important or completely irrelevant

Or if you know how before hand what the Light, Fan, and AC depend on, e.g. we know Light isn't going to depend on Temperature, and that Fan and AC don't care if Light is turned on or not (they can operate even if the person is sleeping e.g.) so you can break it down like below:

enter image description here

Person in Room | Light 
----------------------
T              | T
F              | F

Person in Room | Temperature | Fan
----------------------------------
T              | 20          | T
F              | 25          | F

Person in room | Temperature | AC
---------------------------------
T              | 20          | T
T              | 19          | F
F              | 20          | F
F              | 19          | F