bayesml package#

Subpackages#

Submodules#

bayesml.base module#

class bayesml.base.Generative#

Bases: object

Methods

load_h_params(filename)

Load the hyperparameters to h_params.

load_params(filename)

Load the parameters saved by save_params.

save_h_params(filename)

Save the hyperparameters using python pickle module.

save_params(filename)

Save the parameters using python pickle module.

gen_params

gen_sample

get_h_params

get_params

save_sample

set_h_params

set_params

visualize_model

abstract set_h_params()#
abstract get_h_params()#
save_h_params(filename)#

Save the hyperparameters using python pickle module.

They are saved as a python dictionary obtained by GenModel.get_h_params().

Parameters:
filenamestr

The filename (including a extention like .pkl) to which the hyperparameters are saved.

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
load_h_params(filename)#

Load the hyperparameters to h_params.

Parameters:
filenamestr

The filename (including a extention like .pkl) to be loaded. It must be a pickled python dictionary obtained by GenModel.save_h_params(), LearnModel.save_h0_params() or LearnModel.save_hn_params().

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
abstract gen_params()#
abstract set_params()#
abstract get_params()#
save_params(filename)#

Save the parameters using python pickle module.

They are saved as a pickled python dictionary obtained by GenModel.get_params().

Parameters:
filenamestr

The filename (including a extention like .pkl) to which the parameters are saved.

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
load_params(filename)#

Load the parameters saved by save_params.

Parameters:
filenamestr

The filename (including a extention like .pkl) to be loaded. It must be a pickled python dictionary obtained by GenModel.save_params().

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
abstract gen_sample()#
abstract save_sample()#
abstract visualize_model()#
class bayesml.base.Posterior#

Bases: object

Methods

load_h0_params(filename)

Load the hyperparameters to h0_params.

load_hn_params(filename)

Load the hyperparameters to hn_params.

overwrite_h0_params()

Overwrite the initial values of the hyperparameters of the posterior distribution by the learned values.

reset_hn_params()

Reset the hyperparameters of the posterior distribution to their initial values.

save_h0_params(filename)

Save the hyperparameters using python pickle module.

save_hn_params(filename)

Save the hyperparameters using python pickle module.

estimate_params

get_h0_params

get_hn_params

set_h0_params

set_hn_params

update_posterior

visualize_posterior

abstract set_h0_params()#
abstract get_h0_params()#
save_h0_params(filename)#

Save the hyperparameters using python pickle module.

They are saved as a pickled python dictionary obtained by LearnModel.get_h0_params().

Parameters:
filenamestr

The filename (including a extention like .pkl) to which the hyperparameters are saved.

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
load_h0_params(filename)#

Load the hyperparameters to h0_params.

Parameters:
filenamestr

The filename (including a extention like .pkl) to be loaded. It must be a pickled python dictionary obtained by GenModel.save_h_params(), LearnModel.save_h0_params() or LearnModel.save_hn_params().

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
abstract set_hn_params()#
abstract get_hn_params()#
save_hn_params(filename)#

Save the hyperparameters using python pickle module.

They are saved as a pickled python dictionary obtained by LearnModel.get_hn_params().

Parameters:
filenamestr

The filename (including a extention like .pkl) to which the hyperparameters are saved.

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
load_hn_params(filename)#

Load the hyperparameters to hn_params.

Parameters:
filenamestr

The filename (including a extention like .pkl) to be loaded. It must be a pickled python dictionary obtained by GenModel.save_h_params(), LearnModel.save_h0_params() or LearnModel.save_hn_params().

Warning

The pickle module is not secure. Only unpickle data you trust.

See also

pickle
reset_hn_params()#

Reset the hyperparameters of the posterior distribution to their initial values.

They are reset to the output of self.get_h0_params(). Note that the parameters of the predictive distribution are also calculated from them.

overwrite_h0_params()#

Overwrite the initial values of the hyperparameters of the posterior distribution by the learned values.

They are overwitten by the output of self.get_hn_params(). Note that the parameters of the predictive distribution are also calculated from them.

abstract update_posterior()#
abstract estimate_params()#
abstract visualize_posterior()#
class bayesml.base.PredictiveMixin#

Bases: object

Methods

calc_pred_dist

get_p_params

make_prediction

pred_and_update

abstract get_p_params()#
abstract calc_pred_dist()#
abstract make_prediction()#
abstract pred_and_update()#