Second homework: Induction of Decision Trees
This homework is due on Thursday, November 3, before midnight, via
email.
There are two default tasks you can attack in this homework.
One is based on quidditch, the other isbased on the rock, paper,
scissors game.
1) With the quidditch-based homework, you have already received, via
email, a new tar ball with almost all of the required files. Both
attacking and defending players move. Each quidditch simulation
consists of the blue team getting theball, and the passer choosing a
receiver randomly. Once the pass is made, it either makes it to the
intended receiver, or it gets intercepted. The former is considered a
succes, the second a failure. The simulation stops at that time, and
writes to text files you can use to induce trees. The files create are
called quidditch.names, and quidditch.data. Here are examples of those
files.
for
quidditch.names :
Pass, Don't Pass
x_player_0: continuous.
y_player_0: continuous.
z_player_0: continuous.
x_player_1: continuous.
y_player_1: continuous.
z_player_1: continuous.
x_player_2: continuous.
y_player_2: continuous.
z_player_2: continuous.
x_player_3: continuous.
y_player_3: continuous.
z_player_3: continuous.
x_player_4: continuous.
y_player_4: continuous.
z_player_4: continuous.
x_player_5: continuous.
y_player_5: continuous.
z_player_5: continuous.
x_player_6: continuous.
y_player_6: continuous.
z_player_6: continuous.
x_player_7: continuous.
y_player_7: continuous.
z_player_7: continuous.
x_player_8: continuous.
y_player_8: continuous.
z_player_8: continuous.
x_player_9: continuous.
y_player_9: continuous.
z_player_9: continuous.
For
quidditch.data:
6.000000, -17.000000,
13.000000, -3.000000, 0.000000, 4.000000, -10.000000, 9.000000,
6.000000, -9.000000, Pass
6.000000, -17.000000,
13.000000, -3.000000, 0.000000, 4.000000, -10.000000, 9.000000,
6.000000, -9.000000, Pass
6.000000, -17.000000,
13.000000, -3.000000, 0.000000, 4.000000, -10.000000, 9.000000,
6.000000, -9.000000, Pass
0.000000, -4.000000,
-6.000000, 0.000000, -9.000000, 15.000000, -19.000000, 11.000000,
0.000000, -6.000000, Don't Pass
0.000000, -4.000000,
-6.000000, 0.000000, -9.000000, 15.000000, -19.000000, 11.000000,
0.000000, -6.000000, Don't Pass
0.000000, -4.000000,
-6.000000, 0.000000, -9.000000, 15.000000, -19.000000, 11.000000,
0.000000, -6.000000, Don't Pass
0.000000, -4.000000,
-6.000000, 0.000000, -9.000000, 15.000000, -19.000000, 11.000000,
0.000000, -6.000000, Don't Pass
-1.000000, 7.000000,
14.000000, -6.000000, 9.000000, -13.000000, 4.000000, 14.000000,
-17.000000, 15.000000, Pass
-1.000000, 7.000000,
14.000000, -6.000000, 9.000000, -13.000000, 4.000000, 14.000000,
-17.000000, 15.000000, Pass
-1.000000, 7.000000,
14.000000, -6.000000, 9.000000, -13.000000, 4.000000, 14.000000,
-17.000000, 15.000000, Pass
-8.000000, 19.000000,
11.000000, 15.000000, -9.000000, -18.000000, 18.000000, 6.000000,
-9.000000, 4.000000, Pass
-7.000000, -5.000000,
11.000000, 1.000000, 7.000000, 12.000000, 6.000000, 0.000000,
-9.000000, 0.000000, Pass
These files are created in method + to end-simulation with-reason
reason (string):
in file DecisionController.tz (line 429). These files are
intended to be used with the
"c4.5" command. To be able to use this command you have to install dome
files available at
http://www2.cs.uregina.ca/~hamilton/courses/831/notes/ml/dtrees/c4.5/tutorial.html
.
They will generate results that you can then incorporate into the
quidditch code at the pass decision making moment.
As the files stand right now, they include only the x coordinate of
each player. That's probably useless. It is part o your task to
determine which features to use for induction, and to add the
corresponding lines to the quidditch code. This printing would probably
be done around line 453 for the .names file and line 466 for the .data
file.
Once you have a decision tree, you can modify line 129, method +to
attack of file simplePlayer.tz. That line controls the decision-making
process of who to pass.
Additionally, you can change the defending behavior of the opposing
team, to see what diference that makes to the induction process. You
can do that in line 82 of simplePlayer.tz
IMPORTANT
NOTE:
After Rob distributed the last version of the quidditch files, I
realized that the data that code generates should only help in
determining if the pass should be made or not, not to who the pass
should be made. That is because that code chooses who to pass to
randomly from all teammates, and the data says nothing about who the
ball was passed to. So, in order for data to be generated which can be
used to answer the quetion "should I pass to player BLA," you need to
modify line 129, which reads "teamMateToPassTo = (self
choose-a-teammate-randomly from openTeamMates)." to "teamMateToPassTo =
openTeamMates{0}." The pass is now always made to the first
teammate, which is the second one you get from calling "all
simplePlayer."
For the Rock, Paper,
Scissors game:
Christopher send me a link to an automated competition for the rock,
paper, scissors game, which is at http://www.cs.ualberta.ca/~darse/rsb-ts1.c
. What is the
strategy for this game? Who knows?! That makes it a great candidate for
machine learning. That file includes many robotic players, from where
you can compile and get data to use for induction. You would still be
using the c4.5 command to induce trees.