Class exp_max_gmm (o2scl)¶
-
template<class data_mat_t = const_matrix_view_table<>, class gauss_vec_t = boost::numeric::ublas::vector<double>, class gauss_mat_t = boost::numeric::ublas::matrix<double>>
class exp_max_gmm¶ Expectation maximization for a Gaussian mixture model.
(very experimental and not working yet)
Compute the Gaussian mixture model
-
size_t np¶
The number of points.
-
size_t nd_in¶
The number of dimensions of the inputs.
-
data_mat_t data¶
The copy of the data.
-
bool data_set¶
True if the data has been specified.
-
internal_mat_t resps¶
The responsibilities.
-
inline int calc_auto(size_t n_gauss)¶
Compute the Gaussian mixture model using random guesses based on the data.
Public Functions
-
inline const prob_dens_mdim_gmm &get_gmm()¶
Get the underlying Gaussian mixture probability density.
-
inline exp_max_gmm()¶
-
inline void set_data(size_t n_in, size_t n_points, data_mat_t &dat)¶
Initialize the data The object
vecs
should be a matrix with a first index of sizen_in
and a second index of sizen_points
. It may have be any type which allows the use ofoperator(,)
andstd::swap
.
-
inline void get_data(size_t &n_in, size_t &n_points, data_mat_t &dat)¶
Get the data used for interpolation.
Public Members
-
bool err_nonconv¶
If true, call the error handler if the calculation fails.
-
int verbose¶
Verbosity parameter (default 0)
-
int ntrial¶
Maximum number of iterations.
-
double tol_rel¶
Relative tolerance (default \( 10^[-6} \))
-
double tol_abs¶
Absolute tolerance (default \( 0 \))
Protected Types
-
typedef boost::numeric::ublas::vector<double> internal_vec_t¶
-
typedef boost::numeric::ublas::matrix<double> internal_mat_t¶
Protected Functions
-
inline int calc_internal(size_t n_gauss = 1)¶
Use the expectation-maximization algorithm to optimize the Gaussian mixture.
Protected Attributes
-
prob_dens_mdim_gmm<gauss_vec_t, gauss_mat_t> pdmg¶
The underlying Gaussian mixture probability density.
-
size_t np¶