Lab 3: Categorising Connect 4 Boards
- Grab the connect 4 data in xl. My
server doesn't serve up .xlsm files so it's a .txt file. Just save
it as connect-4.xlsm.
- If you'd like, you can get the data right from the
University of California at Irvine's site. All I did
was take every other line with the odds being the train set
and the evens the test set.
- You're welcome to do the lab in Java or some other lab, but
I'll walk you through it in Visual Basic.
- Hit the developer tab, and then visual basic. Add a form, and
a command button and edit box to the form.
- Click the button to get the VB editor. Add TextBox1.Text = "hi"
to the click sub, and run it. (There, you've got VB running.)
- I did TextBox1.Text = VBAProject.Sheet2.Range("A1").Value to
put the train A1 value into the box
- Write a function that returns the numbers of cells in two
rows that are different. I used
Private Function distance2( first as Range, second As Range) as Integer
and
first.Cells(1,X).Value
- Make a function that finds the closest row to the first test row.
(Mine took about 10 seconds to run.)
- Guess the answer to the test from the closest other row, and put
that in the spreadsheet.
- Run that over the first 10 test items.
- How well do you do? I got 15/25 training on the test set.
- Can you improve the metric?