# tf.contrib.timeseries.OneShotPredictionHead

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/timeseries/python/timeseries/head.py#L280-L367) |

A time series head which exports a single stateless serving signature.

    tf.contrib.timeseries.OneShotPredictionHead(
        model, state_manager, optimizer, input_statistics_generator=None, name=None
    )

The serving default signature exported by this head expects `times`, `values`,
and any exogenous features, but no state. `values` has shape `[batch_size,
filter_length, num_features]` and `times` has shape `[batch_size,
total_length]`, where `total_length > filter_length`. Any exogenous features
must have their shapes prefixed by the shape of the `times` feature.

When serving, first performs filtering on the series up to `filter_length`
starting from the default start state for the model, then computes predictions
on the remainder of the series, returning them.

Model state is neither accepted nor returned, so filtering must be performed
each time predictions are requested when using this head.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `model` | A model for time series regression. |
| `state_manager` | A state manager. |
| `optimizer` | An optimizer. |
| `input_statistics_generator` | A input statistics generator. |
| `name` | An optional name for the model. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `logits_dimension` | See `_Head`. |
| `name` | The name of this head. |

<br />

## Methods

### `create_estimator_spec`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/timeseries/python/timeseries/head.py#L232-L277)

    create_estimator_spec(
        features, mode, labels=None
    )

Performs basic error checking and returns an EstimatorSpec.

### `create_loss`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/timeseries/python/timeseries/head.py#L81-L88)

    create_loss(
        features, mode, logits=None, labels=None
    )

See `_Head`.