TFP Feature Selection

139 views
Skip to first unread message

Sarthak Kala

unread,
Apr 4, 2022, 3:25:21 PM4/4/22
to TensorFlow Probability
Hi, I am new to TFP, trying to build a Bayesian regression model with it. Is there a method for feature selection in TFP for Bayesian Linear Regression since I have a lot of features.

Krzysztof Rusek

unread,
Apr 4, 2022, 3:28:30 PM4/4/22
to Sarthak Kala, TensorFlow Probability
Hi, Try using Laplace distribution as  prior, this will give you lasso.
Also in tfp.experimental.nn you can find implementation of spike and lab prior 


Wiadomość napisana przez Sarthak Kala <sarthak...@gmail.com> w dniu 04.04.2022, o godz. 21:25:

Hi, I am new to TFP, trying to build a Bayesian regression model with it. Is there a method for feature selection in TFP for Bayesian Linear Regression since I have a lot of features.

--
You received this message because you are subscribed to the Google Groups "TensorFlow Probability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfprobabilit...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfprobability/4f371d58-3c5a-4774-9758-f1e5f0c97b16n%40tensorflow.org.

Sarthak Kala

unread,
Apr 7, 2022, 9:16:27 AM4/7/22
to TensorFlow Probability, kru...@gmail.com, TensorFlow Probability, Sarthak Kala

Hi, Can anyone share a working code patch for tensorflow probability spike and slab for feature selection ?

Mike Lawrence

unread,
Apr 7, 2022, 9:22:26 AM4/7/22
to Sarthak Kala, TensorFlow Probability, kru...@gmail.com
Pretty sure the consensus in the Bayes/stats world in recent years (decade or so?) is that spike and slab is not a very good way to achieve feature selection. Take a look at the Finnish horseshoe as a more modern alternative. 

--

--
Mike Lawrence, PhD
Co-founder & Research Scientist
Axem Neurotechnology
axemneuro.com

~ Certainty is (usually) folly ~

Mike Lawrence

unread,
Apr 7, 2022, 9:30:59 AM4/7/22
to Sarthak Kala, TensorFlow Probability, kru...@gmail.com

Brian Patton 🚀

unread,
Apr 7, 2022, 9:53:23 AM4/7/22
to Mike Lawrence, Sarthak Kala, TensorFlow Probability, kru...@gmail.com
There's some support for spike and slab Gibbs sampling for STS in here, if it's interesting. 
Might be hard to divine usage since we haven't formally exposed an API or explicitly supported its use with STS yet.


Brian Patton | Software Engineer | b...@google.com




Colin Carroll

unread,
Apr 7, 2022, 10:22:07 AM4/7/22
to Brian Patton 🚀, Mike Lawrence, Sarthak Kala, TensorFlow Probability, kru...@gmail.com
Echoing and clarifying some things: the MAP estimate with a Laplace prior on weights will recover Lasso regression, but if you sample or compute an expectation, your features will not actually be sparse. 

The spike and slab Gibbs sampler is quite experimental, so if you use it keep an eye on release notes (or pin a nightly), but would love to hear anyone's experience using it (successes, failures, frustrations, wishes)!

Reply all
Reply to author
Forward
0 new messages