从最终用户角度来看外部结构_从不同角度来看您最喜欢的游戏

从最终用户角度来看外部结构

The complete python code and Exploratory Data Analysis Notebook are available at my github profile;

完整的python代码和Exploratory Data Analysis Notebook可在我的github个人资料中找到 ;

Pokémon is a Japanese media franchise, that began as Pokémon Red and Pokémon Green, a pair of video games for the original Nintendo’s Game Boy, that were developed by Game Freak and published by Nintendo in February 1996. Pokémon has since become the highest-grossing media franchise of all time, with $90 billion in total franchise revenue.

神奇宝贝是日本媒体特许经营权,开始作为口袋妖怪红口袋妖怪绿,一对视频游戏原任天堂的Game Boy,通过游戏怪物进行了开发和任天堂在1996年2月公布了神奇宝贝已经成为最卖座媒体特许经营史,总特许经营收入为900亿美元。

Pokémon — Wikipedia Article

神奇宝贝—维基百科文章

Pokémon games, specially the ones from the first and second generations: Pokémon Red, Blue, Yellow, Gold, Silver and Crystal were really remarkable for the entire generation born in the 90’s — myself included. These days, I was looking for some datasets at the Kaggle website, and I ended up finding this post where the author had given data sets containing Pokémon and in game Pokémon combats data, and proposed a challenge: Build up a model that is able to predict the outcome of a battle between two Pokémon, based on the given data.

神奇宝贝游戏,特别是第一代和第二代游戏: 神奇宝贝红,蓝,黄,金,银和水晶对于90年代的整个一代来说都是非常了不起的-包括我自己。 这些天来,我一直在Kaggle网站上寻找一些数据集,最后发现这篇文章 ,作者在其中给出了包含神奇宝贝的数据集,并在游戏中为神奇宝贝战斗数据提供了建议,并提出了一个挑战:建立一个能够根据给定的数据预测两个神奇宝贝之间的战斗结果。

Merging my childhood hobbies with my current ones? Sounds good, so I’m game!

将我的童年爱好与当前的爱好融合在一起? 听起来不错,所以我在玩游戏!

数据集 (Datasets)

The Weedle’s Cave post at Kaggle provided the following datasets:

Kaggle的Weedle's Cave帖子提供了以下数据集:

Pokémon Dataset | 800 Inputs , 12 FeaturesThis Dataset contains data from all the Pokémon released until the 6th generation;

神奇宝贝数据集 | 800个输入,12个功能此数据集包含所有发行到第六代的神奇宝贝的数据;

# — Pokemon Index (Not the same used in the original franchise lists, as Mega Evolutions are listed right after the pokemon on it’s normal form);

—口袋妖怪指数( 与原始特许经营列表中使用的不一样,因为《 Mega Evolutions》是在口袋妖怪之后以其正常形式列出的);

Name — Pokemon’s Name;

名称 -宠物小精灵的名字;

Type 1 — Pokemon’s primary type;

类型1-口袋妖怪的主要类型;

Type 2 — Pokemon’s secondary type(All pokemons have a primary type, but not necessary a second one );

类型2-口袋妖怪的次要类型(所有口袋妖怪都具有主要类型,但不一定是第二个)。

HP — Health Points base stats;

HP -Health Points基本统计数据;

Attack — Phisycal Attack base stats;

攻击 -物理攻击基本属性;

Defense — Phisycal Defese base stats;

防御 -物理防御的基本属性;

Sp. Atk — Special Attack base stats;

Sp。 魔法攻击 -特攻基础数据;

Sp. Def — Special Defense base stats;

Sp。 Def —特殊防御基础统计;

Speed — Speed base stats;

速度 -速度基准统计信息;

Generation — Which generation of the franchise games this Pokémon belongs;

一代 -神奇宝贝属于哪一类特许经营游戏;

Legendary — Indicates if the Pokémon belong to the legendary group;

传奇 —指示神奇宝贝是否属于传奇组;

Image for post
Pokémon Dataset’s Head
神奇宝贝数据集的头

Combat Datasets | 50000 inputs, 3 inputsThis dataset contains data from Pokémon combats, listing the two Pokémon envolved by their index (#), and which one have ended up the battle as the winner:

战斗数据集 | 50000次输入,3次输入此数据集包含来自神奇宝贝战斗的数据,列出了由其索引( )演变而来的两个神奇宝贝,其中一个以胜利者的身份结束了这场战斗:

First_Pokemon — Trainer A’s Pokémon # (index) — (The Pokémon which have attacked first will always be listed as “First_Pokemon”);

First_Pokemon —教练A的神奇宝贝 (索引)((先攻击的神奇宝贝将始终列为“ First_Pokemon”);

Second_pokemon — Trainer B’s Pokémon # (index);

Second_pokemon —培训师B的神奇宝贝 (索引);

Winner# (index) of the Pokémon which have won the battle;

获胜者 -赢得战斗的神奇宝贝 (索引);

Image for post
Combat Dataset’s Head
战斗数据集的头

神奇宝贝大战如何运作? (How does a Pokémon Battle work?)

Before moving into the Exploratory Data Analysis (EDA), it’s important to understand how single Pokémon battles work (there are double battles as well, but that’s not the case of the ones recorded on the dataset).

在进入探索性数据分析(EDA)之前,重要的是要了解单次神奇宝贝战斗是如何进行的(也有双重战斗,但记录在数据集上的情况并非如此)。

Pokémon combats follow the usual RPG games model: Battles are taken in turns, where each participant is able take actions once per turn (not simultaneously), and the first one to reduce the opponent’s Health Points to zero, is the winner. At the franchise games, the actions are taken by Pokémon Trainers, whose are able to choose attacking the foe’s Pokémon, using an item or even switch it’s own Pokémon for another one in the team (trainers are allowed to carry up to 6 Pokémon with them).

神奇宝贝的战斗遵循通常的RPG游戏模式:战斗是轮流进行的,每个参与者每回合可以执行一次动作(而不是同时进行),而将对手的健康点降低到零的第一个游戏是获胜者。 在特许经营游戏中, 神奇宝贝训练师会采取行动,他们可以选择攻击敌人的神奇宝贝,使用一件物品,甚至将自己的神奇宝贝换成团队中的另一个神奇宝贝(训练员可以携带最多6只神奇宝贝)。

As mentioned above, the metric used to determine who’s the winner is the Health Points, or HP shortly. The amount of HP each Pokémon have is given by the following equation:

如上所述,用于确定谁是获胜者的指标是健康点,或简称为HP 。 每个神奇宝贝拥有的HP量由以下公式给出:

Image for post
Source: https://bulbapedia.bulbagarden.net/wiki/Statistic
资料来源: https : //bulbapedia.bulbagarden.net/wiki/Statistic

The given datasets only provides the HP Base Stats (highlighted at equation). All the other variables (Individual Values: IV, Effort Values: EV and Level) are mechanics and engines developed in game and won’t be considered in the analysis, as there’s no way to find out this values for the combats recorded at the dataset. However, as shown in the equation, the total HP is directly proportional to the Base Stats HP. In other words, the higher the base stat, the higher is the amount of HP a Pokémon may achieve when fully trained.

给定的数据集仅提供HP基本统计信息 (以等式突出显示)。 所有其他变量(“个体值: IV” ,“努力值”: EV和“ 水平” )都是游戏中开发的机制和引擎,因此不会在分析中予以考虑,因为无法找到记录在数据集上的战斗的该值。 但是,如等式所示,总HP与基础统计HP成正比。 换句话说,基本属性越高,经过充分训练的神奇宝贝可以达到的HP数量就越高。

In order to reduce the opponent’s HP to zero and win the battle, Pokémons are able to use Battle Moves, which are special moviments used to inflict damage, enhance stats or cause some effects at the opponent or even to the environment. In the case of offensive Battle Moves, that being the ones which inflict some damage and reduce the foe’s HP, the damage dealt is calculated using the following equation:

为了将对手的生命值降低到零并赢得战斗,神奇宝贝可以使用战斗动作,这是一种特殊的动作,用于造成伤害,提高属性或对对手甚至对环境造成某些影响。 在进攻性战斗动作的情况下,由于造成一些伤害并降低了敌人的生命值,因此造成伤害的计算公式如下:

Image for post
Source: https://bulbapedia.bulbagarden.net/wiki/Damage
资料来源: https : //bulbapedia.bulbagarden.net/wiki/Damage

Where:

哪里:

Image for post
Source: https://bulbapedia.bulbagarden.net/wiki/Damage
资料来源: https : //bulbapedia.bulbagarden.net/wiki/Damage

A/D is the ratio between the effective Attack stat of the attacking Pokémon and the effective defense stat of the target Pokémon. “Effective” comes from the fact that there are two types of damage: Physical and Special (in a simple analogy, let’s says it would be something like “magical”). For each of these, specific stats are taken for the A/D factor calculation:Physical moves use attacking Pokémon’s Attack stat, and target’s Defense stat. On the other hand, Special moves consider attacking Sp. Attack stat and target Sp. Defense stat.

广告 是攻击神奇宝贝的有效攻击状态与目标神奇宝贝的有效防御状态之间的比率。 “有效”来自以下事实:两种类型的损害:物理损害和特殊损害(简单地说,这就像“魔术”一样)。 对于上述每一项,都会采用特定的统计数据进行A / D因子计算: 物理移动使用攻击神奇宝贝的“ 攻击”统计和目标的“ 防御”统计。 另一方面, 特殊动作考虑攻击Sp。 攻击统计和目标Sp。 国防统计。

Similarly to the HP, these stats are given by an equation, and the final value is directly proportinal to the respective Base Stat value, which is the only information given for all Pokémon in the Pokémon Dataset.

HP相似这些统计信息由一个方程式给出,最终值与各自的基础统计信息值成正比,这是Pokémon数据集中所有神奇宝贝的唯一信息

Image for post
Source: https://bulbapedia.bulbagarden.net/wiki/Statistic
资料来源: https : //bulbapedia.bulbagarden.net/wiki/Statistic

The other piece of information we have to build up our analysis is the Type factor. Long story made short: All Pokémon have a Type, which is something like an essential element of it’s body composition. Actually, every Pokémon have at least one Type, but it’s possible for them to have up to two Types: a primary and a secondary one.

我们需要进行分析的另一条信息是类型因子。 简而言之:所有神奇宝贝都拥有一种Type,这就像它的身体组成中必不可少的元素。 实际上,每个神奇宝贝都有至少一种类型,但它们最多可能具有两种类型 :主要类型和次要类型

Every Type has specific iteractions with others, being strong, weak, neutral or imune . Also, every Battle Move is associated to one type, so this Type factor shown on the damage equation is the attacking move type x target type damage multiplier. (Don’t panic, we are getting there soon).

每种类型都有与其他类型的特定迭代,包括强,弱,中性或免疫。 另外,每个战斗动作都与一种类型相关联,因此伤害方程式上显示的此类型因子攻击动作类型 x 目标类型伤害乘数。 (不要着急,我们很快就会到达那里)。

Hence, for this analysis we will consider that damage is directly proportional to the product of A/D factor and the Type damage multiplier factor, which are the information available at the datasets.

因此,在此分析中,我们将考虑损害与A / D因子和类型损害乘数因子的乘积成正比,这是数据集上可用的信息。

Sound good so far, right? Despite the fact of not having all the necessary information to compute a complete and fully accurate calculations, knowing how to calculate the Type damage multiplier, there’s at least enough information to build up some good ideas about the maths behind Pokémon battles. Then, this is the immediately next step!

到目前为止听起来不错,对吗? 尽管没有足够的信息来计算完整且完全准确的计算,尽管知道如何计算类型伤害乘数 ,但至少有足够的信息可以为神奇宝贝战斗背后的数学知识建立一些良好的思路。 然后,这是下一步。

如何计算类型伤害乘数系数? (How to calculate the Type damage multiplier factor?)

Now that we know what are Pokémon types, and that they’re really important to the damage calculation, it’s time to know which types are out there in the Pokémon world:

现在我们知道了什么是神奇宝贝类型,并且它们对于伤害计算非常重要,是时候知道神奇宝贝世界中存在哪些类型了:

Image for post
image credits: https://pokemon.fandom.com/wiki/Types
图片来源: https : //pokemon.fandom.com/wiki/Types

Each of these types has a offensive and defensive relation to all the others, and this information is given by Game Freak after every new generation release. I’ve taken the most recent Type chart at the Bulbapedia and created a new dataframe, containing the exact same information shown on the figure below:

这些类型中的每一个都与其他所有类型都具有进攻和防御关系,并且在每个新一代发行之后,Game Freak都会提供此信息。 我已在Bulbapedia上获取了最新的“类型”图表,并创建了一个新的数据框,其中包含与下图所示完全相同的信息:

Image for post
Pokémon’s Type Chart
神奇宝贝的类型表

This chart gives us the directly relation of all the types in respect to the others, offensively (references at the horizontal) and defensively (references at the vertical).

该图表为我们提供了所有类型相对于其他类型的直接关系,包括进攻性(水平处的参考)和防御性(垂直处的参考)。

Example given: Electric types have have a damage multiplier equal to 2 when attacking a Water type, 0.5 attacking a Grass type, equal to 1 against a Fire type, and finally, equal to 0 when attacking a Ground type enemy. Then, we can say that, Electric moves:

给出的示例: 电气类型在攻击类型时具有2的伤害倍数,在攻击类型时具有0.5的伤害倍数,在攻击类型时具有1的伤害倍数,最后在攻击地面类型敌人时具有0的伤害倍数。 然后,我们可以说,电气公司采取以下行动:

  • Are Super Effective against Water types;

    类型超级有效

  • Are Not Very Effective against Grass types;

    类型不是很有效

  • Are Neutral against Fire types;

    火灾类型持中立态度;

  • Does not affect Ground types;

    不影响接地类型;

Given this four possible interactions between types, and the Type Chart, it is possible now to calculate the Type Damage Multiplier factors for all the Pokémon combats, right?

鉴于类型与类型表之间的这四种可能的相互作用,现在可以计算所有神奇宝贝战斗的类型伤害倍数因子,对吗?

还没! (Not yet!)

As I’ve mentioned before, it’s possible for a Pokémon to have a secondary type. In fact, until the 6th generation of games released by the Japanese Franchise, which is the data included at the Pokémon Dataset, only 48.25% of all Pokémon have just a primary type.

正如我之前提到的,神奇宝贝有可能具有第二种类型。 实际上,直到《神奇宝贝》数据集所包含的数据(由日本特许经营公司发行的第六代游戏)开始,所有神奇宝贝中只有48.25%的游戏只是主要类型。

As the majority of Pokémon have two types, and the interaction factor are cumulative, we need a way to calculate the resultant interaction of multiple types. Since the Combat Dataset does not provide any information regarding which actions have been taken during the battle, I’m taking some assumptions to simplify the analysis: One’s going to consider that:

由于大多数神奇宝贝都有两种类型,并且相互作用因子是累积的,因此我们需要一种方法来计算多种类型的最终相互作用。 由于“ 战斗数据集 ”没有提供有关战斗中采取了哪些行动的任何信息,因此我采取一些假设来简化分析:我们将考虑以下几点:

  • Pokémons have only used Battle Moves from it’s own types during battle — Example, a Fire/Flying such as Charizard is only able to use Fire moves or Flying moves (Battles moves have only one type associated to them);

    小宠物在战斗中只用战移至从它自己的类型-例如, / 如喷火龙是唯一能够使用火移动或移动飞(战斗技有与之关联的只有一种类型);

  • Pokémon trainers will always choose the best battle move option (when applicable) for their Pokémon to use in order to cause as much damage as possible to the enemy’s Pokémon.

    神奇宝贝训练师将始终选择最佳的战斗移动选项(如果适用)供其神奇宝贝使用,以对敌人的神奇宝贝造成尽可能多的伤害。

Author’s Note: It’s absolutely possible and normal for Pokémons to know Battle Moves from other types than their own ones, and more experienced players always choose to teach their Pokémon moves from types that might offer them some coverage for their weaknesses (Pokémons are able to know up to 4 moves at the same time). However, this analysis won’t consider this fact due to the lack of information on the combat dataset;

作者注:神奇宝贝完全可以从其他类型上了解自己的战斗招式,并且经验丰富的玩家总是选择从可能为他们的弱点提供掩护的类型上教他们的神奇宝贝招式(神奇宝贝能够知道同时最多4个动作)。 但是,由于战斗数据集缺乏信息,因此该分析不会考虑这一事实。

In order to understand how to calculate the Type Damage Multiplier factor, a simple example might be useful.

为了了解如何计算类型损害乘数因子,一个简单的示例可能会有用。

Imagine that two Pokémon trainers have met and decided to test who’s the best through a battle. Trainer #1 has a Charmander, and Trainer #2 has a Shuckle. Supposing that Charmander has higher Speed stats, Trainer #1 will take actions first.

想象一下,有两个神奇宝贝教练见过面,并决定通过战斗来测试谁是最好的。 培训师#1有一个玩火人,而培训师#2有一个a 子。 假设Charmander具有较高的速度统计信息,则Trainer#1将首先采取行动。

Note: Speed stat is used to decide which Pokémon will move first at battles. The standard rule for it is quite simple: the fastest moves first. Speed stat is given by the same equation shown before for other stats than HP, however using the Speed base stats instead. Just for the record, there are in game mechanics that override the standard Speed rule for selecting which Pokémon moves first, such as Priority Moves or Hold Items — However, once again, there’s not included at this analysis scope since there’s no data regarding these combat details.

注意:速度统计用于确定战斗中哪个神奇宝贝将首先移动。 它的标准规则很简单:最快的动作优先。 对于除HP以外的其他统计信息速度统计信息由前面显示的等式给出但是改用速度基准统计信息。 仅作记录,游戏机制中有一些优先选择标准的速度规则来选择哪个神奇宝贝首先移动,例如“优先移动”或“持有物品”-但是,由于没有关于这些战斗的数据,因此在此分析范围内也没有包括细节。

Image for post
Type Damage Multiplier Factor, Best A/D factor and类型伤害倍增因子,最佳A / D因子 Proportional Damage Factor of Charmander’s attacks on Shuckle比例伤害因子
  • As Charmander has only one type, Fire, there’s no option here regarding which move type to use. It will for sure use a Fire move;

    由于Charmander只有一种类型,即Fire,因此这里没有使用哪种移动类型的选择。 它一定会使用火招;

  • On the other hand, Shuckle has two types: Bug and Rock. So it’s necessary to consider how Fire moves interact with these two types, and merge these interactions together into a final number;

    另一方面, Shuckle有两种类型: BugRock 。 因此,有必要考虑Fire动作如何与这两种类型进行交互,并将这些交互合并为一个最终的数字。

  • Using a Special Move is the best option, as it end up in being a better A/D factor;

    使用“特殊移动”是最好的选择,因为它最终会成为更好的A / D因子。

  • Knowing the Type Damage Multiplier Factor and the Best A/D Factor, it’s known from the complete damage equation shown before in this article, that the output damage is directly proportional to the product of this two numbers.

    从本文前面显示的完整损伤方程式可以知道类型损伤乘数因子最佳A / D因子 ,即输出损伤与这两个数字的乘积成正比

Image for post
Type Damage Multiplier Factor, Best A/D factor and类型伤害倍增因子,最佳A / D因子 Proportional Damage Factor of Shuckle’s attacks on Charmander比例伤害因子
  • Looking at the Shuckle’s perspective as the attacker, there’s an essential difference: Shuckle has two types, so it’s trainer must decide which move type is the best option to inflict as much damage as possible on the foe’s Charmander;

    Shuckle作为攻击者角度来看,有一个本质上的区别: Shuckle有两种类型因此,培训师必须确定哪种移动类型是对敌人的Charmander造成尽可能多伤害的最佳选择

  • For Shuckle, physical attacks are the best option — as Physical A/D Factor is higher than the Special A/D Factor;

    对于Shuckle而言,物理攻击是最佳选择-因为物理A / D因子高于特殊A / D因子

Considering the interactions of the two types of both Pokémons, there are six possible values for Type Damage Multiplier Factor :

考虑到两种神奇宝贝的两种类型的相互作用, 类型伤害倍增因子有六个可能的值

Type Advantage

类型优势

  • 4: Both of target’s types are weak against the attacking one;

    4 :目标的两种类型均较弱。

  • 2: One of target’s type is weak and the other is neutral against the attacking one;

    2:目标的一种类型较弱,另一种对攻击的类型是中立的;

Neutral Interaction

中性相互作用

  • 1: Either both of target’s type are neutral to the attacking one, or one of the target’s types is strong and the other weak against the offensive one;

    1 :目标的两种类型都对攻击方中立,或者目标的一种类型在攻击方中是强而另一种则对攻击性较弱;

Type Disadvantage

类型劣势

  • 0.5: One of target’s type is strong and the other is neutral against the attacking one;

    0.5 :目标的一种类型强,另一种对攻击型中立;

  • 0.25: Both of target’s types are strong against the attacking one;

    0.25 :目标的两种类型都强于攻击型;

  • 0: At least one of the Target’s type is imune to the offensive one;

    0 :目标的至少一种对攻击性免疫。

All of that being said, we have now a good idea of which features to analyze in order to better understand which are the most important factors for a Pokémon to end up a combat as a winner.

综上所述,我们现在对要分析哪些功能以更好地了解哪些是神奇宝贝最终成为胜利者的战斗的最重要因素有了一个好主意。

However, none of the valuable information regarding combats were directly given, as the Pokémon Dataset has only individual Pokémon characteristics, and the Combats Dataset only informs which Pokémons where battling and which one was the winner. Then, it was necessary to build an ETL pipeline — extracting all the necessary information from all the three datasets, transform the data through the calculatation of all the valuable features to understand combat winner’s characteristcs (based on the knowledge built on how Pokémon Battles work) and loading everything into a new data set, which I named Pokémon Combats Dataset.

但是,没有直接提供任何有关战斗的有价值的信息,因为《Pokémon数据集》仅具有个别的Pokémon特性,而《 Combats Dataset》仅告知哪些Pokémons在哪里作战,哪一个是获胜者。 然后,有必要建立一个ETL管道-从所有三个数据集中提取所有必要的信息,通过计算所有有价值的特征来转换数据,以了解战斗获胜者的特征(基于关于神奇宝贝战斗原理的知识)并将所有内容加载到一个新数据集中,我将其命名为“ PokémonCombats Dataset”。

Image for post
ETL Pipeline Applied to the original data
ETL管道应用于原始数据

As well as the complete code for the ETL pipeline and the full data analysis, the resulting Pokémon Combat Dataset is available at the project’s repo at my github profile.

除了ETL管道的完整代码和完整的数据分析之外,生成的PokémonCombat Dataset也可以在我的github profile的项目仓库中找到 。

This new data set is composed by 35 features:

此新数据集由35个功能组成:

First_Pokemon — Trainer A’s Pokémon # (index) — (The Pokémon which have attacked first will always be listed as “First_Pokemon”);

First_Pokemon —教练A的神奇宝贝 (索引)((先攻击的神奇宝贝将始终列为“ First_Pokemon”);

Second_pokemon — Trainer B’s Pokémon # (index);

Second_pokemon —培训师B的神奇宝贝 (索引);

Winner# (index) of the Pokémon which have won the battle;

获胜者 -赢得战斗的神奇宝贝 (索引);

Base Stats Differences — Difference between base stats for both Pokémon (6 features, one feature per stat: HP, Attack, Defense, Sp. Attack, Sp. Defense, Speed);

基本统计数据差异 -两个神奇宝贝的基本统计数据之间的差异( 6个功能 ,每个统计数据一个功能:HP,攻击,防御,特殊攻击,特殊防御,速度);

Differences Between Effective Stats — Difference of effective stats used for damage calculation for both Pokémon (8 features, Differences between: Attack and HP, Attack and Defense, Sp. Attack and HP, Sp. Attack and Sp. Defense, for the two combinations of Attacker / Target);

有效统计数据之间的差异 —两种神奇宝贝的伤害计算所用的有效统计数据的差异( 8个要素 ,两种组合的攻击和生命值,攻击和防御,Sp。Attack和HP,Sp。Attack和Sp.Defence之间的差异)攻击者/目标);

A/D Factors — Effective A/D Factores used in the Damage Equation (4 features, the two possible A/D factors (Physical and Special) for the two possibilities of Attacker / Target;

A / D因子 -伤害方程中使用的有效A / D因子( 4个功能 ,针对攻击者/目标的两种可能性的两种可能的A / D因子(物理和特殊);

Type Damage Multipliers — Type Damage Multiplier Factor (2 features, one for each possibility of Attacker / Target);

类型伤害乘数 —类型伤害乘数因子( 2个特征 ,对每种攻击者/目标都有一个特征 );

Proportional Damage Factor — Product of the highest A/D factor and type damage multiplier factor (2 features, one for each possibility of Attacker / Target);

比例伤害系数 -最高A / D系数和类型伤害乘数系数的乘积( 2个特征 ,对于攻击者/目标每种可能性一个);

Damage / HP Factor — Ratio between Proportional Damage Factor and Target’s HP Base Stat (2 features, one for each possibility of Attacker / Target);

伤害/生命值系数 —比例伤害因数与目标的HP基本统计值之间的比率( 2个功能 ,每一种可能的攻击者/目标);

Pokémon Types — Primary and Secondary (if any) type of each Pokémon (4 features);

神奇宝贝类型 -每个神奇宝贝的主要和次要类型 (如果有)( 4个功能 );

Legendary Pokémon — Flags indicating of any of the Pokémon involved in the combat was a legendary one (2 features);

传奇的神奇宝贝 -表示参与战斗的任何神奇宝贝的旗帜是传奇人物( 2个特征 );

Priority— Flag indicating that the Pokémon witgh the lowest Speed Base Stat have moved first;

Priority(优先级) —表示口袋妖怪拥有最低速度基准状态的标记已首先移动;

Pokémon 1 has won — Flag indicating that the Pokémon which have striked first ended up winning the combat (This is going to be used as the target variable for the predictive model);

神奇宝贝1已获胜 -表示先罢工的神奇宝贝最终赢得了战斗的旗帜(这将用作预测模型的目标变量);

Now, based on this new dataset, combined with the individual Pokémon data from the Pokémon Dataset, it’s possible to perform an Exploratory Data Analysis in order to better understand the most relevant factors that lead to winning Pokémon Battles.

现在,基于此新数据集,再结合神奇宝贝数据集中的各个神奇宝贝数据,可以执行探索性数据分析,以便更好地理解导致神奇宝贝之战胜利的最相关因素。

探索性数据分析 (Exploratory Data Analysis)

快速回顾一下: (Quick recap here:)

- We know that battles are won inflicting damage over the enemy’s Health Points untill they are reduced to zero;- Damage is a function of many variables, however is directly proportional to the product of two factors: A/D factor and Type Damage Multiplier;- A/D factor is given by the division of Pokémon’s effective stats, which on the other hand, are directly proportinal to the respective Base Stats, that are available for us on the datasets;- Type Damage Multiplier can be calculated using the procedure shown previously on this article;

-我们知道战斗获胜对其敌人的健康点造成伤害 ,直到它们降低到零为止;- 伤害是许多变量的函数,但是与两个因素的乘积成正比: A / D因素类型伤害乘数-A / D因子由神奇宝贝的有效属性除以给定,而有效属性除以与各自基础属性成正比的比例,这些基础属性在数据集上可供我们使用;- 类型伤害倍数可以使用所示过程来计算先前在本文上;

Hence, given the Pokémon battle dynamics and the data available, the analysis to understand which are the most valuable characteristics for a Pokémon to have, in order to win combats will be based on the two factors that compose damage: Base Stats (and all the proportional factors one might derive from them) and Type Interactions.

因此,考虑到神奇宝贝的战斗动态和可用数据,为了赢得战斗,要分析哪些是神奇宝贝具有的最有价值的特征,将基于构成伤害的两个因素进行分析: 基本统计数据 (以及所有一个可能从中得出的比例因子) 类型的相互作用

基本统计 (Base Stats)

Which is the most relevant stat for winning combats? Generally, is it worth to use Pokémons with defensive characteristics during your journey, or being offensive is more effective?

赢得战斗最相关的统计数据是? 通常,在旅途中值得使用具有防御特性的神奇宝贝,还是进攻更有效?

The best way to answer these questions, is to look at the difference of base stats between Pokémons which have won their battles, and the ones which have been defeated:

回答这些问题的最佳方法是,查看赢得战斗的神奇宝贝与被击败的神奇宝贝之间的基本属性差异:

Image for post
Distribution of the Base Stats difference between Winner and Looser Pokémon
优胜者和神奇宝贝神奇宝贝之间的基本统计差异分布

These distribution plots give us some some valuable information:

这些分布图为我们提供了一些有价值的信息:

  • Generally, as it might be the general intuition, Pokémons with higher Base Stats compared to it’s opponent, end up winning the combat;

    通常,由于通常的直觉,与对手相比,拥有更高基本属性的神奇宝贝最终会赢得战斗;
  • Higher offensive base stats (Attack and Sp. Attack) seems to be more relevant than higher defensive stats (HP, Defense and Sp. Defense);

    较高的进攻基础数据( 攻击特殊攻击 )似乎比较高的防御统计( HP防御特殊防御 )更相关;

  • While the distribution of all other stats are almost symmetric, being only slightly displaced and skewed to the right, the Speed Base Stat is severely right skewed — showing itself as the most relevant base stat for winning combats, by far;

    尽管所有其他统计数据的分布几乎都是对称的,只是略微偏移并向右偏斜,但速度基准统计数据却严重偏向右-使其成为迄今为止赢得战斗最相关的统计数据

This result is really interesting, as Speed stats are basically only used to define which Pokémon moves first at the turn. As we might recall from the data explanation on the beggining of this article, the Combat Dataset places as Pokémon #1 the one which have striked first.

这个结果真的很有趣,因为速度统计信息基本上仅用于定义哪个神奇宝贝在转弯处首先移动。 我们可能从本文开头的数据解释中回想起,《 战斗数据集》将《 神奇宝贝#1 》排在第一位。

However, is not true that Pokémon #1 always had higher speed base stats than Pokémon #2 — and there are many reasons for this:- We are looking at Base Stats, not the Stat itself;- There are in game mechanics that might override the standatd Speed rule for striking first (as Priority Moves, Hold Items, Item usage, Pokémon Switches and Environment Effects) — But there are no details regarding the usage of these mechanics at the datasets;

但是, 口袋妖怪#1总是比口袋妖怪#2拥有更高的速度基础统计数据是不正确的-这样做的原因很多:-我们关注的是基础统计数据,而不是统计数据本身;- 游戏机制中可能存在一些超越首先打击的标准速度规则(如优先移动持有物品,物品使用,神奇宝贝开关环境效果)—但是在数据集中没有关于这些机制的使用的详细信息

Then, during the ETL Pipeline, a feature called Prio was created to indicate the combats in which the Pokémon with the lower Speed base stats have striked first.

然后,在ETL管道中 ,创建了一个称为Prio的功能,以指示战斗中具有较低速度基础属性的神奇宝贝首先发动攻击。

Image for post
Speed base stats difference between winner and loose Pokémon — Analysis of regular speed rule override
获胜者与松散的神奇宝贝之间的速度基准统计差异-分析常规速度规则

Looking again at the base stat subtraction between winner and looser Pokémon, one is able to see that, besides the small difference, higher speed stats are still more valuable, even on combats where the Pokémon with lower base stats moved first (Priority = true).

再次查看获胜者和宽松的神奇宝贝之间的基本属性减法,人们可以看到,除了细微的差异之外,即使在具有较低基本属性的神奇宝贝先行的战斗中,更高的速度属性仍然更有价值(优先级=真) 。

Attention to the fact that, striking first on the first turn of the battle, does not mean that Pokémon #1 have striked first at all the other turns. In fact, the data shows that having the advantage of moving first every turn by the standart speed rule is the most valuable characteristic for a Pokémon to win combats.

注意在战斗的第一回合首先发动攻击的事实,并不意味着神奇宝贝#1所有其他回合中都先发动了打击。 实际上,数据显示, 凭借 神奇的 速度规则,每转一圈首先移动的优势 是神奇宝贝赢得战斗的最有价值的特征。

Hence, the data says that fast and offensive Pokémon are the best choice for your team composition while playing an adventure at actuall Pokémon games.

因此,数据表明,在实际的神奇宝贝游戏中玩冒险游戏时, 快速 进攻的神奇宝贝是组成团队的最佳选择。

This covers one side of the damage equation we’ve seen before. How about type interactions, the other proportional factor? How do them affect combat results?

这涵盖了我们之前看到的损伤方程式的一侧。 类型交互如何,另一个比例因子呢? 它们如何影响战斗结果?

比例损坏因素和类型相互作用 (Proportional Damage Factors and Type Interactions)

Looking at the base stats itself, offensive characteristics have shown to be, generally, more impactfull than defensive ones. But is it always true? How does type interactions affect it?

从基本统计数据本身来看,进攻性特征通常显示出比防御性更具影响力。 但这总是真的吗? 类型交互如何影响它?

As we’ve seen during the Pokémon battle dynamics introduction, there are three types of Type Interaction categories, either for offensive or defensive point of views:- Type Advantage — Offensive Multipliers: 4x or 2x | Defensive Multipliers: 0x, 0.25x or 0.5x;- Neutral Interactions — Offensive and Defensive Multipliers: 1x;- Type Disadvantage — (Offensive Multipliers: 0x, 0.25x or 0.5x | Defensive Multipliers: 2x, 4x ;

正如我们在《神奇宝贝》战斗动态介绍中所看到的那样,从交互或防御的角度来看,共有三种类型的“ 类型互动”类别:- 类型优势 -进攻乘数: 4倍2 | 防御乘数: 0x0.25x0.5x ;- 中立互动 -防御乘数和防御乘数: 1x ;- 类型劣势 -(攻击乘数:0 x,0.25x0.5x |防御乘数: 2x4x

How impactful are these interactions are on combats? And also, do the most valuable stats characteristcs change at different type interaction scenarios, or being offensive is always the best choice?

这些互动对战斗有多大影响? 而且,最有价值的统计数据特性是否会在不同类型的交互场景下发生变化,还是进攻总是最好的选择?

Image for post
Win Rate x Type Interactions
获胜率x类型互动

The plot above shows that, type advantages, either offensive and defensive are directly correlated to higher win rate, as the higher the offensive damage multiplier, the higher the win rate is and the the opposite happens to the defensive ones.

上图显示,进攻和防守的类型优势都与更高的获胜率直接相关,因为进攻伤害倍增系数 越高,获胜率就越高 ,而防守则相反。

It confirms the intuitive idea of strong relevance of type interactions on winning combats, as they are directly proportional to damage. However it don’t say much about most valuable Pokémon characteristics at different type interaction scenarios.

它证实了类型互动与胜利战斗有很强相关性的直观想法,因为它们与伤害成正比。 但是,对于不同类型的交互场景中最有价值的神奇宝贝特性,它并没有说太多。

In order to better understand this relation between Pokémon characteristcs at favorable or unfavorable type match ups, the box plots below may be more usefull. They represent the winner Pokémon’s A/D factors, Proportional Damage Factor (A/D * Type Damage Multiplier), and the ratio between Proportional Damage Factor and the Enemy’s HP Base Stats (multiplied for 50, to fit the plot better);

为了更好地理解口袋妖怪角色在对位或对位时的这种关系,下面的方框图可能会更有用。 它们代表获胜者的神奇宝贝的A / D因子比例伤害因子 ( A / D *类型伤害乘数 )以及比例伤害因子与敌人的HP基本属性之间的比率( 乘以50,以更好地适应情节 );

Image for post
A/D Factors at different type match ups
不同类型匹配的A / D因素
Image for post
Damage factors and Damage/ HP Ratio at different type match ups
不同类型匹配时的损坏系数和损坏/ HP比率

Most of these features had huge outliers, hence it was necessary to apply the IQR (InterQuartile Range) Method to get rid of them and proceed the analysis . Complete code and data pre-processing method are available at the original project notebook.

大多数的这些功能有异常巨大的,因此有必要应用IQR( NTER Q uartile [R安格) 方法来摆脱他们,并进行分析。 完整的代码和数据预处理方法在原始项目笔记本中可用。

These box plots reveals something really interesting:

这些箱形图揭示了一些非常有趣的东西:

  • Offensive characteristics are even more valuable for a Pokémon to win battles on type advantage scenarios (either offensive or defensive), compared to the general situation (analysis of the entire set);

    与一般情况(对整个场景的分析)相比, 进攻性特征对于神奇宝贝在类型优势 场景 (进攻性或防御性)上赢得战斗的价值更大

  • However, this is not true for type disadvantage situations. Indeed, the very opposite happens: Defensive characteristics become the most desirable ones at this type match up;

    但是,对于类型不利的情况,情况并非如此。 确实,恰恰相反的事情发生了:在这种类型的比赛中, 防御性特征成为最可取的特征

  • Neutral interactions on the other hand are quite similar to the general situation;

    另一方面, 中立的相互作用与一般情况非常相似

Merging all the information we have so far, we have that:- Type advantage enhances the probability of winning combats significantly;- Offensive characteristics are the most valuable ones at neutral and favorable type matchups;

合并到目前为止我们获得的所有信息,我们可以:-类型优势显着提高了赢得战斗的可能性;-进攻特征是中立和有利类型对决中最有价值的特征;

Combining this information with the insigths from the Base Stats analysis, one may conclude that:

将这些信息与《基本统计》分析得出的结论相结合,可以得出以下结论:

The best team composition must be based of not only fast and offensive Pokémons, but also Pokémons with types that have a higher number of favorable, or at least neutral match ups.

最好的团队组成不仅必须基于快速且具有进攻性的神奇宝贝,而且还必须基于具有更多有利(或至少是中立)对决类型的神奇宝贝。

But, which are the best types at this metrics?

但是,按此指标,哪种类型最好?

类型比赛 (Types Match Ups)

Which types offer the higher number of favorable match ups?

哪些类型的比赛对战次数更多?

The best way to start investigating this , is to count up the number of favorable and unfavorable type matchups directly from the types dataset.

开始对此进行调查的最好方法是直接从类型数据集中计算有利和不利类型匹配的数量。

Image for post
Type match up counts per Type — Split by offensive and defensive interactions
每个类型的类型匹配计数-按进攻性和防御性互动划分

The barplot above shows that the number of favorable and unfavorable match ups is not even close to be equally balanced for all the eighteen Pokémon types.

上面的小节显示,在所有18种神奇宝贝类型中,有利和不利对决数量甚至都没有达到均等的平衡

This could be the only plot one would need for this analysis if the number of Pokémons per type were equally distributed. But, is it true?

如果每种类型的神奇宝贝数量均等分布,则这可能是该分析所需的唯一情节。 但是,是真的吗?

This is the next point to be checked:

这是要检查的下一点:

Image for post
Number of Pokémons per Type
每种类型的神奇宝贝数量

Is clear that one can’t use the type match up counts plot directly as reference to understand which types could offer the higher coverage, as the number of Pokémons per type is heavily unbalanced.

很明显,由于每种类型的神奇宝贝数量严重不平衡 ,因此不能直接使用类型匹配计数图来了解哪些类型可以提供更高的覆盖率。

Hence, instead of using the count of favorable or unfavorable type match ups directly, one should use the percentage of Pokémons these match ups represents:

因此,与其直接使用有利或不利类型对战的次数,不如使用这些对战所代表的神奇宝贝的百分比:

Image for post
Percentage of Pokémons covered by each type of match up — Split by offensive and defensive interactions
每种对战类型所涵盖的神奇宝贝的百分比-按进攻和防守互动进行划分

Offensive Type Advantage

进攻型优势

Fighting and Ground, are the best types in terms of offensive advantage match up counts, having 5 favorable match ups each. However, looking at the highest percentage of Pokémon being under a favorable offensive match ups, Ice is the best one , being super effective against 39.2% of the Pokémons from this dataset;

就进攻优势对局数而言, 格斗地面是最好的类型,每个都有5个有利对局。 但是,如果在有利的进攻对局中查看神奇宝贝的最高百分比,那么Ice就是最好的,它可以有效地对抗此数据集中39.2%的神奇宝贝;

As Normal type has no advantages, the coverage percent is zero (0%) as well, being the worst type at both metrics;

由于“ 普通”类型没有优势,因此覆盖率也为零( 0% ),在两个指标上均为最差的类型;

Defensive Type Advantage

防御型优势

Steel is the best type at both metrics, with 11 defensive favorable match type match ups and 67.38% in terms of percentage of Pokémon;

钢铁是两个指标中最好的类型,有11个防守有利的比赛类型对决,神奇宝贝占67.38%

Ice and Normal types are only resistent to 1 type, however Ice is by itself at the bottom of the list in terms of percentage, with onlt 4.75%, as it only resists to itself, and it is the rarest type in the Pokémon world (considering these datasets);

普通类型只有性能稳定的1分型,但是是通过自身的按百分比计算的列表的底部,与onlt 4.75%,因为它不仅抵抗它本身,而它 是神奇宝贝世界中最稀有的类型(考虑到这些数据集);

Offensive Type Disadvantages

进攻型劣势

Grass is the worst type at both metrics, with 7 unfavorable offensive match ups and being offensively weak against 61.62% of the Pokémons;

在这两个指标上, 是最差的类型,有7个不利的进攻比赛,对61.62%神奇宝贝而言进攻能力弱。

Dragon, Ghost and Fairy are the best ones in terms of match up count, being offensively weak against 2 types each, while Dragon is alone at the top in terms of percentage, being offensively weak against only 11.85% of the Pokémons;

龙,鬼妖精都是最佳的比赛中向上计数而言,是对每2种进攻疲软, 在比例上仅排在首位,在进攻能力上仅对11.83%的神奇宝贝有所弱化;

Defensive Type Disadvantage

防守型劣势

Rock is only the worst type regarding unfavorable defensive match up counts, with 5 weaknesses. The type at the very bottom when one’s looking at Pokémon defensive weaknesses percentage is Grass: 47.5%;

对于不利的防守比赛, 摇滚是最糟糕的类型,有5个弱点。 看着神奇宝贝的防守劣势百分比时,最底层的类型是格拉斯47.5%

Electric and Normal types have only 1 weakeness each. However, Electric keeps the spot as the best one at the percentage metric, being weak against only 6.25% of the all Pokémon;

电气普通类型仅具有1个弱点。 但是,以百分比衡量, 电气公司仍然是最好的公司,仅占全部神奇宝贝的6.25%

As we’ve seen that favorable type match ups enhanced the probability of winning a Pokémon combats, when looking at the win ratio per type, one expects to see the types with the best match up percentages as the ones with the highest win ratios, as long as the combat dataset is really random, and the frequency of Pokémon Types at the recorded combats follow the same distribution of Pokémons per type.

正如我们已经看到的, 有利的类型匹配提高了赢得神奇宝贝战斗的可能性 ,当查看每种类型的获胜率时,人们希望看到具有最高匹配率的匹配类型是具有最高获胜率的类型 ,因为只要战斗数据确实是随机的 ,并且所记录的战斗中神奇宝贝类型频率遵循每种类型的神奇宝贝分布相同

Image for post
Type Frequencies in the Combat Dataset
作战数据集中的类型频率

The barplot above shows that, the types of Pokémon involved on the 50.000 recorded combats follow the same distribution of Pokémons per type, confirming that the combats were indeed chosen at random, hence one might indeed have the intuition of seeing the types mentioned above as the ones with the highest win rates.

上面的小节显示,记录的50.000场战斗中所涉及的神奇宝贝的类型遵循每种类型的神奇宝贝的相同分布,证实了这些战斗的确是随机选择的,因此人们可能确实有直觉将上述类型视为获胜率最高的人。

每种类型的获胜率 (Win Rate per Type)

Are the types that have shown the best coverage in terms of match ups, really the ones with the highest win ratios?

在比赛对局方面表现最佳的类型,真的是获胜率最高的类型吗?

In order to check it, let’s have a look at a barplot, showing the win rate per type.

为了检查它,让我们看一个条形图,显示每种类型的获胜率。

As Pokémons have Primary and Secondary types, it would be also interesting to see how this characteristics may affect win ratios. Additionally it might be usefull to understand if there are some types which are stronger by itself, and others that might work better as a complement.

由于神奇宝贝具有主要和次要类型,因此查看此特性如何影响胜率也将很有趣。 另外,了解是否存在某些类型本身会更强一些,而另一些类型可能会更好地互补可能会很有用。

Image for post
Win rates per type — General, as Primary type and as Secondary type
每种类型的获胜率-常规,主要类型和次要类型
Image for post
Best and Worst General Win Rates per Type
每种类型的最佳和最差总赢率

The result is quite surprising: higher win rates are not strongly correlated at all to higher favorable type match ups percentages. Then, which is the most relevant factor for a type to have higher win rates?

结果是非常令人惊讶的:更高的获胜率与更高的有利类型比赛比率根本没有密切相关 。 那么,哪种类型具有较高的获胜率是最相关的因素?

Following the initial ideia of this analysis, if type interactions is not the impactfull factor for the win rates, one shall check the base stats. Hence, the next step is to investigate the average base stats of each type, and find out if types have some stats characteristics embedded to them.

根据这一分析的最初想法,如果类型交互不是获胜率的影响全数因素,则应检查基本统计数据 。 因此,下一步是研究每种类型的平均基本统计信息,并确定类型是否具有嵌入其中的某些统计信息特性。

每种类型的平均基础统计 (Average Base Stat per Type)

Do Pokémon types have some specific base stats characteristic embedded into them? Is there some types more focused in Offensive stats, while other are more focused in Defensive ones?

神奇宝贝类型中是否嵌入了某些特定的基本属性? 是否有些类型更侧重于进攻统计,而其他类型更侧重于防守统计?

We are going to start investigating stats characteristics per type by finding out which are the best types at each stat (in terms of average base stats), and comparing them visually through bar plots:

我们将开始调查每种类型的统计信息特征,方法是找出每种统计信息中最好的类型(就平均基本统计数据而言),然后通过条形图直观地比较它们:

Image for post
Average HP Base Stats per Type
每种类型的平均HP基本统计
Image for post
Average Attack Base Stats per Type
每种类型的平均攻击基础统计
Image for post
Average Defense Base Stats per Type
每种类型的平均防御基础统计
Image for post
Average Sp. Attack Base Stats per Type
平均Sp。 每种类型的攻击基础统计
Image for post
Average Sp. Defense Base Stats per Type
平均Sp。 每种类型的防御基础统计
Image for post
Average Speed Base Stats per Type
每种类型的平均速度基本统计
Image for post
Total Average Base Stats per Type
每种类型的平均平均基本统计

These seven barplots above show the average base stats value per type, for all the six stats (HP, Attack, Defense, Sp. Attack, Sp. Defense and Speed), and also for the total base stats, which is the sum of all base stats together.

上面的这七个条形图显示了所有六个统计信息 ( HP,攻击,防御, Sp。Attack,Sp。Defense 和Speed )以及所有基础统计信息的总和,即每种类型的平均基础统计信息的值基本统计数据一起。

By visually checking these plots, it’s not so easy to figure out some base stats characteristics or patterns per type, however it’s possible to notice something really interesting: The types which have the highest win rates are the ones with the highest average speed base stats, and also the worst ones in terms of win rates are the average slowest ones. They don’t follow the exact same order, but this is an important clue for the task of determining the most important factors for a type to have higher win rates.

通过直观地查看这些图,找出每种类型的一些基本统计数据特征或模式并不容易,但是可能会发现一些非常有趣的东西: 获胜率最高类型 是平均速度基本统计数据最高类型 在获胜率方面最差的也是平均最慢的 。 他们并没有遵循完全相同的顺序,但这对于确定具有较高获胜率的类型的最重要因素的任务来说是重要的线索。

Image for post
Win Rate x Average Speed Base Stats per Type
获胜率x每种类型的平均速度基本统计

In order to figure out some patterns on the average base stats per type, one might want to look at a different kind of plot, in which is possible to visualize numerical values of all the six stats at the same time. Radar plots might fit this role quite well.

为了弄清楚每种类型的平均基本统计信息的某些模式,可能需要查看另一种图,其中可以同时可视化所有六个统计信息的数值。 雷达图可能非常适合此角色。

Image for post
Average Base Stats per Type — Figure 1/2
每种类型的平均基本统计数据-图1/2
Image for post
Average Base Stats per Type — Figure 2/2
每种类型的平均基本统计信息-图2/2

These Radar Plots above made it clear that, there’s indeed some stats characteristics embedded in each Pokémon type:

上面的这些雷达图清楚地表明,每种神奇宝贝类型中确实都嵌入了一些统计数据特征:

  • Fighting types for example tend to be foccused on physical attacks (high average Attack base stats, while other stats are at lower levels);

    例如, 战斗类型往往侧重于物理攻击(平均攻击基础统计数据较高,而其他统计数据处于较低水平);

  • Psychic types on the other hand have average high Sp. Attack and Sp. Defense base stats, while are the others are not so high;

    另一方面, 心理类型的平均Sp 攻击Sp。 国防基础数据,其他数据不是很高;

The plots also illustrate better the discrepancy between some types average base stats. Example given: By comparing the Bug and Dragon radar plots, it’s possible to notice the huge superiority of Dragon Pokémons over Bug ones on every single stat.

该图还更好地说明了某些类型的平均基本统计数据之间的差异。 给出的示例 :通过比较BugDragon雷达图,可以发现在每个统计数据上DragonPokémons比Bug的巨大优势。

As mentioned above, it’s easy to notice that higher average speed base stats is highly correlated to higher win rates, however besides the fact of the top and bottom of these two ranks be populated by the same Pokémon types, the order they appear are not the same — hence, there are some other relevant factors for a type to have a high win rate at battles.

如上所述,很容易注意到较高的平均速度基准数据较高的获胜率高度相关,但是,除了这两个等级的顶部和底部均由相同的神奇宝贝类型填充外,它们出现的顺序不是相同-因此,在战斗中获得高胜率的类型还有其他一些相关因素。

Image for post
Correlation of Base Stats and Type Match Ups Percentages with Win Rate
基本统计数据和类型匹配百分比与胜率的相关性

Most correlated type features with Win Rate at battles are:

战斗中与胜率最相关的类型特征是:

  • Average Speed Base Stat — Correlation: 0.96;

    平均速度基准统计资料 -相关性:0.96;

  • Average Sp. Attack Base Stat — Correlation: 0.53;

    平均Sp。 攻击力基础统计 -相关性:0.53;

  • Average Total Stats — Correlation: 0.51;

    平均总统计资料 -相关性:0.51;

  • Average HP Base Stats — Correlation: 0.41;

    平均惠普基本统计数据 -相关性:0.41;

  • Average Attack Base Stats — Correlation: 0.35;

    平均攻击基础统计数据 -相关性:0.35;

  • Offensive Type Advantage (Percentage) — Correlation: 0.30;

    进攻类型优势(百分比) -相关性:0.30;

As said before, the best team composition must be based of not only fast and offensive Pokémons, but also must have Pokémons with types that have a higher number of favorable, or at least neutral match ups.

如前所述,最佳团队组成不仅必须基于快速且具有进攻性的神奇宝贝,而且还必须具有类型具有更高数量(至少是中立)的神奇宝贝

However, it’s known now that favorable base stats (specially Speed, Sp. Attack, HP and Attack) and high total base stats are more valuable than type advantages if one is looking to build an efficient Pokémon team at battles. Although, offensive favorable type match ups also have shown it’s importance through data, so one shall also foccus on having a wide offensive type coverage while building the team.

但是,现在知道,如果人们希望在战斗中组建一支高效的神奇宝贝团队,那么有利的基础统计数据(特别是SpeedSp。AttackHPAttack )和较高的总体基础统计数据比类型优势更有价值。 尽管进攻型有利的比赛也通过数据显示出了重要性,所以在组建团队时也应着眼于广泛的进攻型报道

利用从数据中获得的知识来建立神奇宝贝团队 (Building a Pokémon Team using the knowledge acquired from data)

Now, we’re going to use all the information gathered during the data analysis to build a Pokémon team, looking for the highest efficiency at winning combats.

Now, we're going to use all the information gathered during the data analysis to build a Pokémon team, looking for the highest efficiency at winning combats.

As the first generation of Pokémon (the one which brought Pikachu, Charizard, Blastoise and Venusaur)might be the most remarkable one for most of people, specially the ones whom have been born during the 90’s, I’m going to limit the scope just to Pokémons released at this generation. Neither Legendary Pokémon or Mega Evolutions will be included, as they normally have base stats way higher then “ordinary” Pokémon.

As the first generation of Pokémon (the one which brought Pikachu , Charizard , Blastoise and Venusaur )might be the most remarkable one for most of people, specially the ones whom have been born during the 90's, I'm going to limit the scope just to Pokémons released at this generation. Neither Legendary Pokémon or Mega Evolutions will be included, as they normally have base stats way higher then “ordinary” Pokémon.

Based on the Exploratory Data Analysis using all the datasets mentioned on this article, the criteria to choosing the team members are, listed by order of priority:

Based on the Exploratory Data Analysis using all the datasets mentioned on this article, the criteria to choosing the team members are, listed by order of priority:

  • #1 — Pokémon with High Speed Base Stats;

    #1 — Pokémon with High Speed Base Stats;

  • #2 — Pokémon with Offensive Characteristics (Either Attack or Sp. Attack);

    #2 — Pokémon with Offensive Characteristics (Either Attack or Sp. Attack);

  • #3 —Type combination of all Pokémon on the team shall have a wide range of favorable offensive type match ups (One shall avoid repeating types as much as possible);

    #3 —Type combination of all Pokémon on the team shall have a wide range of favorable offensive type match ups (One shall avoid repeating types as much as possible);

As it’s usual on all the Pokémon games, our team is going to be composed of six Pokémon.

As it's usual on all the Pokémon games, our team is going to be composed of six Pokémon.

Running a simple query at the Pokémon Dataset, we have:

Running a simple query at the Pokémon Dataset , we have:

Image for post
Best canditates for our Pokémon Team
Best canditates for our Pokémon Team

Strictly following the established criteria, one end up with the following Pokémon team:

Strictly following the established criteria, one end up with the following Pokémon team:

Image for post
Aerodactyl — Base Stats and Type
Aerodactyl — Base Stats and Type
Image for post
Alakazam— Base Stats and Type
Alakazam— Base Stats and Type
Image for post
Arcanine— Base Stats and Type
Arcanine— Base Stats and Type
Image for post
Gengar — Base Stats and Type
Gengar — Base Stats and Type
Image for post
Jolteon— Base Stats and Type
Jolteon— Base Stats and Type
Image for post
Starmie— Base Stats and Type
Starmie— Base Stats and Type
Image for post
The team has favorable offensive match ups against 13 of the 18 Pokémon Types
The team has favorable offensive match ups against 13 of the 18 Pokémon Types

Image creditsType badges; Pokémon Sprites

Image credits Type badges ; Pokémon Sprites

Would you try this Pokémon team on your next game run?

Would you try this Pokémon team on your next game run?

All Pokémon included on this list have solid Speed Base Stats (Arcanine being the worst, with a value of 95), have also solid Offensive Base Stats (Physical, Special or even both — Arcanine for example) and do not overlap types (besides Starmie’s secondary type, which overlaps with Alakazam’s), reaching the mark of 13 favorable offensive type match ups, from a total of 18. Sounds promising, right?

All Pokémon included on this list have solid Speed Base Stats ( Arcanine being the worst, with a value of 95 ), have also solid Offensive Base Stats (Physical, Special or even both — Arcanine for example) and do not overlap types (besides Starmie's secondary type, which overlaps with Alakazam’s ), reaching the mark of 13 favorable offensive type match ups , from a total of 18. Sounds promising, right?

下一步 (Next Steps)

Machine Learning model to predict winners on Pokémon Battles

Machine Learning model to predict winners on Pokémon Battles

As the original challenge on the Kaggle post was to build a machile learning model which is able to predict which Pokémon would win a combat, given the two combatant Pokémon, this will be the next step!

As the original challenge on the Kaggle post was to build a machile learning model which is able to predict which Pokémon would win a combat, given the two combatant Pokémon, this will be the next step!

We’ll use the new Dataset derived from the ETL Pipeline described here, and also all the knowledge developed about Pokémon Combats to model and train a Machine Learning Model, and all the details will be fully described on a next article.

We'll use the new Dataset derived from the ETL Pipeline described here, and also all the knowledge developed about Pokémon Combats to model and train a Machine Learning Model, and all the details will be fully described on a next article.

Additionally, once the model is fully trained, it will also be possible to check the efficiency of this Pokémon Team built using Data Analysis!

Additionally, once the model is fully trained, it will also be possible to check the efficiency of this Pokémon Team built using Data Analysis !

Author’s Note: For all the Pokéfans over there — It’s important to bear in mind that all the combats used to build up this analysis are probably in game battles, recorded during a run, battling with wild Pokémons and NPCs (there’s no information about the origin and source of combats). Competitive Pokémon scenarios are completely different, and are not the foccus here.

Author's Note: For all the Pokéfans over there — It's important to bear in mind that all the combats used to build up this analysis are probably in game battles, recorded during a run, battling with wild Pokémons and NPCs (there's no information about the origin and source of combats). Competitive Pokémon scenarios are completely different, and are not the foccus here.

翻译自: https://towardsdatascience.com/your-favorite-game-from-a-different-point-of-view-93732173adf7

从最终用户角度来看外部结构

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/388447.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

apache+tomcat配置

无意间看到tomcat 6集群的内容,就尝试配置了一下,还是遇到很多问题,特此记录。apache服务器和tomcat的连接方法其实有三种:JK、http_proxy和ajp_proxy。本文主要介绍最为常见的JK。 环境:PC2台:pc1(IP 192.168.88.118…

记自己在spring中使用redis遇到的两个坑

本人在spring中使用redis作为缓存时&#xff0c;遇到两个坑&#xff0c;现在记录如下&#xff0c;算是作为自己的备忘吧&#xff0c;文笔不好&#xff0c;望大家见谅&#xff1b; 一、配置文件 1 <!-- 加载Properties文件 -->2 <bean id"configurer" cl…

Azure实践之如何批量为资源组虚拟机创建alert

通过上一篇的简介&#xff0c;相信各位对于简单的创建alert&#xff0c;以及Azure monitor使用以及大概有个印象了。基础的使用总是非常简单的&#xff0c;这里再分享一个常用的alert使用方法实际工作中&#xff0c;不管是日常运维还是做项目&#xff0c;我们都需要知道VM的实际…

管道过滤模式 大数据_大数据管道配方

管道过滤模式 大数据介绍 (Introduction) If you are starting with Big Data it is common to feel overwhelmed by the large number of tools, frameworks and options to choose from. In this article, I will try to summarize the ingredients and the basic recipe to …

DevOps时代,企业数字化转型需要强大的工具链

伴随时代的飞速进步&#xff0c;中国的人口红利带来了互联网业务的快速发展&#xff0c;巨大的流量也带动了技术的不断革新&#xff0c;研发的模式也在不断变化。传统企业纷纷效仿互联网的做法&#xff0c;结合DevOps进行数字化的转型。通常提到DevOps&#xff0c;大家浮现在脑…

用户体验可视化指南pdf_R中增强可视化的初学者指南

用户体验可视化指南pdfLearning to build complete visualizations in R is like any other data science skill, it’s a journey. RStudio’s ggplot2 is a useful package for telling data’s story, so if you are newer to ggplot2 and would love to develop your visua…

linux挂载磁盘阵列

linux挂载磁盘阵列 在许多项目中&#xff0c;都会把数据存放于磁盘阵列&#xff0c;以确保数据安全或者实现负载均衡。在初始安装数据库系统和数据恢复时&#xff0c;都需要先挂载磁盘阵列到系统中。本文记录一次在linux系统中挂载磁盘的操作步骤&#xff0c;以及注意事项。 此…

sql横着连接起来sql_SQL联接的简要介绍(到目前为止)

sql横着连接起来sqlSQL Join是什么意思&#xff1f; (What does a SQL Join mean?) A SQL join describes the process of merging rows in two different tables or files together.SQL连接描述了将两个不同表或文件中的行合并在一起的过程。 Rows of data are combined bas…

《Python》进程收尾线程初识

一、数据共享 from multiprocessing import Manager 把所有实现了数据共享的比较便捷的类都重新又封装了一遍&#xff0c;并且在原有的multiprocessing基础上增加了新的机制list、dict 机制&#xff1a;支持的数据类型非常有限 list、dict都不是数据安全的&#xff0c;需要自己…

北京修复宕机故障之旅

2012-12-18日 下午开会探讨北京项目出现的一些问题&#xff0c;当时记录的问题是由可能因为有一定数量的客户上来后&#xff0c;就造成了Web服务器宕机&#xff0c;而且没有任何时间上的规律性&#xff0c;让我准备出差到北京&#xff0c;限定三天时间&#xff0c;以及准备测试…

一般线性模型和混合线性模型_从零开始的线性混合模型

一般线性模型和混合线性模型生命科学的数学统计和机器学习 (Mathematical Statistics and Machine Learning for Life Sciences) This is the eighteenth article from the column Mathematical Statistics and Machine Learning for Life Sciences where I try to explain som…

《企业私有云建设指南》-导读

内容简介第1章总结性地介绍了云计算的参考架构、典型解决方案架构和涉及的关键技术。 第2章从需求分析入手&#xff0c;详细讲解了私有云的技术选型、资源管理、监控和运维。 第3章从计算、网络、存储资源池等方面讲解了私有云的规划和建设&#xff0c;以及私有云建设的总体原则…

太原冶金技师学院计算机系,山西冶金技师学院专业都有什么

山西冶金技师学院专业大全大家在考试之后对除了选择学校之外&#xff0c;还更关注专业的选择&#xff0c;山西冶金技师学院有哪些专业成了大家最为关心的问题。有些同学一般是选择好专业再选择自己满意的学校&#xff0c;下面小编将为你介绍山西冶金技师学院开设的专业及其哪些…

海南首例供港造血干细胞志愿者启程赴广东捐献

海南首例供港造血干细胞志愿者启程赴广东捐献。 张瑶 摄 海南首例供港造血干细胞志愿者启程赴广东捐献。 张瑶 摄 中新网海口1月23日电 (张茜翼 张瑶)海南省首例供港造血干细胞捐献者晶晶(化名)23日启程赴广东进行捐献&#xff0c;将于28号正式捐献采集造血干细胞&#xff0c;为…

如何击败Python的问题

Following the previous article written about solving Python dependencies, we will take a look at the quality of software. This article will cover “inspections” of software stacks and will link a free dataset available on Kaggle. Even though the title say…

KindEditor解决上传视频不能在手机端显示的问题

KindEditor自带的上传视频生成的HTML代码为<embed>&#xff0c;在手机端并不支持。于是可以自己在控件里增加生成video标签相关代码。 参考https://www.jianshu.com/p/047198ffed92。。 然而对着修改后没有成功&#xff0c;可能是那里没有改对吧。依然生成的是<embed&…

《独家记忆》见面会高甜宠粉 张超现场解锁隐藏技能

1月23日&#xff0c;由爱奇艺出品&#xff0c;小糖人联合出品的沉浸式成长练爱剧《独家记忆》在京举行粉丝见面会。爱奇艺高级副总裁陈宏嘉&#xff0c;爱奇艺副总裁、自制剧开发中心总经理、《独家记忆》总制片人戴莹&#xff0c;小糖人董事长、《独家记忆》总制片人朱振华&am…

计算机软件技术基础fifo算法,软件技术基础真题

一、填空1、数据结构按逻辑结构可分为两大类&#xff0c;它们分别是线性和非线性2.1、在长为n的顺序存储的线性表中插入和删除元素时所需移动元素的平均次数(等概率情况下)为&#xff1a;Einn/2&#xff0c;Ede(n-1)/22.2、顺序表有5个元素&#xff0c;设在任何位置上插入元素是…

NOI 2016 优秀的拆分 (后缀数组+差分)

题目大意&#xff1a;给你一个字符串&#xff0c;求所有子串的所有优秀拆分总和&#xff0c;优秀的拆分被定义为一个字符串可以被拆分成4个子串&#xff0c;形如$AABB$&#xff0c;其中$AA$相同&#xff0c;$BB$相同&#xff0c;$AB$也可以相同 作为一道国赛题&#xff0c;95分…

多元线性回归 python_Python中的多元线性回归

多元线性回归 pythonVideo Link影片连结 This episode expands on Implementing Simple Linear Regression In Python. We extend our simple linear regression model to include more variables.本集扩展了在Python中实现简单线性回归的方法 。 我们扩展了简单的线性回归模型…