Exploratieve data-analyse

CTR voorspellen met Machine Learning in Python

Kevin Huo

Instructor

Dieper in op features

print(df.columns)
['id', 'click', 'hour', 'C1', ... ]
print(df.dtypes)
id                  object
click                int64
...
  • int: geheel getal: 1, 2, enz.
  • float: decimalen: 3.02, 4.56, enz.
  • object: string: "hello", "world", enz.
  • datetime: datum-tijd: 2018-01-01, enz.
df.select_dtypes(
  include=['int', 'float'])
click                int64
...
CTR voorspellen met Machine Learning in Python

Ontbrekende data

df.info()
Data columns (totaal 24 kolommen):
id            50000 non-null object
df['id'].isnull()
[False, False, False, False, ... ]
df.isnull().sum(axis = 0)
dtype: object
id                  0
...
df.isnull().sum(axis = 0).sum()
0
CTR voorspellen met Machine Learning in Python

Verdelingen bekijken

df.groupby(['search_engine_type', 
            'click']).size()
search_engine_type    click
1002          0          940
              1          240
                   ...
df.groupby(['search_engine_type',
            'click']).size().unstack()
click                  0     1
search_engine_type               
1002                 940   240
               ...
CTR voorspellen met Machine Learning in Python

Uitsplitsing op CTR

df.reset_index()
click  search_engine_type      0     1
                     1002    940   240
df.rename(columns = {0: 'non_clicks'}, inplace = True)
click  search_engine_type  non_clicks  clicks
                     1002         940     240
CTR voorspellen met Machine Learning in Python

Laten we oefenen!

CTR voorspellen met Machine Learning in Python

Preparing Video For Download...