In this section, we will run an SVM model and see how it works.
First of all, get your dataset just the way you did for neural networks, partition the dataset into a training and testing dataset, and create a scenario such as this:
Let's see how to run SVMs:
- Go to the Modeling palette and connect the partition node to SVM:
- Go to the Expert tab and select the Expert option in Mode. Remember, whenever you run an SVM model, you must always run it in Expert mode because this is a model that requires constant changes on the default values based on the status of your model. The Expert mode will enable us to change the values easily when required:
Let's discuss these options in detail:
-
- You can tick the Append all probabilities box when you have categorical outcomes. But, for now, let's keep it on default.
- The stopping criteria can also be changed, though you don't need to modify it that often.
- The regularization parameter is set to 10 by default, and you can select any values from 2 to 10. The higher the value of the regularization parameter, the more overfitting is done on your model and it is more likely to get better results on the training dataset, but on the testing dataset, the results could drop off. Hence, let's change the regularization parameter value to 5, because it is a middle value that will give us a consistent model that works well for both the training as well as the testing dataset. And if you get a consistent model at value 5, you can increase this to 7, to overfit the model just a little better, to get slightly better results. If you don't get consistent results at a value set to 5, then we can reduce this to 3 or so to try to overfit less. Hence, we will need to modify the regularization parameter based on our results.
- The regression precision parameter or epsilon is a pretty low value that is meant for errors. We want our errors to be lower than the value that is set in this field. This parameter only works when there is a continuous outcome field, which is not the case for our dataset.
- There are four types of kernel transformations that we have seen; linear is the simplest one, and we will start off with it. We can first test the model with a linear transformation, and if it does well, we can increase the complexity by selecting any other kind of transformation.
Here is a summary of the values that we have selected for the Expert tab:
- Click on the Analyze tab. Let's see what this tab includes:
-
- We can calculate the propensity scores for this model; we will talk about this in later chapters.
- The predictor importance can also be calculated. Here, for SVMs, this is not checked by default. The reason being that SVMs take a fairly long time to build the model if you select this option to calculate the predictor importance. You will run this model multiple times and change a lot of the parameters in the meantime. And finally when you find your best solution, or your ideal model, you will rerun the model, and that will be the time when you can check the option of calculating predictor importance. This will save a lot of time.
- Click on Run. You will see a model built like this:
- Now, connect the generated model to the table to see the results:
- Click on Table and then click Run. If you scroll to the end, you will find predictions under $S-Status and $SP-Status:
You can also see that we have got results for both the training and testing datasets, even though the model was built on the testing dataset.
- You can now close the table's window, and click on the model, Status, to check the summary and model settings. Click on OK.
The model is currently like a black box. We don't know how we got the results and how it predicted the values. Let's find out.