<jupyter_start><jupyter_text>Results analysis Notebook Author: Robert  Date: January 3, 2020 Purpose of this notebook is to analyze the results obtained when changing opponents possible max scores<jupyter_code>## library imports

import pandas as pd ## for data manipulation
import numpy as np ## also for data manipulation
import matplotlib.pyplot as plt ## for plotting
from mpl_toolkits import mplot3d ## for 3D plotting 
## reading in results 

df = pd.read_csv(r"scoredbasedloopedopponentscores.csv") ## results of looping opponent's possible maximum score
df
## sorting values for some reason 

df = df.sort_values(by=['Score','MaxOpponentScore'],ascending=[True,True]).reset_index(drop=True)
df
## showing matrix of win pcts based on score of the player and their opponent's maximum score value

df_pivoted = df.pivot(index="MaxOpponentScore",columns="Score",values="WinPercentage")
df_pivoted
## contour plot

fig,ax = plt.subplots(1,figsize=(10,10))
contour = ax.contour(df_pivoted.columns,df_pivoted.index,df_pivoted,levels=10)
ax.clabel(contour, inline=1, fontsize=10)
ax.set_xlabel("Player Chosen Score",fontweight='bold')
ax.set_ylabel("Maximum Opponent Chosen Score",fontweight='bold')
plt.show()
## creating 2d matrices of combinations of score chosen by the player and max opponent score 
xx,yy = np.meshgrid(df_pivoted.columns,df_pivoted.index)
## 3D scatter plot of results

fig = plt.figure(figsize=(10,10))
ax = plt.axes(projection='3d')
ax.scatter3D(df.Score,df.MaxOpponentScore,df.WinPercentage)
ax.set_xlabel('Player Threshold Score',fontweight='bold')
ax.set_ylabel('Opponent Threshold Score',fontweight='bold')
ax.set_zlabel('Player Win Percentage',fontweight='bold')
plt.show()
df_pivoted.values.shape
xx.shape
yy.shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1104225352112676, 'fraction_numerical': 0.014084507042253521, 'mean_word_length': 7.299065420560748, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '168967', 'license': 'MIT', 'n_tokens_mistral': 610, 'n_tokens_neox': 569, 'n_words': 153, 'path': '.ipynb_checkpoints/Score based analysis - opponent max score-checkpoint.ipynb', 'repo_name': 'calicorob/DiceGame', 'size': '1775'}