Add tfio.IOTensor.from_prometheus support #438
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This PR depends on PR #437PR #437 has been merged.In the past couple of months I have been trying to come up with a good example of using Prometheus with TensorFlow for infrastructure/compute usage prediction and alerting in case of anomaly. My plan was to use LSTM to combine with prometheus observation data for that.
Though there is a PrometheusDataset support already, the format of dataset is not very intuitive and hard to do it in a smooth way.
The biggest challenge is that, normally for time series data you have to setup a look back window for training, and you normalize the data (with total). Both are not easily available.
Further more, to process data in normal TF operations such as tf.roll, it requires reading the whole data into one Tenor. But this is not very straightforward as well with iterable dataset.
This PR adds tfio.IOTensor.from_prometheus which allows easily conversion the prometheus observation data into a tuple of Tensors, and do additional feature engineering.
Signed-off-by: Yong Tang [email protected]