Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tfp.experimental.inference_gym.targets.GermanCreditNumericLogisticRegression

View source on GitHub

Bayesian logistic regression with a Gaussian prior.

Inherits From: LogisticRegression

tfp.experimental.inference_gym.targets.GermanCreditNumericLogisticRegression()

This model uses the German Credit (numeric) data set [1].

References

  1. https://archive.ics.uci.edu/ml/datasets/statlog+(german+credit+data)

Args:

  • train_features: Floating-point Tensor with shape [num_train_points, num_features]. Training features.
  • train_labels: Integer Tensor with shape [num_train_points]. Training labels.
  • test_features: Floating-point Tensor with shape [num_test_points, num_features]. Testing features. Can be None, in which case test-related sample transformations are not computed.
  • test_labels: Integer Tensor with shape [num_test_points]. Testing labels. Can be None, in which case test-related sample transformations are not computed.
  • name: Python str name prefixed to Ops created by this class.
  • pretty_name: A Python str. The pretty name of this model.

Attributes:

  • default_event_space_bijector: Bijector mapping the reals (R**n) to the event space of this model.
  • dtype: The DType of Tensors handled by this model.
  • event_shape: Shape of a single sample from as a TensorShape.

    May be partially defined or unknown.

  • name: Python str name prefixed to Ops created by this class.

  • sample_transformations: A dictionary of names to SampleTransformations.

Raises:

  • ValueError: If test_features and test_labels are either not both None or not both specified.

Child Classes

class SampleTransformation

Methods

evidence

View source

evidence(
    name='evidence'
)

The evidence that the joint model is conditioned on.

joint_distribution

View source

joint_distribution(
    name='joint_distribution'
)

The joint distribution before any conditioning.

unnormalized_log_prob

View source

unnormalized_log_prob(
    value, name='unnormalized_log_prob'
)

The un-normalized log density of evaluated at a point.

This corresponds to the target distribution associated with the model, often its posterior.

Args:

  • value: A (nest of) Tensor to evaluate the log density at.
  • name: Python str name prefixed to Ops created by this method.

Returns:

  • unnormalized_log_prob: A floating point Tensor.