Thursday, October 11, 2007

 

Programming Collective Intelligence - Viewing Data in Two Dimensions

An example of taking data in multiple dimensions and "scaling" it to two dimensions, where the distances between data points is proportional to the multi-dimensional distance. Again, this one is basically an imperative rewrite. I hope to be able to exploit more of Lisp's power in the next chapter, which includes some neural networks. The big revelation from this, if anyone says Lisp is unreadable, I'd show them

fakedist[i][j] = sqrt(sum([pow(loc[i][x] - loc[j][x], 2)
for x in range(len(loc[i]))]))

I replaced clusters.lisp, new code is in it.



Zooming in,


This page is powered by Blogger. Isn't yours?