<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/glm/__init__.py) |

TensorFlow Probability GLM python package.

## Classes

[`class Bernoulli`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/Bernoulli): `Bernoulli(probs=mean)` where `mean = sigmoid(X @ weights)`.

[`class BernoulliNormalCDF`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/BernoulliNormalCDF): `Bernoulli(probs=mean)` where `mean = Normal(0, 1).cdf(X @ weights)`.

[`class Binomial`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/Binomial): `Binomial(total_count, probs=mean)`.

[`class CustomExponentialFamily`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/CustomExponentialFamily): Constucts GLM from arbitrary distribution and inverse link function.

[`class ExponentialFamily`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/ExponentialFamily): Specifies a mean-value parameterized exponential family.

[`class GammaExp`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/GammaExp): `Gamma(concentration=1, rate=1 / mean)` where `mean = exp(X @ w))`.

[`class GammaSoftplus`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/GammaSoftplus): `Gamma(concentration=1, rate=1 / mean)` where `mean = softplus(X @ w))`.

[`class LogNormal`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/LogNormal): `LogNormal(loc=log(mean) - log(2) / 2, scale=sqrt(log(2)))` where `mean = exp(X @ weights)`.

[`class LogNormalSoftplus`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/LogNormalSoftplus): `LogNormal(loc=log(mean) - log(2) / 2, scale=sqrt(log(2)))` `mean = softplus(X @ weights)`.

[`class NegativeBinomial`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/NegativeBinomial): `NegativeBinomial(total_count, probs=mean / (mean + total_count))`.

[`class NegativeBinomialSoftplus`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/NegativeBinomialSoftplus): `NegativeBinomial(total_count, probs=mean / (mean + total_count))`.

[`class Normal`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/Normal): `Normal(loc=mean, scale=1)` where `mean = X @ weights`.

[`class NormalReciprocal`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/NormalReciprocal): `Normal(loc=mean, scale=1)` where `mean = 1 / (X @ weights)`.

[`class Poisson`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/Poisson): `Poisson(rate=mean)` where `mean = exp(X @ weights)`.

[`class PoissonSoftplus`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/PoissonSoftplus): `Poisson(rate=mean)` where `mean = softplus(X @ weights)`.

## Functions

[`compute_predicted_linear_response(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/compute_predicted_linear_response): Computes `model_matrix @ model_coefficients + offset`.

[`convergence_criteria_small_relative_norm_weights_change(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/convergence_criteria_small_relative_norm_weights_change): Returns Python `callable` which indicates fitting procedure has converged.

[`fit(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/fit): Runs multiple Fisher scoring steps.

[`fit_one_step(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/fit_one_step): Runs one step of Fisher scoring.

[`fit_sparse(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/fit_sparse): Fits a GLM using coordinate-wise FIM-informed proximal gradient descent.

[`fit_sparse_one_step(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/glm/fit_sparse_one_step): One step of (the outer loop of) the GLM fitting algorithm.