从设备日志数据中提取模式

Extract Patterns from the device log data

我正在做一个项目,我们必须从设备日志数据中提取模式(用户行为)。设备日志包含带有时间戳的不同设备操作,例如设备打开或关闭的时间。

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.

我正在考虑使用贝叶斯网络来提取这些模式。

编辑:设备之间的时间顺序很重要。

Is this the right approach?

有很多可能的方法,但这里有一个非常简单有效的适合领域的方法:

鉴于应用程序的性质,时间顺序并不重要,如果 FanLight 之前打开并不重要,例如

同时考虑到您可以拥有例如一个运动传感器来触发一个读取传感器的例程,也许还有一个周期性的温度检查,您可以使用下面的网络来对提取的模式进行操作(不需要通过时间顺序和事件跟踪使其进一步复杂化,我们提取数据以进行操作在此域中的事件顺序并不有趣)

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.

原始设备日志可能看起来像这样,T/F 是 True/False:

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

有了足够的样本,您就可以在上面训练模型,例如朴素贝叶斯对不相关的 features/inputs 不敏感,所以例如如果你看一下我上面的第一个原始 table,它包含所有变量并尝试预测 AC,如果有足够的数据,它就会明白一些输入不是很重要或完全不相关

或者如果您事先知道 LightFanAC 是如何依赖的,例如我们知道 Light 不会依赖于 Temperature,并且 FanAC 不关心 Light 是否打开(它们即使人在睡觉也可以操作,例如)所以你可以像下面这样分解它:

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