The author of this article, my good friend Ah Guang, is a postgraduate student of the Institute of Software, Chinese Academy of Sciences. He has worked as an intern in Ali, Huawei and Chinese Academy of Sciences. Public number [visual algorithm] (non visual algorithm oh!) Focus on machine learning, deep learning, computer vision, cutting-edge papers and basic programming algorithms, welcome to follow.

An overview of the

  • preface
  • To get the data
  • Observational data
  • The data processing
  • What is the strongest correlation with eating chicken?
  • Analytical heat map
  • Questions to be studied
  • conclusion
  • O says
  • Recommended reading

preface

When PUBG is in a complete mess at home, a game named Fortnite blows up the whirlwind of fortress abroad. This sandbox game also plays for battle Royalty-style. Under the situation of PUBG gradually goes down, Fortnite has won a number of nominations, and many star anchors switch to fortress!

Heaven and earth, building roads, laying traps set bomb beds; Want to stand shoulder to shoulder with the sun, a rocket into the sky.

In view of “200 jin soul” small fat roommate is often obsessed with eating chicken games, in order to help him improve the game win rate, I crawled and analyzed more than 1W chicken eating data. Now let’s look at what are the relevant conditions for being strong enough to eat chicken?

To get the data

First, we need to load the Python library

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
Copy the code

The Fortnite data is then loaded, checked for quality and cleanliness, and the dataset is then collated and cleaned for subsequent cleanup.

Fortnite_data = pd.read_csv('aguang.csv')
Copy the code

To get a sense of the data set, output the first few lines of the data.

Fortnite_data.head()
Copy the code

The result is:

serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number  match-time  competitor-name
0  1  4  1  0  0.33  69  19  4000  1325  670  554  815  3709  3  448.0  762.0  1  2018/5/14 11:37  Alvin
1  2  2  1  0  0.31  28  0  2000  733  110  292  268  7733  9  282.0  536.0  2  2018/5/17 17:48  Alvin
2  3  3  0  1  0.21  33  12  3000  1806  350  245  543  7727  8  291.0  597.0  4  2018/5/18 18:05  Alvin
3  4  2  0  3  0.05  6  0  3000  700  420  746  163  19008  3  NaN  NaN  4  2018/5/18 18:26  Alvin
4  5  1  4  1  0.12  32  7  3000  668  370  212  432  13108  4  358.0  734.0  4  2018/5/18 18:53  Alvin
Copy the code

Observational data

This data set contains more than 1W game data, which may have “200 jin” xiao Pang net addiction record (terrible to see :joy). Missing values in this data set are marked as NaN. Data column names have the following meanings: \

Knockout_number: the assist_number save_number: the number of saved teammates precision: hit_the_target: the assist_number Exact_strike hit the "marching_course" from a material_collection of materials that have been collected from the afford_damage Cause_damage: cause_damage: building damage: total_score: total experience: teams_number1For Solo, two forDouble.4For the team,3People enter automatically fill as4(match_time: game time competitor_name: the owner of this recordCopy the code

The data processing

View data types and data for missing values

Check the data type and whether the data is missing
Fortnite_data.info()
Copy the code

Check for duplicate data

# Check for duplicate data
Fortnite_data[Fortnite_data.duplicated()]
Copy the code

The results for

serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number  match-time  competitor-name
Copy the code

View description statistics of data

# View descriptive statistics of data
Fortnite_data.describe()
Copy the code

The result is:

serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number
coun 42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  20.000000  20.000000  42.000000
mean 21.500000  2.642857  1.261905  0.380952  0.246429  38.452381  6.976190  2576.142857  1092.785714  312.619048  350.047619  567.309524  9336.119048  6.000000  362.700000  676.350000  3.238095
std  12.267844  2.818246  1.415240  0.660834  0.168520  32.539809  8.529684  781.055339  617.643932  213.781967  160.616336  434.419966  6366.174673  4.928761  151.638802  274.785519  1.122052
min  1.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  481.000000  200.000000  0.000000  52.000000  0.000000  1755.000000  1.000000  84.000000  168.000000  1.000000
25%  11.250000  1.000000  0.000000  0.000000  0.172500  10.250000  2.000000  2000.000000  694.750000  162.500000  273.000000  262.750000  5780.000000  3.000000  277.750000  507.750000  2.000000
50%  21.500000  2.000000  1.000000  0.000000  0.240000  32.500000  3.500000  3000.000000  905.500000  260.000000  326.000000  513.000000  7819.000000  4.000000  328.500000  602.500000  4.000000
75%  31.750000  3.000000  2.000000  1.000000  0.305000  56.000000  10.250000  3000.000000  1453.750000  367.500000  403.000000  692.500000  10799.500000  7.750000  403.000000  775.250000  4.000000
max  42.000000  15.000000  5.000000  3.000000  1.000000  126.000000  39.000000  4000.000000  2728.000000  1060.000000  877.000000  1970.000000  32963.000000  18.000000  728.000000  1238.000000  4.000000
Copy the code

After analyzing the data, it is found that there may be errors in the data of 13 people eliminated in a match. Let’s output the data separately:

Fortnite_data[Fortnite_data['knockout_number'] = =13]
Copy the code

The result is:

serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number  match-time  competitor-name
12  13  15  1  0  0.24  103  18  3000  1488  660  52  1970  8612  1  728.0  1238.0  1  2018/5/19 21:47  Wal-Mart
Copy the code

After analysis, this belongs to the normal data, may be the “interesting soul” fat student this unusually vigorous, one person killed 13, singing all the way on the road to eat chicken, and only 3000m marching examples show that basically no trouble running drugs, can be said to be in the right place at the right time!

To improve cleanliness, the match-time column is divided into year, month, day and hour columns. The following is data cleaning:

Duplicate a standby DF
Fortnite_clean = Fortnite_data.copy()
Copy the code

Question: Which statistic has the highest correlation with being number one?

After finishing the collation and cleansing of the data, I proceeded to conduct exploratory data analysis. Identify the research question first, then you can output descriptive statistics, see if there are points worth studying (along the way you can redirection the question as you learn better points), and create visual diagrams that address the research question you raised earlier.

Probing question: What is the highest correlation between winning number one (eating chicken)?

Fortnite_clean.head()
Output descriptive statistics for the collated data
Fortnite_clean.describe()
# select the data that won the first place
Fortnite_clean[Fortnite_clean['grade'] = =1]
Copy the code

The result is:

serial_number  knockout_number  assist_number  save_number  precision  hit_the_target  exact_strike  marching_course  material_collection  material_using  afford_damage  cause_damage  building_damage  grade  total_score  total_experience  teams_number  data_sources  match_day  match_hour
12  0013  15  1  0  0.24  103  18  3000  1488  660  52  1970  8612  1  728  1238  Solo  Wal-Mart  2018-05-19  21:47:00
18  0019  1  1  1  0.02  5  2  4000  1351  250  225  214  8096  1  608  1156  Team  Alvin  2018-05-22  21:24:00
25  0026  5  3  1  0.26  62  2  4000  2728  330  83  1040  7096  1  0  0  Team  Wal-Mart  2018-05-28  21:58:00
26  0027  2  3  0  0.18  6  0  2000  1955  100  451  541  23633  1  594  1188  Team  Alvin  2018-05-28  21:58:00
27  0028  2  4  0  0.19  48  3  3000  1755  590  283  605  20733  1  0  0  Team  Kaka  2018-05-28  21:58:00
Copy the code

Oddly enough, Wal-Mart’s numbers are clearly better than Alivn’s and Kaka’s. Knockout_number, Precision, and cause_damage are the usual chicken eating metrics. It’s not even as good as many of the lower numbers. Data with damage greater than 606 were then screened

Filter out data that does more than 606 damage
Fortnite_clean[Fortnite_clean['cause_damage'] > =606]
Copy the code

We can see that Alvin and Kaka’s record of 541 and 605 damage is a lot higher than the record of 541 and 605 damage recorded by chicken eater, but the result is not very good, only to hover in sixth place! So what caused Alvin and Kaka to eat chicken? Did they just get on the fast boat of fat Walmart, both paddlers?

Not at all. We looked at afford_damage and building_damage, both of which have high levels of damage and building damage, and were they able to help Walmart, the main gunner, draw fire and knock down places to give them room to work. Let’s move on.

So, this raises a branching question: Can a teammate with afford_damage and building_damage be effective against the afford_damage and building_damage?

The solution code is as follows:

Fortnite_clean[Fortnite_clean['afford_damage'] > =451].grade.mean()
output:3.125

Fortnite_clean[Fortnite_clean['building_damage'] > =20000].grade.mean()
output:1.75
Copy the code

Knockout_number, precision, and Cause_damage are important, but in a team of four, it would be helpful to have one or two damage resistant meat shields and machine gunners around one or two output bits. \

dfData = Fortnite_one.corr()
plt.subplots(figsize=(8.8)) # Set the screen size
sns.heatmap(dfData, annot=True, vmax=1, square=True, cmap="Blues")
plt.show()
Copy the code

After data visualization, the heat map is as follows:

Github.com/zandaoguang…

Or click on the original to view the source code

Analytical heat map

In the heat map, the first three items are highly correlated with eating chicken (grade) : material collection, number of eliminators and damage caused

The correlation between hits and precision strikes is not as high as it was supposed to be, so is good FPS feel less important in Fortnite? More data is needed.

Questions to be studied

  • Is there a correlation between the circle of destiny and the ability to eat chicken? (marching_course < 2000)
  • Is there a correlation between the use of more boards and the ability to eat chicken? (material_using)

Note: Due to the small amount of data, more data will be collected in the future. It is hoped that the above and more directions can be studied.

conclusion

According to the above thermal diagram, the following results can be obtained:

  • The first three items with high correlation with eating chicken are: material collection, the number of people eliminated and harm caused, basic composite expectation;
  • Material use is highly relevant because equipment and materials picked up by eliminated players also count as material collection;
  • If you want to achieve good results in a team, it is the right way to deploy 1 or 2 meat shields for resisting damage and machine gunners for removing boards around 1 or 2 output positions.
  • As mentioned above, the result of this analysis is more in favor of eating chicken alone and eating chicken in teams, and the job allocation among team members is also very important.

The following recommended a worthy of attention to the public number, the earth does not explode, the algorithm does not have a holiday. A guang free monthly package to send dozens of books, if you have any technical problems, welcome to pay attention to a guang wechat public account “Learning algorithm” (not visual algorithm oh!) .

Inspection algorithm