Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Simpson committed Jun 14, 2023
1 parent aae3a7b commit 2188cf7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 42 deletions.
24 changes: 13 additions & 11 deletions analysis/team_gen_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"source": [
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import numpy as np \n",
"import pandas as pd \n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"sns.set()\n",
"plt.style.use('ggplot')\n"
"plt.style.use(\"ggplot\")"
]
},
{
Expand Down Expand Up @@ -220,15 +221,16 @@
}
],
"source": [
"from glob import glob \n",
"from glob import glob\n",
"\n",
"data_folder = glob(\"../outputs/*\")\n",
"\n",
"tdfs = []\n",
"\n",
"for folder in data_folder:\n",
" files=glob(folder + \"/*.csv\")\n",
" files = glob(folder + \"/*.csv\")\n",
" tdf = pd.concat([pd.read_csv(f) for f in files])\n",
" tdf['generation'] = folder.split('/')[-1]\n",
" tdf[\"generation\"] = folder.split(\"/\")[-1]\n",
" tdfs.append(tdf)\n",
"\n",
"data = pd.concat(tdfs)\n",
Expand Down Expand Up @@ -262,8 +264,8 @@
}
],
"source": [
"n_poke_per_gen = data.groupby('generation')['0'].nunique().sort_values(ascending=False)\n",
"fig, ax = plt.subplots(1, figsize=(5,5), dpi=100)\n",
"n_poke_per_gen = data.groupby(\"generation\")[\"0\"].nunique().sort_values(ascending=False)\n",
"fig, ax = plt.subplots(1, figsize=(5, 5), dpi=100)\n",
"\n",
"ax.plot(np.arange(len(n_poke_per_gen)), n_poke_per_gen)\n",
"ax.set_ylabel(\"Number of Unique Pokemon\")\n",
Expand Down Expand Up @@ -518,10 +520,10 @@
}
],
"source": [
"tmp = data.groupby(['0','generation'])['0'].count().reset_index(name='count') \n",
"tmp = data.groupby([\"0\", \"generation\"])[\"0\"].count().reset_index(name=\"count\")\n",
"for gen in data.generation.unique():\n",
" fig, ax = plt.subplots(1, figsize=(10,10), dpi=100)\n",
" sns.barplot(data=tmp[tmp['generation']==gen], y='0', x='count', ax=ax)\n",
" fig, ax = plt.subplots(1, figsize=(10, 10), dpi=100)\n",
" sns.barplot(data=tmp[tmp[\"generation\"] == gen], y=\"0\", x=\"count\", ax=ax)\n",
" ax.set_title(f\"Generation: {gen}\")\n",
" fig.savefig(f\"{gen}.png\")"
]
Expand Down
63 changes: 32 additions & 31 deletions hypotheses_pseudocode.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,36 @@
- Team size: 1
- Total Pokemon: 151
- Battle Mode: ???
- Starting number of teams: 151*151
- Number of Battles per pairing: ???
- Starting number of teams: 151\*151
- Number of Battles per pairing: ???
- Generations: `0`
- Mutation rate: `0`
- Breeding: `Off`
- Loss Shuffle: `Off`

### Hypotheses:
### Hypotheses:

Is there a decay function for the number of battles? The win ratio should converge which will give us a good understanding of the number of battles required.
Is there a decay function for the number of battles? The win ratio should
converge which will give us a good understanding of the number of battles
required.

How does this change based on the battle-mode? Is there a "good enough" mode that doesn't take too long?
How does this change based on the battle-mode? Is there a "good enough" mode
that doesn't take too long?

Do we find all the S tier pokemon from the fan rankings?
Do we find all the D tier pokemon from the fan rankings?
Do we find all the S tier pokemon from the fan rankings? Do we find all the D
tier pokemon from the fan rankings?

Plotting in 2d using the sprites. The first dimension is the fitness, second dimension:
- Base stat total = sum (hp, attack, defence, special attack, special defence, special speed)
Plotting in 2d using the sprites. The first dimension is the fitness, second
dimension:

- Base stat total = sum (hp, attack, defence, special attack, special defence,
special speed)
- HP
- Attack
- Anything else

Nearest k-nearest neighbours clusters using fitness values, what tiers have we found?


Nearest k-nearest neighbours clusters using fitness values, what tiers have we
found?

## 2v2 Pokemon Battles

Expand All @@ -47,26 +52,29 @@ Nearest k-nearest neighbours clusters using fitness values, what tiers have we f
- Breeding: `Off`
- Loss Shuffle: `On`

### Hypotheses:
### Hypotheses:

Are there synergestic pairs that have greater wins compared with the top tier solo pokemon?
Are there synergestic pairs that have greater wins compared with the top tier
solo pokemon?

Are there pairings of Pokemon types that stand out? (fire and water)

What is the base rate of synergy? Can we see clusters of all the [Type1&Type2] pairs or are there some stand out power couples?
What is the base rate of synergy? Can we see clusters of all the [Type1&Type2]
pairs or are there some stand out power couples?

2d clusterplot: first dimension is fitness, second dimension:

- Categorical Pairs by type
- Sum of base stats

Can we find a diminishing returns number of battle repeats that converge on an
answer?

Can we find a diminishing returns number of battle repeats that converge on an answer?

Can we find a diminishing returns number of generations that converge on an answer?

What happens with a high versus low mutation rate? to how quickly it finds an answer and how variable the result is.

Can we find a diminishing returns number of generations that converge on an
answer?

What happens with a high versus low mutation rate? to how quickly it finds an
answer and how variable the result is.

## 6v6 Pokemon Battles

Expand All @@ -82,20 +90,13 @@ What happens with a high versus low mutation rate? to how quickly it finds an an
- Breeding: `On`
- Loss Shuffle: `Off`

### Hypotheses:
### Hypotheses:

Which is the best Pokemon team?

Are the best teams very related to the top Pokemon, or are there plenty of wildcards?
Are the best teams very related to the top Pokemon, or are there plenty of
wildcards?

Are the synergestic pairs in the top teams?

What are the spread of types in the top teams?








0 comments on commit 2188cf7

Please sign in to comment.