Michael Sherwin wrote:One way of doing this would be to analyze a database of high quality games. As each game is being processed, every time that the material changed, but, was still within a certain margine, update a hash key based on the numbers of each type of piece. So for example, 8 white pawns have one hash value and 7 white pawns has a different hash value. It does not matter where the pawns are on the board, as that is handled by the traditional evaluation function. Now just look up the material balance from the table as all reasonably close balances are there. Or just compute it normally if it is not in the table as that would mean that it is not a reasonably close balance.

I've been thinking a lot about ideas similar to what you describe recently, but I think the exact method you describe above would be too simplistic to work well. I think you at least have to factor in the pawn structure and the colors of the bishops for both sides in addition to material. The problem with this is that you will end up with a table far too big to fit in RAM, and looking up the current material/pawn structure pattern in a disk file at every node would obviously be too expensive.
One possible solution to this problem would be to store not only patterns and scores in the disk file, but also the most common "child patterns" for each pattern. At the beginning of a new search, the program could initialize a hash table by reading in all patterns which occur frequently in games beginning with the pattern at the root node, and use this table in the search.
The material/pawn structure pattern file could also contain additional information, like thematic moves for both sides, or particularly good or bad squares for the individual piece types.
Perhaps it would be better to use a very rough classification of the pawn structure instead, for instance just closed/open/half-open centre combined with a list of open files for each side. There are countless approaches to try, but I don't think that there is a lot to gain by only looking at the material balance.
Tord