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

Before Change


        weight of component distributions (default = 1)
    
    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

After Change



        self._gmm.weights_ = weights / weights.sum()
        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: 8

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: QUANTAXIS/QUANTAXIS
Commit Name: 847966ed99259c6e82e2dbd953162e53f34e5da8
Time: 2017-04-29
Author: yutiansut@qq.com
File Name: QUANTAXIS/QABacktest/QAAnalysis.py
Class Name:
Method Name: QA_backtest_calc_volatility


Project Name: scikit-image/scikit-image
Commit Name: dd17b42f452bc156f55e3400f8ebc84d58761e65
Time: 2019-12-30
Author: gregory.lee@cchmc.org
File Name: skimage/filters/_window.py
Class Name:
Method Name: window