I am teaching a class about the SVD (Singular Value Decomposition) of a matrix this week. I was inspired by a nice article of Carla Martin and Mason Porter, "The extraordinary SVD", to compute the SVD of the voting record of the 112th Congress (House of Representatives) to show to my class.
If you're interested in how this is done, here is the Sage code I used as a Sage worksheet.
Here is the projection onto the first two singular vectors:
Subscribe to:
Post Comments (Atom)
3 comments:
Apparently something is missing because evaluation in the # parse the data section fails with "d" unknown.
I'd like to play around with this code but in it there are references to several objects defined elsewhere. Any chance you could provide the full code?
Awesome!
Post a Comment