# Module: tfp.glm

TensorFlow Probability GLM python package.

## Classes

class Bernoulli: Bernoulli(probs=mean) where mean = sigmoid(X @ weights).

class BernoulliNormalCDF: Bernoulli(probs=mean) where mean = Normal(0, 1).cdf(X @ weights).

class Binomial: Binomial(total_count, probs=mean).

class CustomExponentialFamily: Constucts GLM from arbitrary distribution and inverse link function.

class ExponentialFamily: Specifies a mean-value parameterized exponential family.

class GammaExp: Gamma(concentration=1, rate=1 / mean) where mean = exp(X @ w)).

class GammaSoftplus: Gamma(concentration=1, rate=1 / mean) where mean = softplus(X @ w)).

class LogNormal: LogNormal(loc=log(mean) - log(2) / 2, scale=sqrt(log(2))) where

class LogNormalSoftplus: LogNormal(loc=log(mean) - log(2) / 2, scale=sqrt(log(2)))

class NegativeBinomial: NegativeBinomial(total_count, probs=mean / (mean + total_count)).

class NegativeBinomialSoftplus: NegativeBinomial(total_count, probs=mean / (mean + total_count)).

class Normal: Normal(loc=mean, scale=1) where mean = X @ weights.

class NormalReciprocal: Normal(loc=mean, scale=1) where mean = 1 / (X @ weights).

class Poisson: Poisson(rate=mean) where mean = exp(X @ weights).

class PoissonSoftplus: Poisson(rate=mean) where mean = softplus(X @ weights).

## Functions

compute_predicted_linear_response(...): Computes model_matrix @ model_coefficients + offset.

convergence_criteria_small_relative_norm_weights_change(...): Returns Python callable which indicates fitting procedure has converged.

fit(...): Runs multiple Fisher scoring steps.

fit_one_step(...): Runs one step of Fisher scoring.

fit_sparse(...): Fits a GLM using coordinate-wise FIM-informed proximal gradient descent.

fit_sparse_one_step(...): One step of (the outer loop of) the GLM fitting algorithm.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]