4e70cb5fc9a9494e866ccd7d2e1a9046091b6337,astroML/density_estimation/gauss_mixture.py,GaussianMixture1D,__init__,#GaussianMixture1D#Any#Any#Any#,18

Before Change


    def __init__(self, means=0, sigmas=1, weights=1):
        data = np.array([t for t in np.broadcast(means, sigmas, weights)])

        precisions = [1/s**2 for s in sigmas]
        self._gmm = GaussianMixture(data.shape[0],
                                    weights_init=data[:, 2] / data[:, 2].sum(),
                                    means_init=data[:, :1],
                                    covariance_type="spherical",
                                    precisions_init=precisions)
        self._gmm.fit(data[:, :1])  // GaussianMixture requires "fit" be called once
        self._gmm.fit = None  // disable fit method for safety

    def sample(self, size):

After Change


        self._gmm.means_ = means.reshape(-1, 1)
        self._gmm.covariances_ = sigmas ** 2

        self._gmm.precisions_cholesky_ = 1 / np.sqrt(self._gmm.covariances_)

        self._gmm.fit = None  // disable fit method for safety

    def sample(self, size):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: astroML/astroML
Commit Name: 4e70cb5fc9a9494e866ccd7d2e1a9046091b6337
Time: 2018-11-16
Author: bsipocz@gmail.com
File Name: astroML/density_estimation/gauss_mixture.py
Class Name: GaussianMixture1D
Method Name: __init__


Project Name: jindongwang/transferlearning
Commit Name: e0174ec990ae2eebad348a5bdbc3f411c1c7501a
Time: 2019-04-20
Author: jindongwang@outlook.com
File Name: code/traditional/BDA/BDA.py
Class Name: BDA
Method Name: fit_predict


Project Name: bashtage/linearmodels
Commit Name: 34e7e918bd4fc09f643e8bb448e875a9bcb7e841
Time: 2017-03-29
Author: kevin.k.sheppard@gmail.com
File Name: experiment.py
Class Name:
Method Name: