Warum Features erzeugen?

Feature Engineering für Machine Learning in Python

Robert O'Callaghan

Director of Data Science, Ordergroove

Feature Engineering

Feature Engineering für Machine Learning in Python

Verschiedene Datentypen

  • Kontinuierlich: entweder Integer (ganze Zahlen) oder Floats (Dezimalzahlen)
  • Kategorisch: eine von wenigen Ausprägungen, z. B. Geschlecht, Geburtsland
  • Ordinal: geordnete Werte, oft ohne Abstände dazwischen
  • Boolesch: True/False-Werte
  • Datum/Zeit: Daten und Uhrzeiten
Feature Engineering für Machine Learning in Python

Kursstruktur

  • Kapitel 1: Feature-Erstellung und -Extraktion

  • Kapitel 2: Unsaubere Daten aufbereiten

  • Kapitel 3: Feature-Normalisierung

  • Kapitel 4: Mit Text-Features arbeiten

Feature Engineering für Machine Learning in Python

pandas

import pandas as pd  
df = pd.read_csv(path_to_csv_file)
print(df.head())
Feature Engineering für Machine Learning in Python

Datensatz

              SurveyDate  \
0    2018-02-28 20:20:00     
1    2018-06-28 13:26:00     
2    2018-06-06 03:37:00     
3    2018-05-09 01:06:00     
4    2018-04-12 22:41:00    

                              FormalEducation
0    Bachelor's degree (BA. BS. B.Eng.. etc.)
1    Bachelor's degree (BA. BS. B.Eng.. etc.)
2    Bachelor's degree (BA. BS. B.Eng.. etc.)
3    Some college/university study  ...
4    Bachelor's degree (BA. BS. B.Eng.. etc.)
Feature Engineering für Machine Learning in Python

Spaltennamen

print(df.columns)
Index(['SurveyDate', 'FormalEducation',
       'ConvertedSalary', 'Hobby', 'Country',
       'StackOverflowJobsRecommend', 'VersionControl', 
       'Age', 'Years Experience', 'Gender', 
       'RawSalary'], dtype='object')
Feature Engineering für Machine Learning in Python

Spaltentypen

print(df.dtypes)
SurveyDate                            object
FormalEducation                       object
ConvertedSalary                      float64
...
Years Experience                       int64
Gender                                object
RawSalary                             object
dtype: object
Feature Engineering für Machine Learning in Python

Bestimmte Datentypen auswählen

only_ints = df.select_dtypes(include=['int'])
print(only_ints.columns)
Index(['Age', 'Years Experience'], dtype='object')
Feature Engineering für Machine Learning in Python

Los geht's!

Feature Engineering für Machine Learning in Python

Preparing Video For Download...