fb4b9023f9ec516648d58b4ba2ecd8e241e21618,pyglmnet/utils.py,,tikhonov_from_prior,#Any#Any#,73

Before Change


    Given a prior covariance matrix, returns a Tikhonov matrix
    [U, S, V] = np.linalg.svd(PriorCov, full_matrices=False)
    Tau = np.dot(np.diag(1. / np.sqrt(S)), U)
    Tau = 1. / np.sqrt(np.float(n_samples)) * Tau / Tau.max()
    return Tau

After Change


    Given a prior covariance matrix, returns a Tikhonov matrix
    [U, S, V] = np.linalg.svd(PriorCov, full_matrices=False)

    S_ratio = S / S.max()
    threshold = 0.0001

    nonzero_indices = np.where(S_ratio > threshold)[0]
    zero_indices = np.where(S_ratio <= threshold)[0]

    S_inv = copy(np.sqrt(S))
    S_inv[zero_indices] = threshold
    S_inv[nonzero_indices] = 1. / S_inv[nonzero_indices]

    Tau = np.dot(np.diag(S_inv), V)
    n_features = Tau.shape[0]
    Tau = 1. / n_features * Tau
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: glm-tools/pyglmnet
Commit Name: fb4b9023f9ec516648d58b4ba2ecd8e241e21618
Time: 2016-11-16
Author: pavan.ramkumar@gmail.com
File Name: pyglmnet/utils.py
Class Name:
Method Name: tikhonov_from_prior


Project Name: nipy/dipy
Commit Name: 68963166e5fe4e23655279b653f7cc6ed6d0d0b3
Time: 2015-09-14
Author: mauro.zucchelli88@gmail.com
File Name: dipy/reconst/mapmri.py
Class Name: MapmriModel
Method Name: fit


Project Name: aertslab/pySCENIC
Commit Name: 4fa15dade9f2174a602a28682d2f1013dba3ef78
Time: 2018-05-09
Author: vandesande.bram@gmail.com
File Name: src/pyscenic/binarization.py
Class Name:
Method Name: _derive_threshold