user27: I've been interested for a while about a computer chess AI algorithms (and got the chance to work on one at some point) like Minimax, and as the core component of these algorithms is the so-called evaluation function to determine what is a good board configuration, and what is a bad one.
In other terms, given a configuration of your Chess board, how do you determine that it is to your advantage, and with what degree of confidence?
For example:

If you own the center, this is rather favorable.
If you have more pieces than your opponent, this is rather favorable.
If you lost your Queen, this is rather not favorable.
If you have a pawn that is close to being promoted this is favorable.
...

So I would like to ask for some advice on how to create a good evaluation function, based on some expert knowledge about the Chess game in general. And if possible, a degree of favorability (say between 1 being very not favorable, to 100 being extremely favorable).
The idea in the end is to be able to create an algorithm that will look in the tree of possibilities up to a certain depth and evaluate what the most favorable configuration for next move is (taking into account several moves in the future) based on what is favorable to the player and not favorable to the opponent. But without a good evaluation function the algorithm is nothing.

user8309: I think chess programmers tend not to rely on the knowledge of strong chess players when designing their evaluation functions, but instead try out different elements, and then test them in games against other engines, and decide what to keep.  Larry Kaufman talks a fair bit about his views on what a human's understanding is, but it sounds like both Rajlich and Dailey were very results oriented, and did not adopt Kaufman's ideas wholesale.
One article I found interesting was Zach Wegner comparing the evaluation functions of Rybka and Fruit.  One of the areas where Rybka may have represented a step forward was in its incorporation of material imbalance tables based on specific combinations of pieces.  Kaufman wrote an article on this as well.
http://www.top-5000.nl/ZW_Rybka_Fruit.pdf
http://danheisman.home.comcast.net/~danheisman/Articles/evaluation_of_material_imbalance.htm

user19281: Surprisingly, it turns out that a Minimax engine will play reasonably well when the evaluation function is random; this is known as the Beale effect, and results from the principle that positions which give you more options and your opponent fewer options are generally favourable.  One reasonable way to generate random evaluations consistently and efficiently is to generate a Zobrist hash for the position (using coefficients chosen randomly at the start of the game), and derive the random evaluation directly from the hash.
At the opposite end of the scale, AlphaZero and Leela conduct an extremely sophisticated evaluation of each position searched, using a large neural network.  It is impractical to describe in human terms what functions this network effectively implements, but it is undeniably more effective than Stockfish's evaluation function.  The AlphaZero research paper indicates that this approach works best with Monte-Carlo Tree Search rather than Minimax.
If, on the other hand, you want to develop an analysis engine to help human players or commentators understand the nuances of a position, it may be worthwhile to implement a conventional evaluation function using established material values and positional theory.  A good example is set by Ed Schröder's Inside Rebel, documenting the major design features of a well-regarded engine used in several of Mephisto's chess computers.  You may wish to use a certain degree of machine learning to determine the relative importance of each element of your evaluation function, and also break out these elements individually for presentation in a GUI.

user3890: Adding up to the answer by @Eve Freeman, I would suggest looking up how does the best computer engine in the world, Stockfish, evaluate a given position. As the source code is open, you can do it for free. I think the file with the evaluation function you are looking for is this one.

user6947: I have a feeling I'm a little late on this answer but - I'm also in the process of making an engine.  The source code is in Python (which is fairly easy to read, even if you don't know it) and is available here if you wish to read it.  The list of currently active 'heuristics' (at the time of posting):

Farther developed (closer to the opposite side) pieces are better
Pawns closer to promotion are good 
Kings are scored separately based on what phase the game is in (opening, middlegame, endgame)
If the player has both bishops, that receives a bonus
If the player has castled, receive a bonus
Isolated pawns (pawns with nothing around them) are not good
Doubled pawns (two pawns on the same file with no gap between) are not good
Having all 8 pawns is not necessary a good thing and is penalized (they clutter the board and get in the way)
Have a look at this great evaluation function which is also used
Bishops with more pawns on the same color square as the bishop are penalized (they aren't as good in crowded situations)
Not yet implemented, but planned: Knights get a bonus in more crowded situations

In one of those points, I mentioned the 'phase' of the game (e.g. opening, middlegame, endgame), and if you wish to include that in your engine, you'll probably run into the same problem as I did: there's no clear line separating those.  My function that decides what phase the game is in uses a few things:

Amount of material on the board (as soon as any piece is killed, it marks the game as not in the opening)
Number of moves (less than 6 full moves is the opening, no matter what)
movement of the queens (if both queens have been moved, mark the game as middlegame)

This answer may have been long, late and off-topic, but I hope it was helpful anyways.

user142: Here's a good starting point. Material comparison is key (and easy), then you can tune that to consider positional aspects like open ranks/files/diagonals, pawn structure, etc.
https://www.chessprogramming.org/Evaluation

27: <p>I've been interested for a while about a computer chess AI algorithms (and got the chance to work on one at some point) like <a href="http://en.wikipedia.org/wiki/Minimax" rel="noreferrer">Minimax</a>, and as the core component of these algorithms is the so-called <strong>evaluation function</strong> to determine what is a <em>good</em> board configuration, and what is a <em>bad</em> one.</p>

<p>In other terms, given a configuration of your Chess board, how do you determine that it is to your advantage, and with what degree of confidence?</p>

<p>For example:</p>

<ul>
<li>If you <em>own</em> the center, this is rather favorable.</li>
<li>If you have more pieces than your opponent, this is rather favorable.</li>
<li>If you lost your Queen, this is rather not favorable.</li>
<li>If you have a pawn that is close to being promoted this is favorable.</li>
<li>...</li>
</ul>

<p>So I would like to ask for some advice on how to create a <em>good</em> evaluation function, based on some expert knowledge about the Chess game in general. And if possible, a degree of favorability (say between 1 being very not favorable, to 100 being extremely favorable).</p>

<p>The idea in the end is to be able to create an algorithm that will look in the tree of possibilities up to a certain depth and evaluate what the most favorable configuration for next move is (taking into account several moves in the future) based on what is favorable to the player and not favorable to the opponent. But without a good evaluation function the algorithm is nothing.</p>
 8309: <p>I think chess programmers tend not to rely on the knowledge of strong chess players when designing their evaluation functions, but instead try out different elements, and then test them in games against other engines, and decide what to keep.  Larry Kaufman talks a fair bit about his views on what a human's understanding is, but it sounds like both Rajlich and Dailey were very results oriented, and did not adopt Kaufman's ideas wholesale.</p>

<p>One article I found interesting was Zach Wegner comparing the evaluation functions of Rybka and Fruit.  One of the areas where Rybka may have represented a step forward was in its incorporation of material imbalance tables based on specific combinations of pieces.  Kaufman wrote an article on this as well.</p>

<p><a href="http://www.top-5000.nl/ZW_Rybka_Fruit.pdf" rel="nofollow">http://www.top-5000.nl/ZW_Rybka_Fruit.pdf</a>
<a href="http://danheisman.home.comcast.net/~danheisman/Articles/evaluation_of_material_imbalance.htm" rel="nofollow">http://danheisman.home.comcast.net/~danheisman/Articles/evaluation_of_material_imbalance.htm</a></p>
 19281: <p>Surprisingly, it turns out that a Minimax engine will play reasonably well when the evaluation function is <strong>random</strong>; this is known as the Beale effect, and results from the principle that positions which give you more options and your opponent fewer options are generally favourable.  One reasonable way to generate random evaluations consistently and efficiently is to generate a Zobrist hash for the position (using coefficients chosen randomly at the start of the game), and derive the random evaluation directly from the hash.</p>

<p>At the opposite end of the scale, AlphaZero and Leela conduct an extremely sophisticated evaluation of each position searched, using a <strong>large neural network</strong>.  It is impractical to describe in human terms what functions this network effectively implements, but it is undeniably more effective than Stockfish's evaluation function.  The AlphaZero research paper indicates that this approach works best with Monte-Carlo Tree Search rather than Minimax.</p>

<p>If, on the other hand, you want to develop an <strong>analysis engine</strong> to help human players or commentators understand the nuances of a position, it may be worthwhile to implement a conventional evaluation function using <strong>established material values and positional theory</strong>.  A good example is set by Ed Schröder's <a href="http://members.home.nl/matador/Inside%20Rebel.pdf" rel="nofollow noreferrer"><em>Inside Rebel</em></a>, documenting the major design features of a well-regarded engine used in several of Mephisto's chess computers.  You may wish to use a certain degree of machine learning to determine the relative importance of each element of your evaluation function, and also break out these elements individually for presentation in a GUI.</p>
 3890: <p>Adding up to the answer by @Eve Freeman, I would suggest looking up how does the best computer engine in the world, Stockfish, evaluate a given position. As the <a href="https://github.com/official-stockfish/Stockfish" rel="nofollow noreferrer">source code</a> is open, you can do it for free. I think the file with the evaluation function you are looking for is <a href="https://github.com/official-stockfish/Stockfish/blob/master/src/evaluate.cpp" rel="nofollow noreferrer">this one</a>.</p>
 6947: <p>I have a feeling I'm a little late on this answer but - I'm also in the process of making an engine.  The source code is in Python (which is fairly easy to read, even if you don't know it) and is available <a href="https://www.github.com/671620616/PhantomChess" rel="nofollow noreferrer">here</a> if you wish to read it.  The list of currently active 'heuristics' (at the time of posting):</p>

<ul>
<li>Farther developed (closer to the opposite side) pieces are better</li>
<li>Pawns closer to promotion are good </li>
<li>Kings are scored separately based on what phase the game is in (opening, middlegame, endgame)</li>
<li>If the player has both bishops, that receives a bonus</li>
<li>If the player has castled, receive a bonus</li>
<li>Isolated pawns (pawns with nothing around them) are not good</li>
<li>Doubled pawns (two pawns on the same file with no gap between) are not good</li>
<li>Having all 8 pawns is not necessary a good thing and is penalized (they clutter the board and get in the way)</li>
<li>Have a look at <a href="http://chessprogramming.wikispaces.com/Simplified+evaluation+function" rel="nofollow noreferrer">this great evaluation function</a> which is also used</li>
<li>Bishops with more pawns on the same color square as the bishop are penalized (they aren't as good in crowded situations)</li>
<li>Not yet implemented, but planned: Knights get a bonus in more crowded situations</li>
</ul>

<p>In one of those points, I mentioned the 'phase' of the game (e.g. opening, middlegame, endgame), and if you wish to include that in your engine, you'll probably run into the same problem as I did: there's no clear line separating those.  My function that decides what phase the game is in uses a few things:</p>

<ul>
<li>Amount of material on the board (as soon as any piece is killed, it marks the game as not in the opening)</li>
<li>Number of moves (less than 6 full moves is the opening, no matter what)</li>
<li>movement of the queens (if both queens have been moved, mark the game as middlegame)</li>
</ul>

<p>This answer may have been long, late and off-topic, but I hope it was helpful anyways.</p>
 142: <p>Here's a good starting point. Material comparison is key (and easy), then you can tune that to consider positional aspects like open ranks/files/diagonals, pawn structure, etc.</p>

<p><a href="https://www.chessprogramming.org/Evaluation" rel="nofollow noreferrer">https://www.chessprogramming.org/Evaluation</a></p>
