Skip to content

Commit

Permalink
Deployed 693bba0 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Nov 11, 2024
1 parent b5fd8de commit 063e9cc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
27 changes: 12 additions & 15 deletions data-mining/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@

<li class="nav-item" data-level="1"><a href="#data-mining" class="nav-link">Data Mining</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="2"><a href="#fenphp" class="nav-link">💎 fen.php</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#heuristicsphp" class="nav-link">💎💎💎 heuristics.php</a>
<li class="nav-item" data-level="2"><a href="#cli-commands" class="nav-link">CLI Commands</a>
<ul class="nav flex-column">
</ul>
</li>
Expand All @@ -105,30 +101,31 @@ <h1 id="data-mining">Data Mining</h1>
<tbody>
<tr>
<td align="left">💎</td>
<td align="left">The data mining command is not time-consuming</td>
<td align="left">The data mining command is not time-consuming.</td>
</tr>
<tr>
<td align="left">💎💎</td>
<td align="left">The data mining command is not too time-consuming</td>
<td align="left">The data mining command is not too time-consuming.</td>
</tr>
<tr>
<td align="left">💎💎💎</td>
<td align="left">The data mining command is time-consuming</td>
<td align="left">The data mining command is time-consuming.</td>
</tr>
</tbody>
</table>
<p>Please note the difference with the seed commands, which are meant for loading the tables with data.</p>
<h2 id="fenphp">💎 <code>fen.php</code></h2>
<h2 id="cli-commands">CLI Commands</h2>
<h3 id="fenphp">💎 <code>fen.php</code></h3>
<p>The example below populates the <code>fen_mine</code> column with chess positions in FEN format on a player basis:</p>
<pre><code class="language-text">docker exec -itu 1000:1000 chess_data_php php cli/mine/fen.php &quot;Anand,V&quot;
</code></pre>
<p>This column is intended to store a text string of comma-separated values representing the chess positions in a game. It allows to search games by piece placement in FEN format.</p>
<h2 id="heuristicsphp">💎💎💎 <code>heuristics.php</code></h2>
<h3 id="heuristicsphp">💎💎💎 <code>heuristics.php</code></h3>
<p>The example below populates the <code>heuristics_mine</code> column with heuristics data on a player basis:</p>
<pre><code class="language-text">docker exec -itu 1000:1000 chess_data_php php cli/mine/heuristics.php &quot;Anand,V&quot;
</code></pre>
<p>This column is intended to store a JSON object representing the heuristics in a game. It allows to gather insights about the decisions that have been made to make the moves. With the data from the heuristics mine, you can take advantage of <a href="https://dev.mysql.com/doc/refman/8.0/en/json-functions.html">MySQL JSON functions</a> to perform operations on JSON values like in the following examples.</p>
<h3 id="example">Example</h3>
<h4 id="example">Example</h4>
<p>Fetch the material evaluation in all games won by Anand with the white pieces.</p>
<pre><code class="language-sql">SELECT
JSON_EXTRACT(heuristics_mine, '$[0]')
Expand All @@ -145,7 +142,7 @@ <h3 id="example">Example</h3>
<li><a href="https://github.com/chesslablab/php-chess/blob/main/src/Function/FastFunction.php">Chess\Function\FastFunction</a></li>
</ul>
<p>Thus, <code>$[0]</code> corresponds to the material evaluation in the fast function array.</p>
<h3 id="example_1">Example</h3>
<h4 id="example_1">Example</h4>
<p>Fetch the material evaluation for the tenth move (20 plies) in all games won by Anand with the black pieces.</p>
<pre><code class="language-sql">SELECT
JSON_EXTRACT(heuristics_mine, '$[0][19]') as Material
Expand All @@ -156,7 +153,7 @@ <h3 id="example_1">Example</h3>
AND Black = &quot;Anand,V&quot;
AND Result = '0-1';
</code></pre>
<h3 id="example_2">Example</h3>
<h4 id="example_2">Example</h4>
<p>Fetch the games won by Anand with the black pieces having a material disadvantage of at least 0.1 in the tenth move.</p>
<pre><code class="language-sql">SELECT
movetext,
Expand All @@ -173,7 +170,7 @@ <h3 id="example_2">Example</h3>
HAVING
Material &gt;= 0.1;
</code></pre>
<h3 id="example_3">Example</h3>
<h4 id="example_3">Example</h4>
<p>Convert a material evaluation array from JSON to MySQL for further processing.</p>
<pre><code class="language-sql">SET
@j = (
Expand All @@ -195,7 +192,7 @@ <h3 id="example_3">Example</h3>
&quot;$[*]&quot; COLUMNS(balance FLOAT PATH &quot;$&quot;)
) material;
</code></pre>
<h3 id="example_4">Example</h3>
<h4 id="example_4">Example</h4>
<p>Sum all elements in the previous material evaluation array.</p>
<pre><code class="language-sql">SELECT
SUM(balance) as Sum
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,5 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2024-11-11 14:47:17.438523+00:00
Build Date UTC : 2024-11-11 14:51:17.300661+00:00
-->
Loading

0 comments on commit 063e9cc

Please sign in to comment.