This commit is contained in:
2007-07-20 12:32:54 +00:00
parent 7ee7aa968a
commit 98f53d3448
4 changed files with 33 additions and 14 deletions

View File

@@ -32,7 +32,7 @@ print "SAM done"
qq = rpy.r('qobj<-qvalue(sam.out@p.value)')
qvals = asarray(qq['qvalues'])
# cut off
co = 0.001
co = 0.1
index = where(qvals<0.01)[0]
# Subset data
@@ -51,7 +51,7 @@ terms = list(terms)
rpy.r.library("GOSim")
# Go-term similarity matrix
methods = ("JiangConrath","Resnik","Lin","CoutoEnriched","CoutoJiangConrath","CoutoResnik","CoutoLin")
meth = methods[0]
meth = methods[2]
print "Term-term similarity matrix (method = %s)" %meth
if meth=="CoutoEnriched":
rpy.r('setEnrichmentFactors(alpha=0.1,beta=0.5)')
@@ -100,7 +100,6 @@ T, W, P, Q, U, L, K, B, b0, evx, evy, evz = nipals_lpls(Xr,Y,Z, a_max, alpha)
dx,Rx,ssx= correlation_loadings(Xr, T, P)
dx,Ry,ssx= correlation_loadings(Y, T, Q)
cadx,Rz,ssx= correlation_loadings(Z.T, K, L)
# Prediction error
rmsep , yhat, class_error = cv_lpls(Xr, Y, Z, a_max, alpha=alpha)
@@ -112,11 +111,19 @@ tsqz = cx_stats.hotelling(Wz,L[:,:aopt])
## plots ##
figure(1) #rmsep
#bar()
bar_w = .2
bar_col = 'rgb'*5
m = Y.shape[1]
for a in range(m):
bar(arange(a_max)+a*bar_w+.1, rmsep[:,a], width=bar_w, color=bar_col[a])
ylim([rmsep.min()-.05, rmsep.max()+.05])
figure(2) # Hypoid correlations
title('RMSEP')
plot_corrloads(Rz, pc1=0, pc2=1, s=tsqz/10.0, c='b', zorder=5, expvar=evz, ax=None)
ax = gca()
plot_corrloads(Ry, pc1=0, pc2=1, s=150, c='g', zorder=5, expvar=evy, ax=ax)
ylabels = DY.get_identifiers('_cat', sorted=True)
plot_corrloads(Ry, pc1=0, pc2=1, s=150, c='g', zorder=5, expvar=evy, ax=ax,labels=ylabels)
figure(3)
subplot(221)