# ART1 Example Adapted From M. T. Jones

I originally found this code in "AI Application Programming", by M. T. Jones. It was written in C, which I ported to Java, Python and VB.Net. The algorithm design might look a little different than the previous examples, but the overall function achieves similar ends.

This code was designed as an example of personalization, where customer purchases are analyzed to group the customers together for future product recommendations.  In the Database array below, each row represents individual customer purchases (1's), in contrast to other items in the store which weren't purchased (0's). For example, the first column might be candy bars, the second might be dish soap, the third might be lunch meat, etc.

Note the use of the "Count" variable; it's being used as an arbitrary limit for the algorithm's iterations.  The original author may have recognized certain constants that lead to convergence with 50 iterations.  However, the typical ART1 algorithm includes a check to see if it has converged or not (as in the previous examples).

You'll probably notice after some experimentation that the resulting groups can vary depending on which order the data rows are entered.

# Example Results

```ProtoType Vector: 0:   00000100100
Customer: 0:           00000100100
Customer: 7:           00100000100

ProtoType Vector: 1:   00001000000
Customer: 5:           00001000001
Customer: 8:           00001001000
Customer: 11:           00001000001

ProtoType Vector: 2:   00010010010
Customer: 2:           00010010010
Customer: 6:           10010000000
Customer: 10:           10010000000

ProtoType Vector: 3:   00001001001
Customer: 3:           00001001001

ProtoType Vector: 4:   10010000010
Customer: 4:           10010000010

ProtoType Vector: 5:   00100100100
Customer: 9:           00100100100

ProtoType Vector: 6:   01000000000
Customer: 1:           01000001001
Customer: 12:           01000000000

ProtoType Vector: 7:   10101010101
Customer: 13:           10101010101

ProtoType Vector: 8:   00000000000

ProtoType Vector: 9:   00000000000

Membership: 0
Membership: 6
Membership: 2
Membership: 3
Membership: 4
Membership: 1
Membership: 2
Membership: 0
Membership: 1
Membership: 5
Membership: 2
Membership: 1
Membership: 6
Membership: 7

Customer: 0:           00000100100
Customer: 1:           01000001001
Customer: 2:           00010010010
Customer: 3:           00001001001
Customer: 4:           10010000010
Customer: 5:           00001000001
Customer: 6:           10010000000
Customer: 7:           00100000100
Customer: 8:           00001001000
Customer: 9:           00100100100
Customer: 10:           10010000000
Customer: 11:           00001000001
Customer: 12:           01000000000
Customer: 13:           10101010101
```

# Work Cited

Jones, M. T.  (2003)  AI Application Programming.  Massachusetts: Charles River Media.

public void footer() {