probcomp / cgpm

Library of composable generative population models which serve as the modeling and inference backend of BayesDB.
Apache License 2.0
25 stars 11 forks source link

Improve naming of evidence in cgpm.simulate/cgpm.logpdf #221

Closed fsaad closed 6 years ago

fsaad commented 7 years ago

A cgpm has inputs and outputs; for simulate and logpdf, the evidence must contain all input variables, plus any output variables to act as constraints. We can improve clarity by by breaking up evidence into

def simulate(self, rowid, query, constraints, inputs, N)
def logpdf(self, rowid, query, constraints, inputs)
fsaad commented 7 years ago

Perhaps targets is a better term that query.

fsaad commented 6 years ago

The refactoring is happening 20171116-fsaad-cgpm-interface. Changes are backward incompatible. All CGPMs will be updated to adhere to the following specification:

def simulate(self, rowid, targets, constraints=None, inputs=None, N=None)
def logpdf(self, rowid, targets, constraints=None, inputs=None)
def incorporate(self, rowid, observation, inputs=None):

Remember to update maintained clients:

After the update, other clients in the wild, in particular ad-hoc notebooks, will be rather sad.

fsaad commented 6 years ago

This is turning out to be quite the effort.