<jupyter_start><jupyter_text>Tuning the $\kappa$ exponents<jupyter_code>h = HeuristicScore()
line = N_9x9().setline('e', [2,0,0,1, 1,1,0,0]).as_bits()[0]
h.f_range(line, 0), h.cscore(line, 0), h.score(line) 
# expected: (array([0, 0, 1, 1, 1, 0, 0]), (3, 2), 3.4460950649911055)
line = N_9x9().setline('e', [2,0,2,1, 1,1,0,0]).as_bits()[0]
h.f_range(line, 0), h.cscore(line, 0), h.score(line) 
# expected: (array([1, 1, 1, 0, 0]), (3, 1), 3.0)
line = N_9x9().setline('e', [1,0,1,1, 1,0,0,2]).as_bits()[0]
print(line)
h.f_range(line, 0), h.cscore(line, 0), h.score(line) 
# expected: (array([1, 0, 1, 1, 1, 0, 0]), (3, 3), 3.737192818846552)
line = N_9x9().setline('e', [1,2,0,1, 0,2,1,2]).as_bits()[0]
h.f_range(line, 0), h.cscore(line, 0), h.score(line)
# expected: (array([0, 1, 0]), (0, 0), 0.0)<jupyter_output><empty_output><jupyter_text>--- Complete score of a N9x9 neighbourhood<jupyter_code>h = HeuristicScore()
n1 = (N_9x9()
 .setline('e',  [1,2,0,2, 0,2,1,2])
 .setline('ne', [1,2,2,1, 2,0,2,2])
 .setline('n',  [0,0,0,1, 1,0,0,2])
 .setline('nw', [1,2,1,1, 0,1,0,2]))
n2 = (N_9x9()
 .setline('e',  [1,2,0,2, 0,2,1,2])
 .setline('ne', [1,2,2,1, 2,0,2,2])
 .setline('n',  [0,0,2,1, 1,0,0,2])
 .setline('nw', [1,2,1,1, 0,1,0,2]))
print(n1, h.total_score(n1.as_bits()))
print()
print(n2, h.total_score(n2.as_bits()))
h = HeuristicScore()
n1 = (N_9x9()
 .setline('e',  [1,2,0,2, 0,2,1,2])
 .setline('ne', [1,2,2,1, 2,0,2,2])
 .setline('n',  [0,0,0,1, 1,0,0,2])
 .setline('nw', [0,0,0,1, 0,1,0,2]))
n2 = (N_9x9()
 .setline('e',  [1,2,0,2, 0,2,1,2])
 .setline('ne', [1,2,2,1, 2,0,2,2])
 .setline('n',  [0,0,2,1, 1,0,0,2])
 .setline('nw', [0,0,0,1, 0,1,0,2]))
print(n1, h.total_score(n1.as_bits()))
print()
print(n2, h.total_score(n2.as_bits()))

n2 = (N_9x9()
 .setline('e',  [1,2,0,2, 0,2,1,2])
 .setline('ne', [1,2,2,1, 2,0,2,2])
 .setline('n',  [0,0,2,1, 1,0,0,2])
 .setline('nw', [1,2,1,1, 0,1,0,2]))
print(n2, h.scores(n2.as_bits(), c=0), h.total_score(n2.as_bits(), c=0))<jupyter_output>|o       o       o|
|              o  |
|    x            |
|        x o      |
|x o   o *   o x o|
|      x x x      |
|    o   o   x    |
|  o           o  |
|x               x| [0.0, 0.0, 2.0, 3.0] 3.2710663101885897
{'fraction_non_alphanumeric': 0.3002257336343115, 'fraction_numerical': 0.1507900677200903, 'mean_word_length': 4.1415313225058, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '667342', 'license': 'Apache-2.0', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1236, 'n_words': 201, 'path': 'other_stuff/DeepGomoku/TuningKappa.ipynb', 'repo_name': 'Project-Ellie/tutorials', 'size': '2215'}