Changeset 599 for mds-and-trees/mds_plot.py
- Timestamp:
- 08/25/16 17:48:45 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mds-and-trees/mds_plot.py
r598 r599 77 77 def compute_mds(distance_matrix, dim): 78 78 embed, evals = cmdscale(distance_matrix) 79 variances = compute_variances(embed)79 variances = [np.var(embed[:,i]) for i in range(len(embed[0]))] 80 80 embed = np.asarray([embed[:,i] for i in range(dim)]).T 81 81 … … 85 85 86 86 return embed 87 88 89 def compute_variances(embed):90 variances = []91 for i in range(len(embed[0])):92 variances.append(np.var(embed[:,i]))93 return variances94 87 95 88
Note: See TracChangeset
for help on using the changeset viewer.