Matlab solutions?
So far for all the programming exercises, I have used C (ObjectiveC, to be exact) to complete them. I'm afraid that for Homework 7, I'll have to use MatLab, and I really don't know how to program/use it properly. I think I'd rather go that way than find/learn to use a quadratic programming package for C, at least on short notice like for homework.
HW7 looks like it has the same kind of setup requirements (generate N random numbers from [1,1], pick a random line to divide them. etc.) as many previous exercises. I was wondering if someone who has used Matlab to complete the earlier homework problems that are similar to the ones in HW7 could post their solutions? I'm pretty sure I could figure out how to adapt it to HW7 if I had some examples to start with. Thanks! 
Re: Matlab solutions?
I'm on the fence with this assignment. I purchased a Big Package last week, and I used it for the homework. It was my first departure from C for this course.
On this assignment, C would be more convenient for me, in the sense that I have other places I might plug my SVM into. I also think performance would be a lot better. I'm thinking that the GNU Scientific Library should have something we could use, which would keep us in the familiar realm of C. I'll update this post as I find more out, but for the time being I have to feed several people. UPDATE: GNU GSL doesn't have anything. Elsewhere, I'm not coming up with a practical package, and I *still* have to feed several people. Ciau! UPDATE 2: (food's on the stove) A little insight with this problem lends itself to nonQP means of finding the support vectors. It won't generalize into real life, but you can at least answer the questions. It's not the route I plan to follow, but it's easily reachable. 
Re: Matlab solutions?
kurts, I am no expert in programming, and I only started to learn Octave (I understand it is fully compatible with Matlab) less than two months ago. My programs are not optimal and not elegant. But here is my code, if you want it.
The functions: Code:
Code:
a = unifrnd(1,1,2,2); 
Re: Matlab solutions?
There's definitely something to be said for getting out of C. The first half of homework 7 took all of 15 lines of code using a Big Package.

Re: Matlab solutions?
Quote:
I eventually got it to run in Octave, and I even played around learning matrix and vector expressions, and got the linear regression method working on the same setup. I think I'm ready to tackle HW7! 
Re: Matlab solutions?
A thought just occured to me; If you want to stay in C/C++ land, OpenCV has an SVM implementation you might be able to use.

All times are GMT 7. The time now is 10:48 PM. 
Powered by vBulletin® Version 3.8.3
Copyright ©2000  2020, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. AbuMostafa, Malik MagdonIsmail, and HsuanTien Lin, and participants in the Learning From Data MOOC by Yaser S. AbuMostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.