Typically used to construct discrete probability distributions with
certain conditional independence properties
|
|
__init__(self,
variables=(),
data=None,
domain=None,
new_domain_variables=None,
must_be_new=False,
check=False,
convert=False)
Initialise a Factor object |
source code
|
|
|
Float
|
|
|
Iterator
|
|
|
Int
|
|
|
|
|
|
Float
|
|
|
String
|
|
|
Factor
|
|
|
Factor
|
|
|
Factor
|
copy_rename(self,
oldnew,
copy_domain=False)
Return a 'copy' of a factor, but using different variables |
source code
|
|
|
List
|
|
Factor
|
data_restrict(self,
newvalues,
keep_class=False)
Alter a factor's data by effecting the restriction on
variables given by newvalues |
source code
|
|
Factor
|
data_extend(self,
newvalues,
keep_class=False)
Alter a factor's data by introducting new values to a variable
given by the dictionary newvalues |
source code
|
|
|
Factor
|
|
|
Boolean
|
differ(self,
other,
epsilon=0.0)
Whether there are corresponding values in self and
other differing by more than epsilon |
source code
|
|
Class of self
|
|
Class of self
|
|
|
|
gui_buttons(self,
gui,
data_indices,
tkc_variables)
Return a frame of buttons to a GUI for manipulating a factor |
source code
|
|
|
|
|
|
|
|
|
Frame or Tuple
|
gui_main(self,
parent,
edit=True,
varselect=False,
**config)
Return a Tkinter.Frame (and possibly other information)
for displaying and editing a factor |
source code
|
|
|
|
|
|
|
|
|
|
|
|
Tuple
|
|
Same as self
|
map(self,
fn,
keep_class=False)
Transform by an arity 1 function. |
source code
|
|
Class of self
|
|
|
CPT object
|
|
|
Factor
|
normalised(self)
Return a new factor with values proportional to those of self but
which sum to one |
source code
|
|
|
String
|
|
|
float
|
|
|
|
zero(self)
Set all values for a factor to zero |
source code
|
|
|
List
|
|
|
List
|
|
|
List
|
|
|
List
|
_data_extend(self,
variables,
togo,
newvalues,
data)
Alter data to effect the extension given by
newvalues |
source code
|
|
|
|
|
|
|
_gui_display_rows(self,
gui_main,
insts,
data_indices,
hrows)
Add rows of joint instantiations and corresponding data values for
each to a factor's main GUI |
source code
|
|
|
List
|
_gui_edit_rows(self,
gui_main,
insts,
data_indices,
hrows)
Add rows of joint instantiations and data entry widgets |
source code
|
|
|
|
_gui_header(self,
gui_main,
variables,
widget_type,
firstcol=0,
r=0,
span=1)
Add button or label headers to a factor's main GUI window |
source code
|
|
|
|
_gui_tkc_done(self,
win,
data_indices,
tkc_variables)
Change a factor's data to be that contained in a list of lists of
Tkinter.StringVar objects and destroy the window
win |
source code
|
|
|
|
_gui_tkc_get(self,
data_indices,
tkc_variables)
Change a factor's data to be that contained in a list of lists of
Tkinter.StringVar objects |
source code
|
|
|
|
_gui_tkc_set(self,
data_indices,
tkc_variables)
Set the data displayed by a list of lists of
Tkinter.StringVar objects to be the factor's data |
source code
|
|
|
Tuple
|
_header(self,
variables=None)
Return a format string and string of dashes suitable for creating a
header for rows of instantiations of variables |
source code
|
|
|
Factor
|
|
|
Inherited from Variables.SubDomain:
__add__,
__div__,
__iadd__,
__idiv__,
__imul__,
__isub__,
__mul__,
__rdiv__,
__rmul__,
__sub__,
inst2index,
insts,
insts_indices,
marginalise_onto,
sumout,
table_size,
uses_default_domain,
variables,
varvalues
Inherited from Variables.Domain:
add_domain_variable,
add_domain_variables,
add_domain_variables_from_rawdata,
change_domain_variable,
change_domain_variables,
common_domain,
known_variable,
numvals,
values
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__
|