# 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"n individually most likely next n elements "NextSequence"n most likely next length-n sequence of elements "RandomNextElement" random sample from the next-element distribution "RandomNextElement"n random 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:
•  PerformanceGoal Automatic which aspect of performance to optimize
• Possible settings for PerformanceGoal include:
•  "Quality" maximize accuracy of the prediction "Speed" maximize speed of the prediction Automatic automatic tradeoff among speed and accuracy

# Examples

open allclose all

## Basic Examples(1)

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

 In[1]:=
 Out[1]=

Use the sequence predictor function to predict the next element:

 In[2]:=
 Out[2]=

Obtain the probabilities of the next element given the sequence:

 In[3]:=
 Out[3]=

Obtain a random next element according to the preceding distribution:

 In[4]:=
 Out[4]=

Obtain multiple predictions at a time:

 In[5]:=
 Out[5]=

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

 In[6]:=
 Out[6]=

Predict the most likely following sequence:

 In[7]:=
 Out[7]=

Compare the probabilities for the preceding sequences:

 In[8]:=
 Out[8]=