[Scipy-svn] r2040 - trunk/Lib/sandbox/svm
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed Jul 5 11:08:08 EDT 2006
Author: fullung
Date: 2006-07-05 10:08:01 -0500 (Wed, 05 Jul 2006)
New Revision: 2040
Modified:
trunk/Lib/sandbox/svm/dataset.py
Log:
minor
Modified: trunk/Lib/sandbox/svm/dataset.py
===================================================================
--- trunk/Lib/sandbox/svm/dataset.py 2006-07-05 15:07:14 UTC (rev 2039)
+++ trunk/Lib/sandbox/svm/dataset.py 2006-07-05 15:08:01 UTC (rev 2040)
@@ -83,16 +83,3 @@
assert len(x) == len(N.unique(y[:-1]['index'])), \
'indexes must be unique'
return y
-
-def svm_node_dot(x, y):
- # associate node indexes with array indexes
- xidx = dict(zip(x['index'][:-1],range(0,len(x))))
- yidx = dict(zip(y['index'][:-1],range(0,len(y))))
- # indexes in either vector
- indexes = N.unique(N.hstack([x['index'],y['index']]))
- z = 0.
- for j in indexes:
- if j in xidx and j in yidx:
- # dot if index is present in both vectors
- z += x['value'][xidx[j]]*y['value'][yidx[j]]
- return z
More information about the Scipy-svn
mailing list