Search code examples
swiftcoreml

Core ML for time series analysis


Trying to wrap my head around the capabilities of CoreML.

Say I have a large arary of numbers on time domain, and I would like to predict and find patterns using CoreML. (find unknown patterns relate to time and magnitude)

For instance - LSTM Network , Random Forest, Time Delay, etc.

Most of the models in Apple docs, relate to image and text.

I have read this :

https://developer.apple.com/documentation/coreml/core_ml_api/making_predictions_with_a_sequence_of_inputs

Which not seems to answer what I need. Is there anything like this ? Are there other Core tools for iOS ?


Solution

  • There are two ways you can work with time series:

    1. Treat the time series as a static thing, for example every month consists of an input vector of 30 numbers (or 1000 numbers or whatever kind of data you have). You make a prediction based on that vector.

    2. Use a sequence model like in Apple's link. These models (LSTM etc) keep track of state, which more-or-less remembers what they have seen in the past.

    Which one you need to use depends on the actual problem you're trying to solve.