SimPEG.utils.GaussianMixtureWithPrior#

class SimPEG.utils.GaussianMixtureWithPrior(gmmref, kappa=0.0, nu=0.0, zeta=0.0, prior_type='semi', update_covariances=True, fixed_membership=None, init_params='kmeans', max_iter=100, means_init=None, n_init=10, precisions_init=None, random_state=None, reg_covar=1e-06, tol=0.001, verbose=0, verbose_interval=10, warm_start=False, weights_init=None)[source]#

Bases: WeightedGaussianMixture

This class built upon the WeightedGaussianMixture, which itself built upon from the mixture.gaussian_mixture.GaussianMixture class from Scikit-Learn.

In addition to weights samples/observations by the cells volume of the mesh, this class uses a posterior approach to fit the GMM parameters. This means it takes prior parameters, passed through WeightedGaussianMixture gmmref. The prior distribution for each parameters (proportions, means, covariances) is defined through a conjugate or semi-conjugate approach (prior_type), to the choice of the user. See Astic & Oldenburg 2019: A framework for petrophysically and geologically guided geophysical inversion (https://doi.org/10.1093/gji/ggz389) for more information.

Disclaimer: this class built upon the GaussianMixture class from Scikit-Learn. New functionalitie are added, as well as modifications to existing functions, to serve the purposes pursued within SimPEG. This use is allowed by the Scikit-Learn licensing (BSD-3-Clause License) and we are grateful for their contributions to the open-source community.

Addtional parameters to provide, compared to WeightedGaussianMixture:

Parameters:
kappanumpy.ndarray

strength of the confidence in the prior means

nunumpy.ndarry

strength of the confidence in the prior covariances

zetanumpy.ndarry

strength of the confidence in the prior proportions

prior_typestr

Choose from one of the following:

  • “semi”: semi-conjugate prior, the means and covariances priors are indepedent

  • “full”: conjugate prior, the means and covariances priors are inter-depedent

update_covariancesbool

Choose from two options:

  • True: semi or conjugate prior by averaging the covariances

  • False: alternative (not conjugate) prior: average the precisions instead

fixed_membershipnumpy.ndarray of int, optional

A 2d numpy.ndarray to fix the membership to a chosen lithology of particular cells. The first column contains the numeric index of the cells, the second column the respective lithology index. Shape is (index of the fixed cell, lithology index) fixed_membership:

Methods

aic(X)

Akaike information criterion for the current model on the input X.

bic(X)

Bayesian information criterion for the current model on the input X.

compute_clusters_covariances()

Compute the precisions matrices and their Cholesky decomposition.

compute_clusters_precisions()

Compute and set the precisions matrices and their Cholesky decomposition.

fit(X[, y, debug])

Estimate model parameters with the EM algorithm.

fit_predict(X[, y, debug])

Estimate model parameters using X and predict the labels for X.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

order_cluster([outputindex])

Order cluster

order_clusters_GM_weight([outputindex])

Order clusters by decreasing weights

plot_pdf([ax, flag2d, x_component, ...])

Utils to plot the marginal PDFs of a GMM, either in 1D or 2D (1 or 2 physical properties at the time).

predict(X)

Predict the labels for the data samples in X using trained model.

predict_proba(X)

Evaluate the components' density for each sample.

sample([n_samples])

Generate random samples from the fitted Gaussian distribution.

score(X[, y])

Compute the per-sample average log-likelihood

score_samples(X)

Compute the log-likelihood of each sample.

score_samples_with_sensW(X, sensW)

Compute the weighted log probabilities for each sample.

set_fit_request(*[, debug])

Request metadata passed to the fit method.

set_params(**params)

Set the parameters of this estimator.

update_gmm_with_priors([debug])

Update GMM with priors

Galleries and Tutorials using SimPEG.utils.GaussianMixtureWithPrior#

Joint PGI of Gravity + Magnetic on an Octree mesh without petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh without petrophysical information