26 #include "posterior_empirical.hpp" 32 PosteriorModel* PosteriorModel::create(
size_t dim, Parameters params, randEngine& eng)
34 switch (params.l_type)
36 case L_FIXED:
return new PosteriorFixed(dim,params,eng);
37 case L_EMPIRICAL:
return new EmpiricalBayes(dim,params,eng);
39 case L_MCMC:
return new MCMCModel(dim,params,eng);
42 throw std::invalid_argument(
"Learning type not supported");
46 PosteriorModel::PosteriorModel(
size_t dim,
Parameters parameters,
55 void PosteriorModel::setSamples(
const matrixd &x,
const vectord &y)
57 mData.setSamples(x,y);
61 void PosteriorModel::setSamples(
const matrixd &x)
67 void PosteriorModel::setSamples(
const vectord &y)
73 void PosteriorModel::setSample(
const vectord &x,
double y)
75 matrixd xx(1,x.size()); vectord yy(1);
76 row(xx,0) = x; yy(0) = y;
77 mData.setSamples(xx,yy);
81 void PosteriorModel::addSample(
const vectord &x,
double y)
82 {
mData.addSample(x,y); mMean.addNewPoint(x); };
Posterior distribution on GPs based on MCMC over kernel parameters.
Namespace of the library interface.
Parameters mParameters
Configuration parameters.
size_t mDims
Number of dimensions.
Posterior model based on fixed kernel parameters.
Abstract interface for posterior model/criteria.
Modules and helper macros for logging.
Dataset mData
Dataset (x-> inputs, y-> labels/output)
virtual ~PosteriorModel()
Default destructor.