Question: I am very new to the field of machine learning and am basically teaching myself, I was reading a couple of papers related to Support Vector Machines as that is what I am planning to use in solving my text classification problem. I could not however make much headway into any of the papers as I kept getting stuck on the concept of kernels and kernel methods and mapping the data into higher dimensions. 

I know this is asking a lot because I have seen entire textbooks written about kernel methods and kernels but could somebody take a shot at posting an explanation about kernels and kernel methods starting from a very basic level because all the explanations I have seen so far assume a certain amount of prior knowledge about the field.

Also I am kind of unclear about the kernel function and how it is used to map "the data into higher dimensional spaces" if someone could please clarify these concepts for me or point me to a basic resource that explains these things from the basic level, I would be very grateful.

Thanks in advance.

Answer: 
It's difficult to distill complex mathematics to a simple level, but this example helps I believe.

I apologize, it appears that Stack Overflow does not have support for math markup like [Computional Science](http://scicomp.stackexchange.com) does, so you'll have to bear with some crappy text based equations. Vector **x** = [*x1*, *x2*], so *x1* is the first component of the vector **x**.

For simplicity, lets imagine you have just two attributes for each training example, so your data is two-dimensional. You have developed a mapping function to map these two attributes into a higher dimension of three attributes. Your mapping function is as follows:

Φ(**x**) = [*x12*, *x22*, *x1* \* *x2*]

In the SVM Lagrangian formula:

![Lagrangian SVM Formula](https://i.stack.imgur.com/jS5Tr.png)

Each training example appears as an inner product with another training example (the above image shows this in the first equation). If you want to use your mapping function, you would plug it in for each training example.

If you do it this way of course you will have to calculate Φ(**x**) for each training example explicitly, then calculate the inner product of the two vectors in your higher dimensional space. If we do this out for two vectors **x** and **y**, we would have:

Φ(**x**) \* Φ(**y**) = [*x12*, *x22*, *x1* \* *x2*] \* [*y12*, *y22*, *y1* \* *y2*] = *x12* \* *y12* + *x22* \* *y22* + *x1* \* *x2* \* *y1* \* *y2*

Imagine instead you used the polynomial kernel *K*(**x** , **y**) = (**x** \* **y**)*d* with the degree of two, you would have:

*K*(**x**, **y**) = (*x1* \* *y1* + *x2* \* *y2*)2 = *x12* \* *y12* + *x22* \* *y22* + *x1* \* *x2* \* *y1* \* *y2*

The kernel function allowed you to avoid calculating the higher dimensional space before calculating the inner product, but still resulted in the inner product of two vectors in that higher dimensional space. In this case we kept the example simple so we could do it out explicitly, but [Mercer's Theorem](http://en.wikipedia.org/wiki/Mercer%27s_theorem) shows that we can prove this is true for other functions without having to know the explicit mapping, as long as the function obeys [Mercer's condition](http://www.svms.org/mercer/). You can see how the kernel parameter *d* affects the mapping significantly, *d = 3* would result in a completely different mapping, so changing the kernel parameters is modifying the higher-dimensional space.

Since the higher-dimensional mapping is never used explicitly, only rather as a way to choose our optimal alpha's, we don't really need to know what it is, we can take advantage of it without having to calculate it.
Since your application is text classification you don't need to bother with non-linear kernels. Text already "lives" in a high dimensional (and sparse) space and there is no need to go into a space of even higher dimensionality. 

You can safely try only Linear kernel.

Read the classic Joachims thesis and papers, author of SVMLight, on text classification to get a deeper understanding of this.