tensorflow / tensorflow/probability

How to calculate quantile and variance for the tensorflow_probability output?

Open
#482 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I test the following code:

TFP Probabilistic Layers: Regression

In "Custom PSD Kernel" section, I got yhat as the prediction for the test data.

My purpose is to have a confidence interval for this prediction. If I want to calculate the variance or quantile for this prediction with the variance and quantile methods, respectively, I will get the following error:

NotImplementedError: variance is not implemented: TransformedDistribution
NotImplementedError: quantile is not implemented: Independent
Therefore my question is:

How can I obtain the confidence interval for this prediction?

I need something like the following picture [Confidence Interval for the prediction (yhat.mean())]:
image

Thanks for your help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tensorflow_probability/examples/jupyter_notebooks/Probabilistic_Layers_Regression.ipynb, especially the "Custom PSD Kernel" section that produces yhat. Check the distribution methods used there and the reported TransformedDistribution and Independent errors. Done means documenting a supported way to obtain a confidence interval, or clearly explaining the limitation if no such method is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, tensorflow
Domain
machine-learning
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.