SlideShare a Scribd company logo
D E C E M B E R 8 - 9 , 2 0 1 6
BigML, Inc 2
Poul Petersen
CIO, BigML, Inc.
Feature Engineering
Creating Machine Learning Ready Data
BigML, Inc 3Feature Engineering
Machine Learning Secret
“…the largest improvements in accuracy often came from
quick experiments, feature engineering, and model tuning
rather than applying fundamentally different algorithms.”
Facebook FBLearner 2016
Feature Engineering: applying domain knowledge of
the data to create features that make machine
learning algorithms work better or at all.
BigML, Inc 4Feature Engineering
Obstacles
• Data Structure
• Scattered across systems
• Wrong "shape"
• Unlabelled data
• Data Value
• Format: spelling, units
• Missing values
• Non-optimal correlation
• Non-existant correlation
• Data Significance
• Unwanted: PII, Non-Preferred
• Expensive to collect
• Insidious: Leakage, obviously correlated
Data Transformation
Feature Engineering
Feature Selection
BigML, Inc 5Feature Engineering
Feature Engineering
2013-09-25 10:02
Automatic Date Transformation
… year month day hour minute …
… 2013 Sep 25 10 2 …
… … … … … … …
NUM NUMCAT NUM NUM
DATE-TIME
BigML, Inc 6Feature Engineering
Feature Engineering
Automatic Categorical Transformation
… alchemy_category …
… business …
… recreation …
… health …
… … …
CAT
business health recreation …
… 1 0 0 …
… 0 0 1 …
… 0 1 0 …
… … … … …
NUM NUM NUM
BigML, Inc 7Feature Engineering
Feature Engineering
Be not afraid of greatness:
some are born great, some achieve
greatness, and some have greatness
thrust upon ‘em.
TEXT
Automatic Text Transformation
… great afraid born achieve …
… 4 1 1 1 …
… … … … … …
NUM NUM NUM NUM
BigML, Inc 8Feature Engineering
Feature Engineering
{
“url":"cbsnews",
"title":"Breaking News Headlines
Business Entertainment World News “,
"body":" news covering all the latest
breaking national and world news
headlines, including politics, sports,
entertainment, business and more.”
}
Fixing "non-optimal correlations"
title body
Breaking News… news covering…
… …
TEXT TEXT
TEXT
BigML, Inc 9Feature Engineering
Feature Engineering
Discretization
Total Spend
7.342,99
304,12
4,56
345,87
8.546,32
NUM
“Predict will spend
$3,521 with error
$1,232”
Spend Category
Top 33%
Bottom 33%
Bottom 33%
Middle 33%
Top 33%
CAT
“Predict customer
will be Top 33% in
spending”
BigML, Inc 10Feature Engineering
Feature Engineering
Combinations of Multiple Features
Kg M2
101,4 3,24
85,2 2,8
56,2 2,9
136,1 3,6
95,9 4,1
NUM NUM
BMI
31,29
30,42
19,38
37,81
23,39
NUM
Kg
M2
BigML, Inc 11Feature Engineering
Feature Engineering
Flatline
• BigML’s Domain-Specific Language (DSL) for
Transforming Datasets
• Limited programming language structures
• let, cond, if, maps, list operators, */+-
• Dataset Fields are first-class citizens
• (field “diabetes pedigree”)
• Built-in transformations
• statistics, strings, timestamps, windows
BigML, Inc 12Basic Transformations
Data Labelling
Data may not have labels needed for doing classification
Create specific metrics for adding labels
Name Month - 3 Month - 2 Month - 1
Joe Schmo 123,23 0 0
Jane Plain 0 0 0
Mary Happy 0 55,22 243,33
Tom Thumb 12,34 8,34 14,56
Un-Labelled Data
Labelled data
Name Month - 3 Month - 2 Month - 1 Default
Joe Schmo 123,23 0 0 FALSE
Jane Plain 0 0 0 TRUE
Mary Happy 0 55,22 243,33 FALSE
Tom Thumb 12,34 8,34 14,56 FALSE
(= 0 (+ (abs ( f "Month - 3" ) ) (abs ( f "Month - 2")) (abs ( f "Month - 1") ) ))
BigML, Inc 13Feature Engineering
Feature Engineering
(/ (- ( f "price") (avg-window "price" -4, -1)) (standard-deviation "price"))
date volume price
1 34353 314
2 44455 315
3 22333 315
4 52322 321
5 28000 320
6 31254 319
7 56544 323
8 44331 324
9 81111 287
10 65422 294
11 59999 300
12 45556 302
13 19899 301
14 21453 302
day-4 day-3 day-2 day-1 4davg
-
314 -
314 315 -
314 315 315 -
314 315 315 321 316,25
315 315 321 320 317,75
315 321 320 319 318,75
Current - (4-day avg)
std dev
Shock: Deviations from a Trend
BigML, Inc 14Feature Engineering
Feature Engineering
(/ (- (f "price") (avg-window "price" -4, -1)) (standard-deviation "price"))
Current - (4-day avg)
std dev
Shock: Deviations from a Trend
Current : (field “price”)
4-day avg: (avg-window “price” -4 -1)
std dev: (standard-deviation “price”)
BigML, Inc 15Feature Engineering
Feature Engineering
Moon Phase%
( / ( mod ( - ( / ( epoch ( field {{date-field}} )) 1000 ) 621300 ) 2551443 ) 2551442 )
BigML, Inc 16Feature Engineering
Feature Engineering
Fixing "non-existant correlations"
Highway Number Direction Is Long
2 East-West FALSE
4 East-West FALSE
5 North-South TRUE
8 East-West FALSE
10 East-West TRUE
… … …
Goal: Predict principle direction from highway number
( = (mod (field "Highway Number") 2) 0)
BigML, Inc 17Feature Engineering
Feature Engineering
Fix Missing Values in a “Meaningful” Way
Filter Zeros
Model 

insulin
Predict 

insulin
Select 

insulin
Fixed

Dataset
Amended

Dataset
Original

Dataset
Clean

Dataset
( if ( = (field "insulin") 0) (field "predicted insulin") (field "insulin"))
BigML, Inc 18
Feature Selection
BigML, Inc 19Feature Engineering
Feature Selection
• Model Summary
• Field Importance
• Algorithmic
• Best-First Feature Selection
• Boruta
• Leakage
• Tight Correlations (AD, Plot, Correlations)
• Test Data
• Perfect future knowledge
cat diabetes.csv diabetes_testset.csv | sort | uniq -d | wc -l
BigML, Inc 20
Evaluate & Automate
BigML, Inc 21Feature Engineering
Evaluate & Automate
• Evaluate
• Did you meet the goal?
• If not, did you discover something else useful?
• If not, start over
• If you did…
• Automate - You don’t want to hand code that every time, right?
• Consider tools that are easy to automate
• scripting interface
• APIs
• Ability to maintenance is important
BigML, Inc 22Feature Engineering
The Process
Data
Transform
Define Goal
Model &
Evaluate
no
yes
Better

Data
Not

Possible
Tune

Algorithm
Goal
Met?
Automate
Feature
Engineer &
Selection
Better

Features
BSSML16 L7. Feature Engineering

More Related Content

PDF
BSSML16 L10. Summary Day 2 Sessions
PDF
Web UI, Algorithms, and Feature Engineering
PDF
BSSML16 L8. REST API, Bindings, and Basic Workflows
PDF
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
PDF
VSSML18. Feature Engineering
PDF
BSSML17 - Feature Engineering
PDF
VSSML17 L5. Basic Data Transformations and Feature Engineering
PDF
MLSD18. Feature Engineering
BSSML16 L10. Summary Day 2 Sessions
Web UI, Algorithms, and Feature Engineering
BSSML16 L8. REST API, Bindings, and Basic Workflows
BSSML16 L9. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
VSSML18. Feature Engineering
BSSML17 - Feature Engineering
VSSML17 L5. Basic Data Transformations and Feature Engineering
MLSD18. Feature Engineering

What's hot (20)

PDF
VSSML16 L6. Feature Engineering
PDF
BSSML17 - API and WhizzML
PDF
API, WhizzML and Apps
PDF
VSSML16 L5. Basic Data Transformations
PDF
VSSML16 L8. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
PDF
VSSML17 Review. Summary Day 2 Sessions
PDF
BigML Summer 2016 Release
PDF
VSSML18. Data Transformations
PDF
VSSML16 LR1. Summary Day 1
PDF
BigML Summer 2017 Release
PDF
BSSML17 - Ensembles
PDF
VSSML16 L7. REST API, Bindings, and Basic Workflows
PDF
A developer's overview of the world of predictive APIs
PPTX
Hundreds of queries in the time of one - Gianmario Spacagna
PDF
Big Data, Bigger Analytics
PDF
BigML Fall 2016 Release
PPTX
Jean-François Puget, Distinguished Engineer, Machine Learning and Optimizatio...
PDF
MLSD18. Ensembles, Logistic Regression, Deepnets
PPTX
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
PDF
Data Product Architectures
VSSML16 L6. Feature Engineering
BSSML17 - API and WhizzML
API, WhizzML and Apps
VSSML16 L5. Basic Data Transformations
VSSML16 L8. Advanced Workflows: Feature Selection, Boosting, Gradient Descent...
VSSML17 Review. Summary Day 2 Sessions
BigML Summer 2016 Release
VSSML18. Data Transformations
VSSML16 LR1. Summary Day 1
BigML Summer 2017 Release
BSSML17 - Ensembles
VSSML16 L7. REST API, Bindings, and Basic Workflows
A developer's overview of the world of predictive APIs
Hundreds of queries in the time of one - Gianmario Spacagna
Big Data, Bigger Analytics
BigML Fall 2016 Release
Jean-François Puget, Distinguished Engineer, Machine Learning and Optimizatio...
MLSD18. Ensembles, Logistic Regression, Deepnets
Misha Bilenko, Principal Researcher, Microsoft at MLconf SEA - 5/01/15
Data Product Architectures
Ad

Similar to BSSML16 L7. Feature Engineering (20)

PDF
MLSEV. Automating Decision Making
PDF
DutchMLSchool. Automating Decision Making
PDF
BigML Education - Feature Engineering with Flatline
PDF
BSSML17 - Basic Data Transformations
PDF
Tugdual Grall - From SQL to NoSQL in less than 40 min - NoSQL matters Paris 2015
PDF
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
PDF
MLSEV. Use Case: Predicting Manufacturing Results with Machine Learning
PPTX
Decision Optimization - CPLEX Optimization Studio - Product Overview(2).PPTX
PDF
Horizon 20110928
PPT
Dimensional Modelling Session 2
PDF
Design Optimization of Safety Critical Component for Fatigue and Strength Usi...
PDF
IncQuery Labs Models 2020 MIP Talk
PPTX
How to Achieve Scale with MongoDB
PDF
Using BigDL on Apache Spark to Improve the MLS Real Estate Search Experience ...
PDF
The five graphs of telecommunications may 22 2013 webinar final
PDF
The five graphs of telecommunications may 22 2013 webinar final
PDF
New Opportunities for Connected Data - Emil Eifrem @ GraphConnect Boston + Ch...
PDF
Constraint Programming - An Alternative Approach to Heuristics in Scheduling
PPT
Interactive Cad Solutions
PDF
Katmanlı Üretim (Additive manufacturing) bilgi görseli
MLSEV. Automating Decision Making
DutchMLSchool. Automating Decision Making
BigML Education - Feature Engineering with Flatline
BSSML17 - Basic Data Transformations
Tugdual Grall - From SQL to NoSQL in less than 40 min - NoSQL matters Paris 2015
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
MLSEV. Use Case: Predicting Manufacturing Results with Machine Learning
Decision Optimization - CPLEX Optimization Studio - Product Overview(2).PPTX
Horizon 20110928
Dimensional Modelling Session 2
Design Optimization of Safety Critical Component for Fatigue and Strength Usi...
IncQuery Labs Models 2020 MIP Talk
How to Achieve Scale with MongoDB
Using BigDL on Apache Spark to Improve the MLS Real Estate Search Experience ...
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
New Opportunities for Connected Data - Emil Eifrem @ GraphConnect Boston + Ch...
Constraint Programming - An Alternative Approach to Heuristics in Scheduling
Interactive Cad Solutions
Katmanlı Üretim (Additive manufacturing) bilgi görseli
Ad

More from BigML, Inc (20)

PDF
Digital Transformation and Process Optimization in Manufacturing
PDF
DutchMLSchool 2022 - Automation
PDF
DutchMLSchool 2022 - ML for AML Compliance
PDF
DutchMLSchool 2022 - Multi Perspective Anomalies
PDF
DutchMLSchool 2022 - My First Anomaly Detector
PDF
DutchMLSchool 2022 - Anomaly Detection
PDF
DutchMLSchool 2022 - History and Developments in ML
PDF
DutchMLSchool 2022 - End-to-End ML
PDF
DutchMLSchool 2022 - A Data-Driven Company
PDF
DutchMLSchool 2022 - ML in the Legal Sector
PDF
DutchMLSchool 2022 - Smart Safe Stadiums
PDF
DutchMLSchool 2022 - Process Optimization in Manufacturing Plants
PDF
DutchMLSchool 2022 - Anomaly Detection at Scale
PDF
DutchMLSchool 2022 - Citizen Development in AI
PDF
Democratizing Object Detection
PDF
BigML Release: Image Processing
PDF
Machine Learning in Retail: Know Your Customers' Customer. See Your Future
PDF
Machine Learning in Retail: ML in the Retail Sector
PDF
ML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
PDF
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...
Digital Transformation and Process Optimization in Manufacturing
DutchMLSchool 2022 - Automation
DutchMLSchool 2022 - ML for AML Compliance
DutchMLSchool 2022 - Multi Perspective Anomalies
DutchMLSchool 2022 - My First Anomaly Detector
DutchMLSchool 2022 - Anomaly Detection
DutchMLSchool 2022 - History and Developments in ML
DutchMLSchool 2022 - End-to-End ML
DutchMLSchool 2022 - A Data-Driven Company
DutchMLSchool 2022 - ML in the Legal Sector
DutchMLSchool 2022 - Smart Safe Stadiums
DutchMLSchool 2022 - Process Optimization in Manufacturing Plants
DutchMLSchool 2022 - Anomaly Detection at Scale
DutchMLSchool 2022 - Citizen Development in AI
Democratizing Object Detection
BigML Release: Image Processing
Machine Learning in Retail: Know Your Customers' Customer. See Your Future
Machine Learning in Retail: ML in the Retail Sector
ML in GRC: Machine Learning in Legal Automation, How to Trust a Lawyerbot
ML in GRC: Supporting Human Decision Making for Regulatory Adherence with Mac...

Recently uploaded (20)

PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PPTX
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PPTX
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
PDF
Introduction to the R Programming Language
PDF
Introduction to Data Science and Data Analysis
PDF
Global Data and Analytics Market Outlook Report
PPTX
Pilar Kemerdekaan dan Identi Bangsa.pptx
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PDF
Optimise Shopper Experiences with a Strong Data Estate.pdf
PDF
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
PPTX
retention in jsjsksksksnbsndjddjdnFPD.pptx
PPTX
Managing Community Partner Relationships
PPTX
CYBER SECURITY the Next Warefare Tactics
PPT
Predictive modeling basics in data cleaning process
PPTX
SAP 2 completion done . PRESENTATION.pptx
PDF
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
DOCX
Factor Analysis Word Document Presentation
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
STERILIZATION AND DISINFECTION-1.ppthhhbx
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
Introduction to the R Programming Language
Introduction to Data Science and Data Analysis
Global Data and Analytics Market Outlook Report
Pilar Kemerdekaan dan Identi Bangsa.pptx
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
Optimise Shopper Experiences with a Strong Data Estate.pdf
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
retention in jsjsksksksnbsndjddjdnFPD.pptx
Managing Community Partner Relationships
CYBER SECURITY the Next Warefare Tactics
Predictive modeling basics in data cleaning process
SAP 2 completion done . PRESENTATION.pptx
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
Factor Analysis Word Document Presentation

BSSML16 L7. Feature Engineering

  • 1. D E C E M B E R 8 - 9 , 2 0 1 6
  • 2. BigML, Inc 2 Poul Petersen CIO, BigML, Inc. Feature Engineering Creating Machine Learning Ready Data
  • 3. BigML, Inc 3Feature Engineering Machine Learning Secret “…the largest improvements in accuracy often came from quick experiments, feature engineering, and model tuning rather than applying fundamentally different algorithms.” Facebook FBLearner 2016 Feature Engineering: applying domain knowledge of the data to create features that make machine learning algorithms work better or at all.
  • 4. BigML, Inc 4Feature Engineering Obstacles • Data Structure • Scattered across systems • Wrong "shape" • Unlabelled data • Data Value • Format: spelling, units • Missing values • Non-optimal correlation • Non-existant correlation • Data Significance • Unwanted: PII, Non-Preferred • Expensive to collect • Insidious: Leakage, obviously correlated Data Transformation Feature Engineering Feature Selection
  • 5. BigML, Inc 5Feature Engineering Feature Engineering 2013-09-25 10:02 Automatic Date Transformation … year month day hour minute … … 2013 Sep 25 10 2 … … … … … … … … NUM NUMCAT NUM NUM DATE-TIME
  • 6. BigML, Inc 6Feature Engineering Feature Engineering Automatic Categorical Transformation … alchemy_category … … business … … recreation … … health … … … … CAT business health recreation … … 1 0 0 … … 0 0 1 … … 0 1 0 … … … … … … NUM NUM NUM
  • 7. BigML, Inc 7Feature Engineering Feature Engineering Be not afraid of greatness: some are born great, some achieve greatness, and some have greatness thrust upon ‘em. TEXT Automatic Text Transformation … great afraid born achieve … … 4 1 1 1 … … … … … … … NUM NUM NUM NUM
  • 8. BigML, Inc 8Feature Engineering Feature Engineering { “url":"cbsnews", "title":"Breaking News Headlines Business Entertainment World News “, "body":" news covering all the latest breaking national and world news headlines, including politics, sports, entertainment, business and more.” } Fixing "non-optimal correlations" title body Breaking News… news covering… … … TEXT TEXT TEXT
  • 9. BigML, Inc 9Feature Engineering Feature Engineering Discretization Total Spend 7.342,99 304,12 4,56 345,87 8.546,32 NUM “Predict will spend $3,521 with error $1,232” Spend Category Top 33% Bottom 33% Bottom 33% Middle 33% Top 33% CAT “Predict customer will be Top 33% in spending”
  • 10. BigML, Inc 10Feature Engineering Feature Engineering Combinations of Multiple Features Kg M2 101,4 3,24 85,2 2,8 56,2 2,9 136,1 3,6 95,9 4,1 NUM NUM BMI 31,29 30,42 19,38 37,81 23,39 NUM Kg M2
  • 11. BigML, Inc 11Feature Engineering Feature Engineering Flatline • BigML’s Domain-Specific Language (DSL) for Transforming Datasets • Limited programming language structures • let, cond, if, maps, list operators, */+- • Dataset Fields are first-class citizens • (field “diabetes pedigree”) • Built-in transformations • statistics, strings, timestamps, windows
  • 12. BigML, Inc 12Basic Transformations Data Labelling Data may not have labels needed for doing classification Create specific metrics for adding labels Name Month - 3 Month - 2 Month - 1 Joe Schmo 123,23 0 0 Jane Plain 0 0 0 Mary Happy 0 55,22 243,33 Tom Thumb 12,34 8,34 14,56 Un-Labelled Data Labelled data Name Month - 3 Month - 2 Month - 1 Default Joe Schmo 123,23 0 0 FALSE Jane Plain 0 0 0 TRUE Mary Happy 0 55,22 243,33 FALSE Tom Thumb 12,34 8,34 14,56 FALSE (= 0 (+ (abs ( f "Month - 3" ) ) (abs ( f "Month - 2")) (abs ( f "Month - 1") ) ))
  • 13. BigML, Inc 13Feature Engineering Feature Engineering (/ (- ( f "price") (avg-window "price" -4, -1)) (standard-deviation "price")) date volume price 1 34353 314 2 44455 315 3 22333 315 4 52322 321 5 28000 320 6 31254 319 7 56544 323 8 44331 324 9 81111 287 10 65422 294 11 59999 300 12 45556 302 13 19899 301 14 21453 302 day-4 day-3 day-2 day-1 4davg - 314 - 314 315 - 314 315 315 - 314 315 315 321 316,25 315 315 321 320 317,75 315 321 320 319 318,75 Current - (4-day avg) std dev Shock: Deviations from a Trend
  • 14. BigML, Inc 14Feature Engineering Feature Engineering (/ (- (f "price") (avg-window "price" -4, -1)) (standard-deviation "price")) Current - (4-day avg) std dev Shock: Deviations from a Trend Current : (field “price”) 4-day avg: (avg-window “price” -4 -1) std dev: (standard-deviation “price”)
  • 15. BigML, Inc 15Feature Engineering Feature Engineering Moon Phase% ( / ( mod ( - ( / ( epoch ( field {{date-field}} )) 1000 ) 621300 ) 2551443 ) 2551442 )
  • 16. BigML, Inc 16Feature Engineering Feature Engineering Fixing "non-existant correlations" Highway Number Direction Is Long 2 East-West FALSE 4 East-West FALSE 5 North-South TRUE 8 East-West FALSE 10 East-West TRUE … … … Goal: Predict principle direction from highway number ( = (mod (field "Highway Number") 2) 0)
  • 17. BigML, Inc 17Feature Engineering Feature Engineering Fix Missing Values in a “Meaningful” Way Filter Zeros Model 
 insulin Predict 
 insulin Select 
 insulin Fixed
 Dataset Amended
 Dataset Original
 Dataset Clean
 Dataset ( if ( = (field "insulin") 0) (field "predicted insulin") (field "insulin"))
  • 19. BigML, Inc 19Feature Engineering Feature Selection • Model Summary • Field Importance • Algorithmic • Best-First Feature Selection • Boruta • Leakage • Tight Correlations (AD, Plot, Correlations) • Test Data • Perfect future knowledge cat diabetes.csv diabetes_testset.csv | sort | uniq -d | wc -l
  • 21. BigML, Inc 21Feature Engineering Evaluate & Automate • Evaluate • Did you meet the goal? • If not, did you discover something else useful? • If not, start over • If you did… • Automate - You don’t want to hand code that every time, right? • Consider tools that are easy to automate • scripting interface • APIs • Ability to maintenance is important
  • 22. BigML, Inc 22Feature Engineering The Process Data Transform Define Goal Model & Evaluate no yes Better Data Not Possible Tune Algorithm Goal Met? Automate Feature Engineer & Selection Better
 Features