Requirements
pandas,numpy,matplotlib,seaborn
Using data from https://pubgtracker.com/ to analyse best strategies to play PUBG
Download datasets from https://drive.google.com/file/d/1E7yHRPW04sAc3mu90jbPHdiy9MWKCcO3/view
From the first heat map we can conclude that:
Most fighting features seem to matter
killPoints (Kill Rating for Ingame Statistic/Leaderboard) are not that important
teamKills are friendly fire kills
killPlace is the most Important feature so far
From the second Heatmap we can see that
walkDistance seems very important, which makes sense: you can only walk around if you are still alive!
Same for swim and rideDistance but not that important
winPoints you gain are not that much connected to your actual surviving time
So the conclusion from this analysis is
To survive longer in PUBG, you should be able to fight well, but also acquire many weapons.
In general walking should be the preferred way to move.
Even noobs know this :)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
print(os.listdir(os.getcwd()+'\\pubgstats'))
['sample_submission_V2.csv', 'test_V2.csv', 'train_V2.csv']
train = pd.read_csv(os.getcwd()+'\\pubgstats'+'\\train_V2.csv')
train
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
Id | groupId | matchId | assists | boosts | damageDealt | DBNOs | headshotKills | heals | killPlace | ... | revives | rideDistance | roadKills | swimDistance | teamKills | vehicleDestroys | walkDistance | weaponsAcquired | winPoints | winPlacePerc | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 7f96b2f878858a | 4d4b580de459be | a10357fd1a4a91 | 0 | 0 | 0.000 | 0 | 0 | 0 | 60 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 244.80 | 1 | 1466 | 0.4444 |
1 | eef90569b9d03c | 684d5656442f9e | aeb375fc57110c | 0 | 0 | 91.470 | 0 | 0 | 0 | 57 | ... | 0 | 0.0045 | 0 | 11.040 | 0 | 0 | 1434.00 | 5 | 0 | 0.6400 |
2 | 1eaf90ac73de72 | 6a4a42c3245a74 | 110163d8bb94ae | 1 | 0 | 68.000 | 0 | 0 | 0 | 47 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 161.80 | 2 | 0 | 0.7755 |
3 | 4616d365dd2853 | a930a9c79cd721 | f1f1f4ef412d7e | 0 | 0 | 32.900 | 0 | 0 | 0 | 75 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 202.70 | 3 | 0 | 0.1667 |
4 | 315c96c26c9aac | de04010b3458dd | 6dc8ff871e21e6 | 0 | 0 | 100.000 | 0 | 0 | 0 | 45 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 49.75 | 2 | 0 | 0.1875 |
5 | ff79c12f326506 | 289a6836a88d27 | bac52627a12114 | 0 | 0 | 100.000 | 1 | 1 | 0 | 44 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 34.70 | 1 | 0 | 0.0370 |
6 | 95959be0e21ca3 | 2c485a1ad3d0f1 | a8274e903927a2 | 0 | 0 | 0.000 | 0 | 0 | 0 | 96 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 13.50 | 1 | 1497 | 0.0000 |
7 | 311b84c6ff4390 | eaba5fcb7fc1ae | 292611730ca862 | 0 | 0 | 8.538 | 0 | 0 | 0 | 48 | ... | 0 | 2004.0000 | 0 | 0.000 | 0 | 0 | 1089.00 | 6 | 1500 | 0.7368 |
8 | 1a68204ccf9891 | 47cfbb04e1b1a2 | df014fbee741c6 | 0 | 0 | 51.600 | 0 | 0 | 0 | 64 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 799.90 | 4 | 0 | 0.3704 |
9 | e5bb5a43587253 | 759bb6f7514fd2 | 3d3031c795305b | 0 | 0 | 37.270 | 0 | 0 | 0 | 74 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 65.67 | 1 | 0 | 0.2143 |
10 | 2b574d43972813 | c549efede67ad3 | 2dd6ddb8320fc1 | 0 | 0 | 28.380 | 0 | 0 | 0 | 75 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 868.30 | 9 | 0 | 0.3929 |
11 | 8de328a74658a9 | f643df9df3877c | 80170383d90003 | 0 | 0 | 137.900 | 1 | 0 | 0 | 64 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 451.70 | 1 | 0 | 0.4043 |
12 | ce4f6ac165705e | da24cdb91969cc | 535b5dbd965a94 | 0 | 0 | 0.000 | 0 | 0 | 0 | 37 | ... | 0 | 6639.0000 | 0 | 0.000 | 0 | 0 | 2784.00 | 6 | 0 | 0.9286 |
13 | b7807186e3f679 | 3c08e461874749 | 2c30ddf481c52d | 0 | 1 | 324.200 | 0 | 1 | 5 | 5 | ... | 0 | 1228.0000 | 0 | 76.840 | 0 | 0 | 2050.00 | 6 | 1462 | 0.8750 |
14 | 8e244ac61b6aab | d40d0c7d3573a1 | 94e1c1cc443c65 | 0 | 1 | 122.800 | 1 | 0 | 2 | 25 | ... | 1 | 1237.0000 | 0 | 60.290 | 0 | 0 | 1666.00 | 5 | 1531 | 0.9000 |
15 | 12d8d4bd94312c | fe52d481bae68b | 6fd9e765ddd0c5 | 0 | 0 | 80.710 | 1 | 0 | 0 | 72 | ... | 1 | 0.0000 | 0 | 0.000 | 0 | 0 | 105.10 | 5 | 0 | 0.2766 |
16 | 62f2f0917d84b2 | f61b698274d9f5 | 1d6cfe0f6f23b0 | 0 | 2 | 81.710 | 1 | 0 | 14 | 25 | ... | 0 | 519.9000 | 0 | 0.000 | 0 | 0 | 3674.00 | 7 | 0 | 0.7308 |
17 | 92022479b92ce7 | 2f2c33f548c4b9 | 07948d723b9c0f | 0 | 3 | 254.300 | 0 | 0 | 12 | 13 | ... | 0 | 2367.0000 | 0 | 15.290 | 0 | 0 | 1787.00 | 3 | 0 | 0.8211 |
18 | 7bd224781f064b | 6dde607d151819 | 733af30cc00099 | 0 | 0 | 0.000 | 0 | 0 | 0 | 79 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 137.40 | 2 | 0 | 0.1923 |
19 | 71cbdbc3b263e5 | 7b61f74b51906c | a329ac99449ad7 | 0 | 1 | 65.280 | 0 | 0 | 1 | 48 | ... | 0 | 0.0000 | 0 | 20.850 | 0 | 0 | 3310.00 | 3 | 1479 | 0.9310 |
20 | 02ace8c6e58461 | a4bc548028f800 | 80f2b8448e474b | 0 | 4 | 269.100 | 0 | 1 | 8 | 18 | ... | 1 | 2734.0000 | 0 | 0.000 | 0 | 0 | 1794.00 | 5 | 0 | 0.6383 |
21 | 00341b1caa5420 | d661a2d19e7ae9 | f3956286eb39a5 | 0 | 0 | 158.700 | 1 | 0 | 0 | 75 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 580.10 | 2 | 0 | 0.2143 |
22 | 9b2961d4d51f91 | 799d0a4d61dc3c | e833ca2282169d | 0 | 1 | 192.300 | 1 | 2 | 3 | 15 | ... | 0 | 2332.0000 | 0 | 0.000 | 0 | 0 | 1264.00 | 4 | 1494 | 0.7500 |
23 | 0b6fbdfb59c994 | 7a75c3e86934f6 | 8b0a78c005cea0 | 0 | 6 | 1011.000 | 6 | 2 | 2 | 2 | ... | 0 | 4860.0000 | 0 | 0.000 | 0 | 0 | 2727.00 | 7 | 1603 | 0.9592 |
24 | 736eda9b9c20b3 | d35e80e4e64dd4 | 62fbe726028662 | 0 | 3 | 327.600 | 4 | 1 | 1 | 3 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 3503.00 | 4 | 1496 | 0.9231 |
25 | 4c45dc732689ec | 8e0a0ea95d3596 | 37f43ba55ec0a4 | 1 | 4 | 558.600 | 3 | 0 | 4 | 11 | ... | 0 | 1183.0000 | 0 | 0.000 | 0 | 0 | 2711.00 | 7 | 1494 | 0.8696 |
26 | 91f5da9c3628eb | 090fd12f3ca8a8 | e8b8cf5d9231d3 | 0 | 0 | 44.280 | 0 | 0 | 0 | 78 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 15.30 | 0 | 0 | 0.1154 |
27 | dbf611495bfda3 | 10cbb86844dee0 | 2cdae31ee18601 | 0 | 4 | 381.200 | 2 | 1 | 2 | 7 | ... | 0 | 1798.0000 | 0 | 0.000 | 0 | 0 | 1933.00 | 4 | 0 | 0.7234 |
28 | f9473c4f1cfdc4 | 8483976f3ba230 | 6057f846f3ed12 | 0 | 6 | 345.600 | 2 | 1 | 1 | 6 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 3855.00 | 4 | 0 | 0.9630 |
29 | ac5b57ff39979c | 857cc55b2b6001 | e019e04dee4f19 | 0 | 0 | 0.000 | 0 | 0 | 0 | 87 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 0.00 | 0 | 0 | 0.0000 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
4446936 | ee62630c3a17e3 | cc6b1b4264eb73 | 269a041abb69a5 | 0 | 1 | 68.200 | 0 | 1 | 1 | 22 | ... | 0 | 0.0000 | 0 | 34.860 | 0 | 0 | 2708.00 | 7 | 0 | 0.7308 |
4446937 | 68100cdb23f1f0 | 9b8970931c5d00 | ce5a23d8bb7883 | 1 | 2 | 127.400 | 1 | 1 | 4 | 31 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 1364.00 | 5 | 0 | 0.7111 |
4446938 | 7718e7c0c355a3 | 54d5ce5a79e0f6 | 06def1c4d808d4 | 0 | 0 | 0.000 | 0 | 0 | 0 | 64 | ... | 0 | 0.0000 | 0 | 72.210 | 0 | 0 | 173.10 | 1 | 0 | 0.0385 |
4446939 | 36b218fd209b00 | 195337a8c2ae1d | fa1b1885f56b7d | 0 | 0 | 151.500 | 1 | 0 | 0 | 35 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 56.14 | 1 | 1539 | 0.3830 |
4446940 | 3eefd3ee81154a | 19b7a730468b55 | 31045b7b933f3d | 0 | 1 | 0.000 | 0 | 0 | 1 | 58 | ... | 0 | 2728.0000 | 0 | 0.000 | 0 | 0 | 1362.00 | 6 | 0 | 0.6250 |
4446941 | 18e04b3b452a1a | 8de4310ab2d2ae | 054bfeb4d51fc4 | 0 | 0 | 62.350 | 0 | 0 | 0 | 79 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 65.21 | 2 | 0 | 0.1600 |
4446942 | 2c9f1610de0ecd | d64a0663e96058 | 5c9254fa96f53e | 0 | 4 | 724.700 | 6 | 4 | 14 | 1 | ... | 3 | 5076.0000 | 0 | 0.000 | 0 | 0 | 2162.00 | 8 | 0 | 1.0000 |
4446943 | 0f0dd3fe907cef | 5f251817449ae7 | cf837481bd01f3 | 0 | 0 | 0.000 | 0 | 0 | 0 | 82 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 57.59 | 2 | 0 | 0.1111 |
4446944 | 914aec03b107db | a8c5116da13d88 | 02dd2c1a0b34de | 0 | 0 | 175.000 | 0 | 1 | 0 | 29 | ... | 0 | 2532.0000 | 0 | 0.000 | 0 | 0 | 1349.00 | 5 | 0 | 0.6875 |
4446945 | e8b6ed3ec93a76 | 3e5b779bd7cf12 | 95e5611e58f4d5 | 0 | 0 | 0.000 | 0 | 0 | 0 | 81 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 57.19 | 1 | 0 | 0.1875 |
4446946 | f1aca3f5aeafd8 | 2c6765c0fc6d77 | 84d7e32c95913a | 0 | 0 | 0.000 | 0 | 0 | 0 | 53 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 2591.00 | 7 | 0 | 0.7292 |
4446947 | cac9fe367120a1 | d1398e8c0941f3 | a27caa11cb4dfb | 0 | 0 | 0.000 | 0 | 0 | 0 | 61 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 631.10 | 4 | 0 | 0.3830 |
4446948 | 445aaa1ddc858e | b1efcbdb7ce674 | 05f6cd4077cd68 | 1 | 3 | 736.500 | 4 | 1 | 2 | 7 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 1685.00 | 3 | 1500 | 0.7917 |
4446949 | 138e004749faf9 | dbe0096979e393 | 5256cd7403054e | 0 | 0 | 100.000 | 1 | 0 | 0 | 32 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 424.60 | 3 | 0 | 0.1458 |
4446950 | d05b0c4b2ff311 | 8248fa2552457b | 88c002b589d411 | 0 | 0 | 203.500 | 0 | 0 | 0 | 32 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 1559.00 | 5 | 0 | 0.5000 |
4446951 | 0381eae18c429f | c0df2e78ccce86 | be06c0c5f9a47e | 0 | 0 | 0.000 | 0 | 0 | 0 | 85 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 44.90 | 1 | 0 | 0.1000 |
4446952 | 78b990601cafb6 | aa64828a68bc21 | 8496e878b7ee1d | 0 | 0 | 0.000 | 0 | 0 | 0 | 44 | ... | 0 | 0.0000 | 0 | 5.328 | 0 | 0 | 1177.00 | 5 | 0 | 0.8462 |
4446953 | 372304ea470cad | 0db6cf38e79c9e | a530fd807f535a | 0 | 0 | 30.100 | 0 | 0 | 0 | 57 | ... | 1 | 0.0000 | 0 | 0.000 | 0 | 0 | 1025.00 | 5 | 1551 | 0.5926 |
4446954 | 894c01c8e4524f | c33e793af077f9 | deb3a91c03d0f3 | 0 | 0 | 30.100 | 0 | 0 | 0 | 58 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 2146.00 | 6 | 1502 | 0.5306 |
4446955 | b9155a229aedfd | 570d9414a536f3 | 0c5ab888689674 | 0 | 0 | 0.000 | 0 | 0 | 0 | 60 | ... | 0 | 604.8000 | 0 | 0.000 | 0 | 0 | 1158.00 | 3 | 0 | 0.4792 |
4446956 | dae05e0d743059 | 3902915a7a1943 | 97b64a07c05761 | 1 | 0 | 151.900 | 0 | 0 | 1 | 77 | ... | 1 | 0.0000 | 0 | 0.000 | 0 | 0 | 828.30 | 7 | 0 | 0.1071 |
4446957 | 2a4163ccbe0e3b | 2689c981578849 | eebc058a45ff13 | 0 | 1 | 100.000 | 0 | 0 | 0 | 32 | ... | 1 | 0.0000 | 0 | 0.000 | 0 | 0 | 363.70 | 2 | 0 | 0.4583 |
4446958 | 837349af7e8a35 | 58bc4104935623 | 2001300d4f5787 | 0 | 0 | 0.000 | 0 | 0 | 0 | 92 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 0.00 | 0 | 0 | 0.0000 |
4446959 | d29bfa313ad766 | ac3f1b4a56e5ad | 2f3b1af94739b3 | 0 | 0 | 22.680 | 0 | 0 | 0 | 89 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 40.25 | 1 | 0 | 0.0842 |
4446960 | 69fa4c2d5431b1 | 2a3ad0e37fb6ce | 818ccf2160343f | 0 | 0 | 327.700 | 3 | 2 | 0 | 4 | ... | 0 | 180.4000 | 0 | 0.000 | 0 | 0 | 845.60 | 3 | 0 | 0.2414 |
4446961 | afff7f652dbc10 | d238e426f50de7 | 18492834ce5635 | 0 | 0 | 0.000 | 0 | 0 | 0 | 74 | ... | 0 | 1292.0000 | 0 | 0.000 | 0 | 0 | 1019.00 | 3 | 1507 | 0.1786 |
4446962 | f4197cf374e6c0 | 408cdb5c46b2ac | ee854b837376d9 | 0 | 1 | 44.150 | 0 | 0 | 0 | 69 | ... | 0 | 0.0000 | 0 | 0.000 | 0 | 0 | 81.70 | 6 | 0 | 0.2935 |
4446963 | e1948b1295c88a | e26ac84bdf7cef | 6d0cd12784f1ab | 0 | 0 | 59.060 | 0 | 0 | 0 | 66 | ... | 0 | 0.0000 | 0 | 2.184 | 0 | 0 | 788.70 | 4 | 0 | 0.4815 |
4446964 | cc032cdd73b7ac | c2223f35411394 | c9c701d0ad758a | 0 | 4 | 180.400 | 1 | 1 | 2 | 11 | ... | 2 | 0.0000 | 0 | 0.000 | 0 | 0 | 2748.00 | 8 | 0 | 0.8000 |
4446965 | 0d8e7ed728b6fd | 8c74f72fedf5ff | 62a16aabcc095c | 0 | 2 | 268.000 | 0 | 0 | 1 | 18 | ... | 0 | 1369.0000 | 0 | 0.000 | 0 | 0 | 1244.00 | 5 | 0 | 0.5464 |
4446966 rows × 29 columns
train.isnull().values.any()
True
list(train)
['Id',
'groupId',
'matchId',
'assists',
'boosts',
'damageDealt',
'DBNOs',
'headshotKills',
'heals',
'killPlace',
'killPoints',
'kills',
'killStreaks',
'longestKill',
'matchDuration',
'matchType',
'maxPlace',
'numGroups',
'rankPoints',
'revives',
'rideDistance',
'roadKills',
'swimDistance',
'teamKills',
'vehicleDestroys',
'walkDistance',
'weaponsAcquired',
'winPoints',
'winPlacePerc']
# DBNO means downed but not out
import seaborn as sns
f1 = (
train.loc[:, ["winPlacePerc","killPoints", "killPlace", "kills", "DBNOs", "headshotKills", "assists", "longestKill","heals", "revives" , "teamKills" ]]
).corr()
plt.figure(figsize=(14, 12))
sns.heatmap(f1, annot = True)
<matplotlib.axes._subplots.AxesSubplot at 0x2cd43a489b0>
train["teamKills"].describe()
count 4.446966e+06
mean 2.386841e-02
std 1.673935e-01
min 0.000000e+00
25% 0.000000e+00
50% 0.000000e+00
75% 0.000000e+00
max 1.200000e+01
Name: teamKills, dtype: float64
train["kills"].describe()
count 4.446966e+06
mean 9.247833e-01
std 1.558445e+00
min 0.000000e+00
25% 0.000000e+00
50% 0.000000e+00
75% 1.000000e+00
max 7.200000e+01
Name: kills, dtype: float64
f2 = (
train.loc[:, ["winPlacePerc","winPoints", "maxPlace", "numGroups", "walkDistance", "swimDistance" , "rideDistance", "roadKills", 'vehicleDestroys', "weaponsAcquired" ]]
).corr()
plt.figure(figsize=(12, 10))
sns.heatmap(f2, annot = True)
<matplotlib.axes._subplots.AxesSubplot at 0x2cd42532ba8>