#1




RBF using a library package?
Hi all,
I have written some code in Octave to simulate the regular RBF model for questions 15  19 on the final. However, mindful of the fact that I don't usually write bugfree code the first time I was wondering if anyone knew of a library/package like libsvm for regular RBF's that I could use to validate the results I'm getting. Thanks for any pointers. Samir PS  On an unrelated note, these simulations are bringing my 2yearold Mac down to its knees...vectorized code or not. 
#2




Re: RBF using a library package?
Quote:
I've learned a huge amount about constrained optimization and SVM by rolling my own code (I don't learn anything unless I do it hands on) but, truth be told, there aren't any simple test data sets out there that I have found. I just use a simple 2D triangular test pattern ( (1,1) (0,1) (1,1) ) with a constant hypothesis at Y=0 as a baseline confirmation that the kernel classification process is correct. I had the impression from earlier discussions that SVMLIB has various RBF options. There is a web site featuring a C# port of SVMLIB and the guy at that site had some test files he brought over from the SVMLIB site. There are many domainspecific SVMLIB data files at the SVMLIB site also. 
#3




Re: RBF using a library package?
I developed the code for these questions in R. For the SVM with RBF I call svmlib through an interface with R (in concrete, I use the library e1071, strange name...). This lib has options for working with the RBF kernel.
For the "regular" RBF, I implement stepbystep Lloyd´s algorithm, assemble the matrix (RBF lecture 16, slide 14) and calculate the trained w. I use the same N=100 points with both algorithms, obviously. And classify with both methods (SVM and "regular"). Regarding time, R it's not too bad. Running a batch of 1000 sets of 100 points takes me perhaps 2 minutes or less (my home desktop has a low end AMD A8 3850 processor, with 8 GB RAM, nothing fancy; it's quadcore but only one core is used by R). I use 200 random points for testing (the same for all the 1000 batches with 100 points... random is random...). Regarding correctness, I verified the code with some care, (about 100 lines in R, with some amount of vectorization, for the implementation of both SVM and regular RBF) and the results obtained for Ein, Eout, etc... seem reasonable. So, I cross my fingers... I didn't look for a library implementing "regular" RBF. Perhaps there are some out there... but it seems to me that it is not a very popular approach to classification ... Last edited by TonySuarez; 09122012 at 03:25 PM. Reason: Remove edges in text. 
#4




Re: RBF using a library package?
Python with numpy can handle the creation of the array with distances (between centers/points) as well as the "fi" matrix with exponents (basic RBF) with very few operations (all heavy work done under the hood). Basically almost all the matrix operations without loops

#5




Re: RBF using a library package?
Quote:
I was wondering if you will be able to get your Octave implementation of SVM with RBF working. For some weird reason my Octave implementation is not able to classify a linearly separable data which libsvm is able to do. 
#6




Re: RBF using a library package?
Quote:
For SVM with RBF, I used libsvm. Samir 
#7




Re: RBF using a library package?
Quote:
but I don't know how to use it. 
#8




Re: RBF using a library package?
Some part of the implementation can leverage existing functions in R
kmeans function in R implements Lloyd's algorithm for RBF. It also has an option for specifying the initial starting points (or, we could let it choose randomly). It returns the centers. We still need to find the weights and do the classification. 
#9




Re: RBF using a library package?
Quote:
BTW, I think implementing the Lloyd algorithm is not that difficult to debug. 
Thread Tools  
Display Modes  

