TemplateModel¶
Classify data instances using Bayesian Logistic Regression with numpyro.
This method uses Bayesian inference to estimate both the parameters and their uncertainty, providing more robust predictions than traditional point-estimate methods. The model assumes Gaussian priors on the regression weights and bias, and uses either Laplace approximation or maximum a posteriori (MAP) estimation for inference. The Laplace approximation provides a Gaussian approximation to the posterior distribution around the mode, allowing for uncertainty quantification in predictions. This is particularly useful when you need to know how confident the model is about its predictions. The model can optionally extract additional variables from the instance data (such as group membership indices) which can be used to extend the model for hierarchical or more complex Bayesian structures. Like all machine learning methods, this method needs to be calibrated ("trained") before it can make any predictions on data. The training process involves Bayesian inference to estimate the posterior distribution over model parameters given the training data and prior beliefs. More Info... Version 1.0.0
Ports/Properties¶
data¶
Data to process.
cond_field¶
The name of the instance data field that contains the conditions to be discriminated. This parameter will be ignored if the packet has previously been processed by a DescribeStatisticalDesign node.
group_field¶
The name of the instance data field that contains group membership indices for hierarchical modeling. If empty, no group structure is used. This field can be used to extract additional variables for more complex Bayesian models.
weight_prior_scale¶
Standard deviation of the Gaussian prior on the regression weights. Smaller values lead to stronger regularization (shrinkage towards zero).
bias_prior_scale¶
Standard deviation of the Gaussian prior on the bias term. Typically set larger than the weight prior to allow more flexibility in the intercept.
include_bias¶
Include a bias term (intercept). If false, your features need to be centered, or include a dummy feature set to 1.
inference_method¶
Inference method to use. 'laplace' uses Laplace approximation around the posterior mode, providing uncertainty estimates. 'map' finds only the maximum a posteriori point estimate.
num_optimization_steps¶
Maximum number of optimization steps for finding the posterior mode. More steps may lead to better convergence but increase computation time.
learning_rate¶
Learning rate for the optimizer used to find the posterior mode.
prediction_type¶
Type of predictions to output. 'mean' outputs the posterior predictive mean. 'samples' would output samples from the posterior predictive distribution (not yet implemented).
num_prediction_samples¶
Number of samples to draw from the posterior for prediction when prediction_type='samples'.
initialize_once¶
Calibrate the model only once. If set to False, then this node will recalibrate itself whenever a non-streaming data chunk is received that has both training labels and associated training instances.
dont_reset_model¶
Do not reset the model when the preceding graph is changed. Normally, when certain parameters of preceding nodes are being changed, the model will be reset. If this is enabled, the model will persist, but there is a chance that the model is incompatible when input data format to this node has changed.
verbosity¶
Verbosity level. Higher numbers will produce more extensive diagnostic output.
random_seed¶
Random seed for reproducible results.
num_posterior_samples¶
Number of samples to draw from the posterior distribution for making predictions. Higher values give more accurate posterior predictive estimates but increase computation time.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.