How to get periodicity from timeseries data? I would like to create a recommendation system for a smart home application. I gather the data in a time-series database. The app monitors the on/off state of a smart lamp and can create daily routines. I would like to create notifications to the user like &quot;It looks like you are usually use your lamp from 8:00 to 10:00. Would you like to create a routine for that?&quot;.
I am beginner to data science and machine learning and I would like to ask what kind of machine learning algorithm or method should I use for this problem. Someone recommended me Facebook Prophet, but as I can see that library can only predict future occurences not the periodicity of time-series data. Do you know any library or algorithm?
In the image below you can see my problem detailed. There is hourly on/off state of the lamp daily in green and in blue the result that I would like to get: the periods that the lamp is usually on.
Looking at your data - the easiest way is to create a Last-N Days hourly average of the binary indicator - and then use a threshold (based on experimentation) to binarize it.
e.g. if your Last 10 Day hourly average looks like this:
0, 0, 0.6, 0.8, 0.9, 1, 0.9, 0.7, 0, 1, 1, 1, 0
Then, a threshold of 0.8 to binarize would result in the following:
0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0
and - then you could use the time slices associated with the 1's for the recommendation.
This might be the simplest thing you could do - There could however be more sophisticated algorithms out there.