Homework1 Question3.3 & 3.5

56 views
Skip to first unread message

Craig (Mingtao) Zhang

unread,
Feb 4, 2013, 8:13:11 PM2/4/13
to 10-701-spri...@googlegroups.com
As mentioned in 3.3, I used Matlab's sorting function to implement KNN. It may not be efficient enough to complete 3.5's experiment k = 1:2:49.

For 14 features, 2000 instances, 10-folds validation, k = 9, the program has been running for 30 min (not finished yet :( ).

Could I reduce 2000 instances to another number to complete 3.5 's experiment k = 1:2:49?

Thanks in advance!

Best Regards,
Craig

Mu Li

unread,
Feb 4, 2013, 9:56:56 PM2/4/13
to Craig (Mingtao) Zhang, 10-701-spri...@googlegroups.com
Hi Craig,

There are several ways to improve your matlab codes efficiency. Some basic rules include using vector operations instead of for-loop and pre-allocate the memory. See http://web.cecs.pdx.edu/~gerry/MATLAB/programming/performance.html


Best,
Mu  


--
http://alex.smola.org/teaching/cmu2013-10-701 (course website)
http://www.youtube.com/playlist?list=PLZSO_6-bSqHQmMKwWVvYwKreGu4b4kMU9 (YouTube playlist)
---
You received this message because you are subscribed to the Google Groups "10-701 Spring 2013 CMU" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 10-701-spring-201...@googlegroups.com.
To post to this group, send email to 10-701-spri...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Craig (Mingtao) Zhang

unread,
Feb 4, 2013, 11:23:51 PM2/4/13
to 10-701-spri...@googlegroups.com
Thank you a lot! 

That's really helpful!

Craig
Reply all
Reply to author
Forward
0 new messages