user13498: I am creating a set of chess positions to be used [as a data set] for a project. It's based on supervised machine learning, but I need to have labeled data (see more italicized text below) before any machine learning can be done. I wish to label each position as open or closed or possibly some combination of the two.
I started out with assigning each position to just "open" or "closed," but this wasn't clear for a lot of the positions. Then I decided to go with a third label, semi-open/semi-closed, which is like the middle and in between open and closed. I’ve labeled most of the positions, but there are many positions that I still haven’t comfortably labeled with a distinct class.
I know that open positions are characterized as having pawnless ranks, files, and diagonals, while closed positions have them clogged up with pawns. In open positions you can usually centralize your pieces, while closed positions give you a hard time moving an arbitrary piece to a random location on the board. There are many other related patterns, features, and qualities.
I can easily go with my gut feeling when assigning "closed" to a position that has 7 pawns on each side with each pawn blockading another, and "open" to a position that has pawns only on the flanks and in their starting squares. However, it's hard for me to classify some positions such as these two examples:
[White "Position1"]
[Black "Open/Semi/Closed/Etc"]
[FEN "8/5Qpk/p6p/P1b5/4pPn1/2Pp3P/1P1BbqP1/R3R2K w - - 0 1 "]


[White "Position2"]
[Black "Open/Semi/Closed/Etc"]
[FEN "3r1rk1/pp2pp1p/2p3pb/2P5/4P3/4nNPb/PP2P2P/R1RNK2B w - - 0 1 "]

What would you assign to the examples above and why? For example: one position is more open than the other due to characteristic XYZ, or the second position should not be considered closed since there's an open file, and so on.
Should I just ditch the whole binary-ish labeling (classification) and instead assign a variable number (regression) describing how open or closed a position is (e.g. 0% to 100% open?) Or is there still a way for positions to go into a few categories, which means that we can have "rigorous" definitions of the categories of openness? And "rigorous" as in having few contradictions and preferably can be applied by a human without too much difficulty.

user13012: I echo user 1583209; why are you doing this?
But just as an abstract exercise, how about this measure of open-ness?
Look at every piece on the board, and count the number of moves that it would have if there was nothing else on the board. Add this up for all pieces on both sides and call it $N_{empty}$.
Now count the number of moves/captures that each piece actually has and add these. Call this total $N_{actual}$. The ratio $N_{actual}/N_{empty}$ is a measure of the open-ness of the position.
I think this is cute, and maybe as good as anything else, but why are we doing this?

user7657: As in openings, positions would be regarded as closed or open depending on whether they were blocked by pawns or not.  And as in the openings, these could be semi-open as well, which as you indicate would be an in-between type of situation. These distinctions are not necessarily fixed but can change depending on whether or not pawn exchanges are made to open up the position. In an open position, the pieces would have more freedom to roam and search for tactical combinations as opposed to a closed one where the opposing pieces couldn't come in contact right away and more maneuvering would take place behind the lines.  I would think that it would be more reasonable in your classifications to stick to these more general categories than to try to use percentages to describe what will be more or less fluid situations. I would categorize both of the positions shown as semi-open since Black has more open lines of attack and freedom of movement for his pieces in both as opposed to White. In fact, if it's Black's move, he has a pretty forced mate in position number 1 with 1..., Qxg2+!; 2. Kxg2, Bf3+; 3. Kf1 (if 3. Kg3, Bf2#) Nh2#.    And if Black moves first in position number 2, he forces mate with 1..., Rxd1+!; 2. Rxd1 (if 2. Kf2, Be3#),
Nc2+;  3. Kf2 Be3#.

user20721: You cannot.   They all have characteristics of open/closed between the two extremes so constitute a fuzzy type of set or a statistical sort of categorization.  There is no way to declare absolute that a position is either open or closed when many (most?) are in the vague area of semiclosed/semiopen as nobody tries to define quarter or 3/4 closed/open or finer fractional/decimal categories. 

user11629: In the end the distinction between open/closed position is subjective and as you noticed there will always be some overlap or positions that don't fit perfectly into either category.
What exactly do you need this for?
For me the typical closed position has blocked pawn chains, generally many pawns, few or no open files. Because of this, the play tends to be slow, positional.  Typical plans include undermining the pawn chains from the side or pawn storms/attacks against the enemy king.
Conversely open position have fewer and mobile pawns, open files, more space for pieces and are generally more tactical.

user13521: As a chess player who currently studies computer science, I found this question very interesting so here's my thoughts on the topic. You already know how chess books categorize open and closed positions and you may also know that a semi-closed position is one with some of the characteristics of an open but not all. As you understand this makes the line between closed and semi closed positions not easy to be seen. So my recommendation is to use a number to describe the "openness" of a position(although 50% may be a problem). Now some things I thinks you might find useful for implementing you machine learning algorithm. Firstly, I will suggest you to take a look at this article https://chess24.com/en/read/news/how-do-chess-engines-think in the section about position evaluation. Now, some parameters you might use:

Number of pawns(a position with no pawns is apparently wide open).
Number of pawn moves(assuming a position with three pawns each,there's a big difference if they are on f2,g2,f7 and f7,g7,h7 respectively and if they are on c4,d5,e4 and c5,d6,e5.
As you see in 2 you may give an extra weight for pawn moves in the center. Generally it will be a good idea to give extra weight for anything open in the center. This will be more clear in 4.
Number of open and semi-open files. The ones in the center again should have an extra weight.
Open diagonals. Note that diagonals with one or more isolani should be counted almost as opens(As an example think about the Indian's bishop targeting d4 and b2 when the c pawn is not on c3). And you should of course take into consideration the length of the diagonal.

Note that essentially you don't judge the whole position, just the pawn structure. That's why count the available moves of every piece is a mistake. This just measures the mobility of the given piece and doesn't necessarily has something to do with the pawn structure. For example, in a position with no pawns a Knight on a1 has only two moves while in a closed King's Indian the f3 Knight has seven( only one is occupied by the King). Some of them drop the piece but they are legal moves nonetheless.
Hope that helps a bit!

13498: <p>I am creating a set of chess positions to be used [as a data set] <strong>for a project</strong>. It's based on <em>supervised machine learning</em>, but I need to have labeled data (see more <em>italicized</em> text below) before any machine learning can be done. I wish to label each position as open or closed or possibly some combination of the two.</p>

<p>I started out with assigning each position to just "open" or "closed," but this wasn't clear for a lot of the positions. Then I decided to go with a third label, semi-open/semi-closed, which is like the middle and in between open and closed. I’ve labeled most of the positions, but there are many positions that I still haven’t comfortably labeled with a distinct class.</p>

<p>I know that open positions are characterized as having pawnless ranks, files, and diagonals, while closed positions have them clogged up with pawns. In open positions you can usually centralize your pieces, while closed positions give you a hard time moving an arbitrary piece to a random location on the board. There are many other related patterns, features, and qualities.</p>

<p>I can easily go with my <strong>gut feeling</strong> when assigning "closed" to a position that has 7 pawns on each side with each pawn blockading another, and "open" to a position that has pawns only on the flanks and in their starting squares. However, it's hard for me to classify some positions such as these two examples:</p>

<pre><code>[White "Position1"]
[Black "Open/Semi/Closed/Etc"]
[FEN "8/5Qpk/p6p/P1b5/4pPn1/2Pp3P/1P1BbqP1/R3R2K w - - 0 1 "]
</code></pre>

<hr>

<pre><code>[White "Position2"]
[Black "Open/Semi/Closed/Etc"]
[FEN "3r1rk1/pp2pp1p/2p3pb/2P5/4P3/4nNPb/PP2P2P/R1RNK2B w - - 0 1 "]
</code></pre>

<p>What would you assign to the examples above <strong>and why</strong>? For example: one position is more open than the other due to characteristic XYZ, or the second position should not be considered closed since there's an open file, and so on.</p>

<p>Should I just ditch the whole binary-ish labeling (<em>classification</em>) and instead assign a variable number (<em>regression</em>) describing how open or closed a position is (e.g. 0% to 100% open?) Or is there still a way for positions to go into a few categories, which means that we can have <strong>"rigorous" definitions</strong> of the categories of openness? And "rigorous" as in having few contradictions and preferably can be applied by a human without too much difficulty.</p>
 13012: <p>I echo user 1583209; why are you doing this?</p>

<p>But just as an abstract exercise, how about this measure of open-ness?</p>

<p>Look at every piece on the board, and count the number of moves that it would have if there was nothing else on the board. Add this up for all pieces on both sides and call it $N_{empty}$.</p>

<p>Now count the number of moves/captures that each piece actually has and add these. Call this total $N_{actual}$. The ratio $N_{actual}/N_{empty}$ is a measure of the open-ness of the position.</p>

<p>I think this is cute, and maybe as good as anything else, but why are we doing this?</p>
 7657: <p>As in openings, positions would be regarded as closed or open depending on whether they were blocked by pawns or not.  And as in the openings, these could be semi-open as well, which as you indicate would be an in-between type of situation. These distinctions are not necessarily fixed but can change depending on whether or not pawn exchanges are made to open up the position. In an open position, the pieces would have more freedom to roam and search for tactical combinations as opposed to a closed one where the opposing pieces couldn't come in contact right away and more maneuvering would take place behind the lines.  I would think that it would be more reasonable in your classifications to stick to these more general categories than to try to use percentages to describe what will be more or less fluid situations. I would categorize both of the positions shown as semi-open since Black has more open lines of attack and freedom of movement for his pieces in both as opposed to White. In fact, if it's Black's move, he has a pretty forced mate in position number 1 with <strong>1..., Qxg2+!; 2. Kxg2, Bf3+; 3. Kf1</strong> (if 3. Kg3, Bf2#) <strong>Nh2#</strong>.    And if Black moves first in position number 2, he forces mate with <strong>1..., Rxd1+!; 2. Rxd1</strong> (if 2. Kf2, Be3#)<strong>,</strong> 
<strong>Nc2+;  3. Kf2 Be3#.</strong></p>
 20721: <p>You cannot.   They all have characteristics of open/closed between the two extremes so constitute a fuzzy type of set or a statistical sort of categorization.  There is no way to declare absolute that a position is either open or closed when many (most?) are in the vague area of semiclosed/semiopen as nobody tries to define quarter or 3/4 closed/open or finer fractional/decimal categories. </p>
 11629: <p>In the end the distinction between open/closed position is subjective and as you noticed there will always be some overlap or positions that don't fit perfectly into either category.</p>

<p>What exactly do you need this for?</p>

<p>For me the typical closed position has blocked pawn chains, generally many pawns, few or no open files. Because of this, the play tends to be slow, positional.  Typical plans include undermining the pawn chains from the side or pawn storms/attacks against the enemy king.</p>

<p>Conversely open position have fewer and mobile pawns, open files, more space for pieces and are generally more tactical.</p>
 13521: <p>As a chess player who currently studies computer science, I found this question very interesting so here's my thoughts on the topic. You already know how chess books categorize open and closed positions and you may also know that a semi-closed position is one with some of the characteristics of an open but not all. As you understand this makes the line between closed and semi closed positions not easy to be seen. So my recommendation is to use a number to describe the "openness" of a position(although 50% may be a problem). Now some things I thinks you might find useful for implementing you machine learning algorithm. Firstly, I will suggest you to take a look at this article <a href="https://chess24.com/en/read/news/how-do-chess-engines-think" rel="noreferrer">https://chess24.com/en/read/news/how-do-chess-engines-think</a> in the section about position evaluation. Now, some parameters you might use:</p>

<ol>
<li><p>Number of pawns(a position with no pawns is apparently wide open).</p></li>
<li><p>Number of pawn moves(assuming a position with three pawns each,there's a big difference if they are on f2,g2,f7 and f7,g7,h7 respectively and if they are on c4,d5,e4 and c5,d6,e5.</p></li>
<li><p>As you see in 2 you may give an extra weight for pawn moves in the center. Generally it will be a good idea to give extra weight for anything open in the center. This will be more clear in 4.</p></li>
<li><p>Number of open and semi-open files. The ones in the center again should have an extra weight.</p></li>
<li><p>Open diagonals. Note that diagonals with one or more isolani should be counted almost as opens(As an example think about the Indian's bishop targeting d4 and b2 when the c pawn is not on c3). And you should of course take into consideration the length of the diagonal.</p></li>
</ol>

<p>Note that essentially you don't judge the whole position, just the pawn structure. That's why count the available moves of every piece is a mistake. This just measures the mobility of the given piece and doesn't necessarily has something to do with the pawn structure. For example, in a position with no pawns a Knight on a1 has only two moves while in a closed King's Indian the f3 Knight has seven( only one is occupied by the King). Some of them drop the piece but they are legal moves nonetheless.</p>

<p>Hope that helps a bit!</p>
