70b08e1d2e703b4e3d16da9aaa04706dd4413232,pypfopt/hierarchical_portfolio.py,HRPOpt,_get_quasi_diag,#,97

Before Change


        
        link = link.astype(int)
        // The new clusters formed
        c = np.arange(link.shape[0]) + link[-1, 3]
        root_id = c[-1]
        d = dict(list(zip(c, link[:, 0:2].tolist())))

        // Unpacks the linkage matrix recursively.
        def recursive_unlink(curr, d):
             Start this with curr = root integer 
            if curr in d:
                return [
                    node for parent in d[curr] for node in recursive_unlink(parent, d)
                ]
            else:
                return [curr]

        return recursive_unlink(root_id, d)

    @staticmethod
    def _raw_hrp_allocation(cov, ordered_tickers):
        

After Change


        :return: sorted list of indices
        :rtype: list
        
        return sch.to_tree(link, rd=False).pre_order()

    @staticmethod
    def _raw_hrp_allocation(cov, ordered_tickers):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 70b08e1d2e703b4e3d16da9aaa04706dd4413232
Time: 2020-05-01
Author: thomas.schmlezer@gmail.com
File Name: pypfopt/hierarchical_portfolio.py
Class Name: HRPOpt
Method Name: _get_quasi_diag


Project Name: librosa/librosa
Commit Name: 2ebc46e0b88697f7b70f3fa71c4afc7e959562a2
Time: 2013-03-23
Author: brm2132@columbia.edu
File Name: librosa/feature.py
Class Name:
Method Name: mel_frequencies


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 5e56bcc41a7d147c710e57c4c764651c7e148581
Time: 2020-04-30
Author: thomas.schmlezer@gmail.com
File Name: pypfopt/hierarchical_portfolio.py
Class Name: HRPOpt
Method Name: _get_quasi_diag