From 7f1f639ee778eca96928312b0fc9b89f65637503 Mon Sep 17 00:00:00 2001 From: flatberg Date: Wed, 14 Mar 2007 16:31:25 +0000 Subject: [PATCH] Updates on metric, whitespace --- fluents/lib/cx_stats.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/fluents/lib/cx_stats.py b/fluents/lib/cx_stats.py index 078df5f..2ff65fc 100644 --- a/fluents/lib/cx_stats.py +++ b/fluents/lib/cx_stats.py @@ -96,10 +96,11 @@ def procrustes(A, B, strict=True, center=False, verbose=False): else: return b_rot -def expl_var_x(X, T): - """Returns explained variance of X.""" - # centered X,Y - exp_var_x = diag(dot(T.T, T))*100/(sum(X**2)) +def expl_var_x(Xc, T): + """Returns explained variance of X. + T should carry variance in length, Xc has zero col-mean. + """ + exp_var_x = diag(dot(T.T, T))*100/(sum(Xc**2)) return exp_var_x def expl_var_y(Y, T, Q): @@ -139,26 +140,28 @@ def pls_qvals(a, b, aopt=None, alpha=.3, n_false = zeros((n, n_iter), dtype='