SequencePredictorFunction

SequencePredictorFunction[]

represents a function generated by SequencePredict that predicts the next elements from a sequence.

Details and Options

  • SequencePredictorFunction works like Function.
  • SequencePredictorFunction[][seq] attempts to predict the next element in the sequence seq.
  • SequencePredictorFunction[][{seq1,seq2,}] attempts to predict all the seqi.
  • SequencePredictorFunction[][seq,prop] gives the specified property associated with seq.
  • In SequencePredictorFunction[][{},prop], {} is interpreted as an empty list of sequences rather than an empty sequence.
  • Sequence seq is assumed to be a subsequence of an unknown infinite sequence.
  • Possible properties include:
  • "NextElement"most likely next element
    "NextElement"nindividually most likely next n elements
    "NextSequence"nmost likely next length-n sequence of elements
    "RandomNextElement"random sample from the next-element distribution
    "RandomNextElement"nrandom sample from the next-sequence distribution
    "Probabilities"association of probabilities for all possible next elements
    "SequenceProbability"probability for the predictor to generate the given sequence
    "SequenceLogProbability"log probability for the predictor to generate the sequence
    "Properties"list of all properties available
  • In SequencePredictorFunction[][,"SequenceProbability"], some probability mass is kept for unknown elements.
  • SequencePredictorFunction[][data,,opts] specifies that the sequence predictor should use the options opts when applied to data.
  • Possible options are:
  • PerformanceGoalAutomaticwhich aspect of performance to optimize
    RandomSeedingAutomaticwhat seeding of pseudorandom generators should be done internally
  • Possible settings for PerformanceGoal include:
  • "Quality"maximize accuracy of the prediction
    "Speed"maximize speed of the prediction
    Automaticautomatic tradeoff among speed and accuracy
  • Possible settings for RandomSeeding include:
  • Automaticautomatically reseed every time the function is called
    Inheriteduse externally seeded random numbers
    seeduse an explicit integer or strings as a seed

Examples

open allclose all

Basic Examples  (1)

Create a sequence predictor function with SequencePredict and a training set of subsequences:

In[1]:=
Click for copyable input
Out[1]=

Use the sequence predictor function to predict the next element:

In[2]:=
Click for copyable input
Out[2]=

Obtain the probabilities of the next element given the sequence:

In[3]:=
Click for copyable input
Out[3]=

Obtain a random next element according to the preceding distribution:

In[4]:=
Click for copyable input
Out[4]=

Obtain multiple predictions at a time:

In[5]:=
Click for copyable input
Out[5]=

Predict the most likely next element and reuse this intermediate guess to predict the following element:

In[6]:=
Click for copyable input
Out[6]=

Predict the most likely following sequence:

In[7]:=
Click for copyable input
Out[7]=

Compare the probabilities for the preceding sequences:

In[8]:=
Click for copyable input
Out[8]=

Scope  (4)

Options  (2)

Possible Issues  (1)

See Also

PredictorFunction  SequencePredict  TimeSeriesModel  TimeSeriesForecast

Introduced in 2017
(11.1)
| Updated in 2017
(11.2)