SVM, lab2 in the course Machine Learning at KTH
robban112 / ml1-lab2 Goto Github PK
View Code? Open in Web Editor NEWSVM, lab2 in the course Machine Learning at KTH
SVM, lab2 in the course Machine Learning at KTH
Define a function which implements equation (4). This function will only
receive the vector ⃗α as a parameter. You can use global variables for other
things that the function needs (t and K values).
Implement the indicator function (equation 6) which uses the non-zero
αi
’s together with their ⃗xi
’s and ti
’s to classify new points
In order to see your data, you can use the plot functions from matplotlib
Make the call to minimize as indicated in the code sample above.
This function should implement the equality constraint of (10). Also here,
you can make use of numpy.dot to be efficient.
If the data is well separated, only a few of the α values will be non-zero.
Since we are dealing with floating point values, however, those that are
supposed to be zero will in reality only be approximately zero. Therefore,
use a low threshold (10−5
should work fine) to determine which are to be
regarded as non-zero.
You need to save the non-zero αi
’s along with the corresponding data
points (⃗xi) and target values (ti) in a separate data structure, for instance
a list.
Note that you must use a point on the margin. This corresponds to a
point with an α-value larger than zero, but less than C (if slack is used).
Implement the two non-linear kernels. You should be able to classify
very hard data sets with these.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.