d95326a2557c585d0337b162c0b55b2426880632,skbio/stats/ordination/_redundancy_analysis.py,,_scores,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,170

Before Change


    // corr(X, F))
    return OrdinationResults("RDA", "Redundancy Analysis",
                             eigvals=eigvals,
                             proportion_explained=eigvals / eigvals.sum(),
                             features=feature_scores,
                             samples=sample_scores,
                             biplot_scores=biplot_scores,

After Change


    // According to the vegan-FAQ.pdf, the scaling factor for scores
    // is (notice that L&L 1998 says in p. 586 that such scaling
    // doesn"t affect the interpretation of a biplot):
    pc_ids = ["RDA%d"%(i+1) for i in range(len(eigenvalues))]
    eigvals = pd.Series(eigenvalues, index=pc_ids)
    const = np.sum(eigenvalues**2)**0.25
    if scaling == 1:
        scaling_factor = const
    elif scaling == 2:
        scaling_factor = eigenvalues / const
    feature_scores = np.hstack((U, U_res)) * scaling_factor
    sample_scores = np.hstack((F, F_res)) / scaling_factor

    feature_scores = pd.DataFrame(feature_scores,
                                  index=feature_ids,
                                  columns=pc_ids)
    sample_scores = pd.DataFrame(sample_scores,
                                 index=sample_ids,
                                 columns=pc_ids)
    // TODO not yet used/displayed
    sample_constraints = pd.DataFrame(np.hstack((Z, F_res)) / scaling_factor,
                                      index=sample_ids,
                                      columns=pc_ids)
    // Vegan seems to compute them as corr(X[:, :rank_X],
    // u) but I don"t think that"s a good idea. In fact, if
    // you take the example shown in Figure 11.3 in L&L 1998 you
    // can see that there"s an arrow for each of the 4
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: biocore/scikit-bio
Commit Name: d95326a2557c585d0337b162c0b55b2426880632
Time: 2015-05-14
Author: jamietmorton@gmail.com
File Name: skbio/stats/ordination/_redundancy_analysis.py
Class Name:
Method Name: _scores


Project Name: commonsense/conceptnet5
Commit Name: 938e9716faa50db5695d937cae0b30d2cdbfd07c
Time: 2017-09-11
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/transforms.py
Class Name:
Method Name: l1_normalize_columns


Project Name: pmorissette/bt
Commit Name: 01cd6dab06e42a63a4240cd57eef9331179cf091
Time: 2014-05-06
Author: pm@rdacap.com
File Name: bt/backtest.py
Class Name: Backtest
Method Name: security_weights