Saturday 15 January 2011

r - Using KNN for pattern matching of time series -


I want to try implementing a KNN algorithm for pattern matching (or pattern recognition) in my time series data . Data consumption are of measurement. I have a table with some columns, where the first column is the datetime of the measurement and the other columns represent the measurement. An example is:

  Datetime Main Stove Kitchen Microwave TV 2013-04-21 14:22:13 341.03 6 57 5 2013-04-21 14:22:16 342.36 6 57 5 2013-04-21 14:22:20 342.52 6 58 5 2013-04-21 14:22:23 342.07 6 57 5 2013-04-21 14:22:26 341.77 6 57 5 2013-04-21 21 : 22: 30 341.66 6 55 5 0 I want to use the KNN algorithm to compare the patterns of the main signal with the patterns of other signals. Therefore my training set will include the measurements of labels for each device and the test data set will include key signal measurements. Its goal is to detect changes in the signal - in which time the device was turned on. 

What do I really want to ask:

  • How to face that time-format? In which format should it pass KNN? (I wonder if there are some conversions for integer or generalization?)
  • Is the KNN algorithm suitable for this task?
  • How to match pattern with KNN generally? I have already tried - I tried to put a single vector in which pattern of pattern of pattern (of each device) was placed in KNN as a set of training. Gone and then put the main data as test set. I completely left the date time column

    Any thoughts?


No comments:

Post a Comment