synthcity.plugins.core.models.mbi.inference module
- class FactoredInference(domain, structural_zeros={}, metric='L2', log=False, iters=1000, warm_start=False, elim_order=None)
Bases:
object
- dual_averaging(measurements, total=None, lipschitz=None, callback=None)
- Use the regularized dual averaging algorithm to estimate the GraphicalModel
See https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/xiao10JMLR.pdf
- Parameters
measurements – a list of (Q, y, noise, proj) tuples, where Q is the measurement matrix (a numpy array or scipy sparse matrix or LinearOperator) y is the noisy answers to the measurement queries noise is the standard deviation of the noise added to y proj defines the marginal used for this measurement set (a subset of attributes)
total – The total number of records (if known)
lipschitz – the Lipchitz constant of grad L(mu) - automatically calculated for metric=L2 - doesn’t exist for metric=L1 - must be supplied for custom callable metrics
callback – a function to be called after each iteration of optimization
- estimate(measurements, total=None, engine='MD', callback=None, options={})
Estimate a GraphicalModel from the given measurements
- Parameters
measurements – a list of (Q, y, noise, proj) tuples, where Q is the measurement matrix (a numpy array or scipy sparse matrix or LinearOperator) y is the noisy answers to the measurement queries noise is the standard deviation of the noise added to y proj defines the marginal used for this measurement set (a subset of attributes)
total – The total number of records (if known)
engine – the optimization algorithm to use, options include: MD - Mirror Descent with armijo line search RDA - Regularized Dual Averaging IG - Interior Gradient
callback – a function to be called after each iteration of optimization
options – solver specific options passed as a dictionary { param_name : param_value }
- Return model
A GraphicalModel that best matches the measurements taken
- fix_measurements(measurements)
- infer(measurements, total=None, engine='MD', callback=None, options={})
- interior_gradient(measurements, total, lipschitz=None, c=1, sigma=1, callback=None)
- Use the interior gradient algorithm to estimate the GraphicalModel
See https://epubs.siam.org/doi/pdf/10.1137/S1052623403427823 for more information
- Parameters
measurements – a list of (Q, y, noise, proj) tuples, where Q is the measurement matrix (a numpy array or scipy sparse matrix or LinearOperator) y is the noisy answers to the measurement queries noise is the standard deviation of the noise added to y proj defines the marginal used for this measurement set (a subset of attributes)
total – The total number of records (if known)
lipschitz – the Lipchitz constant of grad L(mu) - automatically calculated for metric=L2 - doesn’t exist for metric=L1 - must be supplied for custom callable metrics
sigma (c,) – parameters of the algorithm
callback – a function to be called after each iteration of optimization
- mirror_descent(measurements, total=None, stepsize=None, callback=None)
- Use the mirror descent algorithm to estimate the GraphicalModel
See https://web.iem.technion.ac.il/images/user-files/becka/papers/3.pdf
- Parameters
measurements – a list of (Q, y, noise, proj) tuples, where Q is the measurement matrix (a numpy array or scipy sparse matrix or LinearOperator) y is the noisy answers to the measurement queries noise is the standard deviation of the noise added to y proj defines the marginal used for this measurement set (a subset of attributes)
stepsize – The step size function for the optimization (None or scalar or function) if None, will perform line search at each iteration (requires smooth objective) if scalar, will use constant step size if function, will be called with the iteration number
total – The total number of records (if known)
callback – a function to be called after each iteration of optimization