Icon

SVM_​Solution

SVM Exercise with Parameter Optimization

Exercise for SVM. Classification of 2D silhouette attributes with SVM classifier. Oprimize the c parameter for the margin hardness with parameter optimization loop

Exercise: SVMIn this exercise we train a classifier to predict the vehicle type. The attributes are numerical, and have been normalized to [0,1] scale. We use asupport vector machine (SVM) as a classification model. We explore an optimal parameter for the SVM setting.1) Read the data (vehicle.table) with a Table Reader node. This dataset contains 2D attributes of silhouettes created by different types of vehicles. The last column is the target column, describing the 4 types of vehicles (bus, Opel, Saab, and van)2) Split the data with a Partitioning node into the training (80%) and testing (20%) data sets. - Use stratified sampling to preserve the target distribution on Col18.3) Train an SVM classifier with the SVM Learner node. Use the RBF kernel with sigma=0.5.4) Use the trained model to predict the vehicle type with the SVM Predictor node5) Assess the classification outcome by examining the confusion matrix with the Scorer node.6) Determine the optimal margin hardness by varying the Overlapping penalty in the SVM learner node with a Parameter Optimization Loop. - For the Parameter Optimization Loop Start, create a parameter “c” ranging from 1 to 25, with the step size of 2. - Use the parameter c to control “c_parameter” in the SVM Learner flow variable. - Connect the flow variable output from the Scorer node to the Parameter Optimization Loop End. Maximize the Accuracy. PartitionTraining (80%)Testing (20%)Train modelApply modelLoop overOverlapping penaltyMaximize accuracyReadingvehicle.tabledata Partitioning SVM Learner SVM Predictor Scorer Parameter OptimizationLoop Start ParameterOptimization Loop End Table Reader Exercise: SVMIn this exercise we train a classifier to predict the vehicle type. The attributes are numerical, and have been normalized to [0,1] scale. We use asupport vector machine (SVM) as a classification model. We explore an optimal parameter for the SVM setting.1) Read the data (vehicle.table) with a Table Reader node. This dataset contains 2D attributes of silhouettes created by different types of vehicles. The last column is the target column, describing the 4 types of vehicles (bus, Opel, Saab, and van)2) Split the data with a Partitioning node into the training (80%) and testing (20%) data sets. - Use stratified sampling to preserve the target distribution on Col18.3) Train an SVM classifier with the SVM Learner node. Use the RBF kernel with sigma=0.5.4) Use the trained model to predict the vehicle type with the SVM Predictor node5) Assess the classification outcome by examining the confusion matrix with the Scorer node.6) Determine the optimal margin hardness by varying the Overlapping penalty in the SVM learner node with a Parameter Optimization Loop. - For the Parameter Optimization Loop Start, create a parameter “c” ranging from 1 to 25, with the step size of 2. - Use the parameter c to control “c_parameter” in the SVM Learner flow variable. - Connect the flow variable output from the Scorer node to the Parameter Optimization Loop End. Maximize the Accuracy. PartitionTraining (80%)Testing (20%)Train modelApply modelLoop overOverlapping penaltyMaximize accuracyReadingvehicle.tabledataPartitioning SVM Learner SVM Predictor Scorer Parameter OptimizationLoop Start ParameterOptimization Loop End Table Reader

Nodes

Extensions

Links