Flylib.com

Books Software

 
 
 

Evaluation

Evaluation

The experimentation phase requires a fair amount of tweaking. Both the values of the votes and the weights of the weapon properties need to be adjusted. Both these values could be handled together, because there is no need for weights if the votes are floating-point numbers . But keeping them separate makes it easier to achieve the correct output by incremental adjustment. Therefore, we can consider the votes as integers, worrying only about their relative importance. Then, the weights are tuned independently of the weapon properties.

The experimentation phase involves observing the weapon choices during the play. When a decision is dubious, the voting is broken down to see what went wrong. It's possible to see which weapon property had too many votes and isolate the features that contributed most. The feature is adjusted until the total votes are reasonable. Then, when the votes seem balanced, it's a matter of adjusting the weights for each weapon property. These values can be adjusted by identifying the property that contributes too strongly to the final fitness and reducing its weight as appropriate.

This methodology makes it somewhat easier to adjust all the values involved. The voting system also has the advantage of being easy to extend. New features can be added easily, and mostly independent from other existing features. The resulting system does relatively well at selecting weapons; although the behavior is no doubt suboptimal, it's practically indistinguishable from human behavior.

On the downside, setting up a voting system often requires this kind of experimentation because the results of the votes are not necessarily known. In this case, it's not possible to use supervised learning techniques. There's also a problem with the assumptions made; indeed, rarely do player skills match the exact statistics of the weapons. This implies the behaviors are not customized to individual player abilities .

Summary

This chapter discussed the importance of scripting, even when modern AI techniques are used:

  • Scripts are easy to modify; there is no separate compilation phase.

  • The syntax is simple, flexible, and high-level, which leads to less coding.

  • Scripts are separated from the code and are handled in a data-driven fashion.

  • As customizable glue between generic components , scripts provide the ideal complement to native code.

The idea of a voting system was also presented in detail. In the case of weapon selection, the following concepts apply:

  • Candidates are the weapon properties.

  • The features of the situation are the voters.

  • The votes can be cast with different weights and for multiple candidates.

The solution works very well, and matches our requirements for justifiability and decisiveness. This requires a certain amount of experimentation and adjusting by the developer. However, sometimes the assumptions do not lead to the best decision, and the system is not tailored to individual skills.

The next chapter covers the theory behind decision trees, an AI technique that can be used to make decisions by evaluating the benefit of a choice. The advantage is that the weapon selection can be learned from examples, and the application of this theory is covered in Chapter 27, "Learning to Assess Weapons."

Chapter 26. Classification and Regression Trees

Key Topics

  • Representation of Decision Trees

  • Classifying and Regressing

  • Tree Induction

  • Training Procedure

  • Discussion

Regression and classification trees -also known collectively as decision trees (DTs) -are data structures that can interpret patterns in data in order to recognize them. They are organized as hierarchical decisions over certain variables to predict a result value. With classification trees, the result is a symbolic class, whereas regression trees return continuous values.

Decision trees must be learned from example data, so it's necessary to create or gather it beforehand. An expert can prepare the data, or a collection of facts from the problems can be accumulated . Many tasks , including simulating intelligence, can be seen as just interpreting -or classifying -such data. In practice, each problem can be encoded as a set of attributes and the DT can predict an unknown attribute (the solution).

This chapter discusses the following topics:

  • The concept of a data sample, with predictor and response variables

  • The representation of decision trees, with decision nodes and branches

  • The process of classifying and regressing based on an existing tree

  • How trees are learned -or induced -from data sets, using recursive partitioning

  • The training procedure from a wider perspective, aiming to find the best DT for the problem

These items can become the decision-making component in game characters . Each situation is represented as a set of attributes, so the DT can suggest the best course of action in a certain situation. Also, it's possible to use regression trees to evaluate the benefit of an object (or predict an outcome, both positive and negative). The next chapter does this in the context of weapon selection.