1
$\begingroup$

If I have trained SVM model using the RBF kernel, how do i simulate the SVM output using the trained model and mathematical equations? How do I transform the test data?

I am trying to write a code for transforming the test data so that i can apply the trained SVM model on it.

$\endgroup$
1
$\begingroup$

The equation to predict a test instance $\mathbf{z}$ is as follows:

$$f(\mathbf{z}) = \sum_{i=1}^{n_{SV}} \alpha_i y_i \kappa(\mathbf{x}_i, \mathbf{z}) + \rho,$$ where $\alpha$ is the vector of dual weights, $\mathbf{y}$ is the vector of labels of support vectors, $\kappa(\cdot,\cdot)$ is the kernel function, $\mathbf{x}_i$ is the i'th support vector and $\rho$ is the model's bias.

This equation will yield the (signed) distance of $\mathbf{z}$ to the separating hyperplane, which you can then cutoff at a suitable value $\tau$ to obtain a binary label (by default $\tau=0$).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.