<jupyter_start><jupyter_text>Baseline mit einem Spieler<jupyter_code>import locale

from helpers import colorboxplot, makeHistogram,colors
from src.codeGameSimulation.store2db import getDataFromDB, getSettingsFromDB



# %config InlineBackend.figure_formats = ['svg']
import matplotlib.pyplot as plt
import matplotlib.style as mplstyle

locale.setlocale(locale.LC_NUMERIC, "german")

mplstyle.use("fast")
mplstyle.use("default")
# mpl.rcParams['figure.figsize'] = [20, 10]<jupyter_output><empty_output><jupyter_text>Pfad aus dem die Datenbanken geladen werden sollen.<jupyter_code>db_dir = "D:/Uni/BA/data/"
db_filename = "gameHistories_baseline_two_players"<jupyter_output><empty_output><jupyter_text>Lade Daten aus der Datenbank<jupyter_code>ids,roundCounts, stepCounts, winners, settingsIDs = getDataFromDB(db_dir, db_filename)
settings = getSettingsFromDB(db_dir,db_filename)<jupyter_output>db load finished after 0:00:08.221650
sort finished after 0:00:00.132030
groupby finished after 0:00:00.140032
sort finished after 0:00:00.527119
split finished after 0:00:03.969242
settings loaded<jupyter_text>Erstelle Label basierend auf den Einstellungen des jeweiligen Testsets<jupyter_code>labels_unordered  = [ " vs ".join([p.getStrategy().getName()+" [{}]".format(p.getStoneCount()) for p in s[1]]) for s in settings]
labels = [labels_unordered[i] for i in settingsIDs]
labels<jupyter_output><empty_output><jupyter_text>Ein Spielstein<jupyter_code>sc = stepCounts[0]
figSteps, ax = plt.subplot_mosaic([["Boxplots"]], figsize=[
    17, 2.5], layout="constrained")
# colorboxplot([[rc/(i+1) for rc in part]
#              for i, part in enumerate(stepCounts)], ax["Boxplots"], labels, colors)
colorboxplot([sc], ax["Boxplots"], [""], colors[0])
ax["Boxplots"].set_title(
    "Spiellänge in Zügen für zwei Spieler mit allen Steinen [{0:n} Spiele]".format(len(sc), grouping=True))

rc = roundCounts[0]
figRounds, ax = plt.subplot_mosaic([["Boxplots Runden"]], figsize=[
    13, 3], layout="constrained")
colorboxplot([rc], ax["Boxplots Runden"], [""], colors[0])
ax["Boxplots Runden"].set_title( "Spiellänge in Runden für einen Stein [{0:n} Spiele]".format(len(sc), grouping=True))


# figRounds1p1s, ax = plt.subplot_mosaic([["Boxplots"], ["Histogramm"]], figsize=[10, 5], layout="constrained", sharex=True)
# zeichneErrechnetenWert(ax["Boxplots"], "r")
# zeichneErrechnetenWert(ax["Histogramm"], "r", noText=True)
# colorboxplot([rc], ax["Boxplots"], [""], [colors[0]])
# ax["Boxplots"].set_title("Spiellänge in Runden für einen Stein [{0:n} Spiele]".format(len(rc), grouping=True))
# ax["Histogramm"].set_xlabel('empirisch bestimmte Spiellänge in Runden')
# ax["Boxplots"].tick_params('x', labelbottom=False)
# makeHistogram([rc], ax["Histogramm"], [""], [colors[0]], hideLegend=True)

figSteps.savefig(
    "../../tex/game_ur_ba_thesis/img/Grafiken/Baseline/Schritte.png", dpi=300,)
figRounds.savefig(
    "../../tex/game_ur_ba_thesis/img/Grafiken/Baseline/Runden.png", dpi=300,)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15908336100963136, 'fraction_numerical': 0.0295582862836267, 'mean_word_length': 7.6801152737752165, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '654856', 'license': 'MIT', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1108, 'n_words': 207, 'path': 'src/statistiken/Baseline2P.ipynb', 'repo_name': 'LukasWallisch/game-ur-analysis', 'size': '3011'}