A script to demonstrate Support Vector Machine (SVM) classification on outcomes of the battles of Robocode.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
robocode-svm/README.md

45 lines
2.3 KiB

9 years ago
# Description
`robocode-svm` is a script to demonstrate Support Vector Machine (SVM) classification on outcomes of the battles of Robocode. You can check the original assignment that led to this work [here](extras/assignment.pdf).
9 years ago
# Installation
9 years ago
The script runs under Linux and requires `robocode`, `svm-scale`, `svm-train` and `svm-predict` executables located in the `PATH`. On Arch Linux (or it's derivative, like i.e. Manjaro), this can be achieved by installing [libsvm](https://aur.archlinux.org/packages/libsvm/) and [robocode](https://aur.archlinux.org/packages/robocode/) from AUR (if enabled) by following command (or equivalent):
9 years ago
```
pamac install robocode libsvm
9 years ago
```
# Usage
9 years ago
```
9 years ago
Generate the data required for SVM classification and show the accuracy
of the generated SVM model. If coordinates are provided, one visual battle
9 years ago
is shown to support the prediction.
9 years ago
9 years ago
USAGE: robocode-svm ACTION
USAGE: robocode-svm --battle x y [alpha]
--battle Shows visual run of the specified battle
-g,--generate Just generate the battle data
-a,--accuracy Show the accuracy of the SVM model,
-c,--clean Delete all the battle data!
-h,--help Show this help
9 years ago
```
9 years ago
9 years ago
# Details
The robots on test are **sample.Corners** (starting in center) and **sample.TrackFire** (roaming). The _gun cooling rate_ is set to **0.07**. These were obtained by experimenting and provide great outcomes on the battlefied, that can be classified easily.
9 years ago
## SVM kernel parameters
The SVM type used is **C-SVC** (multi-class classification), with the **radial basis** kernel. The _cost_ parameter C is **10** and the _sigma_ parameter is **2**. You can find more details about these at [libsvm home](https://github.com/cjlin1/libsvm).
9 years ago
## 2D visualisation
When the third parameter (initial gun orientation) of the roaming robot is omitted, we can generate _sample_ visualisation of the result of this classification. Our experiments were indicating, that this parameter has low (about 2%) significance on the outcome of the battle.
![2D visualisation](extras/visualize2D.png)
The visualisation color shows, which robot is likely to win, when the roaming one starts on given position on the battlefield. You can estimate the coordinates on the image and run script with the `--battle` parameter to prove the classification.