SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Make Sense Out of Data
with Feature Engineering
Xavier Conort
Chief Data Scientist at DataRobot
@Melbourne Data Science Initiative 2016
Agenda
Preamble
2 examples:
Key takeaways
Automation is integral part of human civilization
Car
Destination Crude oil
Refined Oil
process oil into more useful products such gasoline
A successful journeyKey elements for a successful car journey
Car = Modelling engine
Machine Learning solutions replace more and more traditional statistical
approach and can automate the modelling process and produce world-
class predictive accuracy without much effort
Destination = Outcome
well defined outcome to predict and well defined
process to use it to optimize business problems
Crude Oil = Raw Data
increased volume and capacity to handle
terabytes of Data
Refined oil = Feature Engineering
talent to extract from raw data
information that can be used by models
open source
programming
social network of
coders
automated
solutions
Key elements for a successful data science journey
Refined oil for Machine Learning:
Flat File Data Format
© DataRobot, Inc. All rights reserved. Confidential
● 1 record per prediction event
● 1 column for each predictive field / feature
● 1 column for the value to be predicted
(training data only)
6
ID Feature 1 Feature 2 Feature 3 Feature 4 Feature 5 Target
1 0.73 Female 5.28 Thursday 37.52 Yes
2 0.20 Male 4.20 Tuesday 35.04 Yes
3 1.82 Male 14.71 Friday 7.02 Yes
4 -0.69 Female 11.82 Sunday -3.29 No
5 1.07 Male 16.55 Monday 12.59 Yes
6 -0.27 Male 10.87 Thursday -8.19 Yes
7 2.88 Male 5.24 Wednesday -21.67 No
8 1.35 Female 9.40 Tuesday 9.70 Yes
9 0.73 Female 1.04 Sunday 26.60 Yes
10 0.02 Female -9.79 Saturday -14.47 Yes
11 3.43 Male 11.59 Thursday 27.48 No
12 2.56 Female -13.25 Saturday 12.41 No
Feature Engineering that we will cover today
● Variables you should not use
● Dealing with high dimensional features
● Using external data to add valuable information
● Dealing with transactional data
© DataRobot, Inc. All rights reserved. Confidential
7
8
● Hosted by Practice Fusion, a cloud-based electronic health record
platform for doctors and patients
● Challenge: Given a de-identified data set of patient electronic health
records, build a model to determine who has a diabetes diagnosis
● Data:
○ 17 tables containing 4 years history of medical records!
Example 1:
Think of variables you should not use
© DataRobot, Inc. All rights reserved. Confidential
Feature Engineering the YearOfBirth Value
● We expect that as a patient gets older their risk of
diabetes will increase, yet their YearOfBirth value
remains static
● We need a feature that changes as the patient gets
older
● The true predictor of diabetes is more likely to be age
than year of birth
● The data is extracted at the end of 2012
● Age = 2012 - YearOfBirth
9
Learn to deal with high dimensionality
© DataRobot, Inc. All rights reserved. Confidential
10
● Add characteristics of levels of categorical
features to see how similar they are
● Use location for regional categories to see how
close they are
● Group hierarchical categories together based
on those hierarchies
● Text mine the descriptions
● Use the overall ordinal frequency ranking as a
feature
● Top Kagglers likelihood / credibility features
Case study: engineer state variable
© DataRobot, Inc. All rights reserved. Confidential
11
● So that the machine learning algorithms can
know which states are near (and possibly
similar to) each other
● Centroid for each of the 51 states
http://dev.maxmind.com/geoip/legacy/codes/state_latlon/
Case study: engineer diagnosis
© DataRobot, Inc. All rights reserved. Confidential
12
● Use the ICD9 code groupings
https://en.wikipedia.org/wiki/List_of_ICD-9_codes
○ So that the machine learning algorithms
can know which diagnoses are similar to
each other
○ Count the observations in each group
● Use the ICD9 descriptions
○ Do text mining on the descriptions to
find words or phrases within the
descriptions
Case Study: engineer drugs
© DataRobot, Inc. All rights reserved. Confidential
13
● Use drug databases
http://www.fda.gov/drugs/informationondrugs/ucm142438.htm
● To enable the machine learning algorithm
to know which drugs are similar:
○ Replace proprietary brand names with
generic medication names
○ Text mine the list of pharmaceutical
classes
But What About Relational Databases?
© DataRobot, Inc. All rights reserved. Confidential
14
Challenge: many records per patient
○ 9948 patients
○ 196,290 transcripts
○ 142,741 diagnostics
○ 66,487 medications
○ 3,030 lab results
Deal with one to many relationships
© DataRobot, Inc. All rights reserved. Confidential
● create predictive fields using summary
statistics
○ e.g. averages of last 24 hours / week /
month / year
○ e.g. variance or standard deviation
○ e.g. entropy
○ e.g. maximum or minimum values
○ e.g. counts
○ e.g. most frequent value
○ e.g. sequences of events
15
ID Feature 1 Feature 2 Feature 3 Feature 4 Feature 5 Target
1 0.73 Female 5.28 Thursday 37.52 Yes
2 0.20 Male 4.20 Tuesday 35.04 Yes
3 1.82 Male 14.71 Friday 7.02 Yes
4 -0.69 Female 11.82 Sunday -3.29 No
5 1.07 Male 16.55 Monday 12.59 Yes
6 -0.27 Male 10.87 Thursday -8.19 Yes
7 2.88 Male 5.24 Wednesday -21.67 No
8 1.35 Female 9.40 Tuesday 9.70 Yes
9 0.73 Female 1.04 Sunday 26.60 Yes
10 0.02 Female -9.79 Saturday -14.47 Yes
11 3.43 Male 11.59 Thursday 27.48 No
12 2.56 Female -13.25 Saturday 12.41 No
Case Study: Relationship Between a Patient
and Diagnosis
© DataRobot, Inc. All rights reserved. Confidential
● One patient to many diagnoses
● Uniquely joined via PatientGuid
16
Case Study: Build sequences string
© DataRobot, Inc. All rights reserved. Confidential
Feature Engineering the ICD9 Codes
● One patient can have from 1 to 75 diagnoses
● We need to compress this data to a single record
per patient
● One way is to concatenate the sequence of
diagnoses into a string and do text mining models
that use ngrams on that string
● It often helps to remove consecutive duplicates
● Sometimes it is useful to know the first and last
events, and the times of those events
17
Patient ID ICD9Code
12345 391
12345 401
12345 401
12345 454.1
12346 410.3
12346 463
Case Study: Count and entropy
© DataRobot, Inc. All rights reserved. Confidential
Feature Engineering the ICD9 Codes
● One patient can have from 1 to 75 diagnoses
● We need to compress this data to a single record
per patient
● Sometimes it is useful to know
○ The number of events
○ The most common event type
○ The level of variety of event types e.g. the
entropy (as my colleague Owen Zhang did
for the KKD Cup 2015)
18
Patient ID ICD9Code
12345 391
12345 401
12345 401
12345 454.1
12346 410.3
12346 463
-propn*ln(propn)
= -0.25*ln(0.25)
=0.347
Case Study: Timing stats
© DataRobot, Inc. All rights reserved. Confidential
Feature Engineering the Timing of Diagnoses
● One patient can have from 1 to 75 diagnoses
● We need to compress this data to a single record
per patient
● Sometimes it is useful to know information about
the timing of events
○ The range of event times e.g. mean, median,
maximum, minimum, quantiles
○ The amount of time between events e.g. mean,
median, maximum, minimum, quantiles
○ The regularity of the timing of events e.g.
variance
19
Hosted by XuetangX, a Chinese MOOC learning platform initiated by Tsinghua
University
Challenge: predict whether a user will drop a course within next 10 days based on his or
her prior activities.
Data:
enrollment_train (120K rows) / enrollment_test (80K rows):
Columns: enrollment_id, username, course_id
log_train / log_test
Columns: enrollment_id, time, source, event, object
object
Columns: course_id, module_id, category, children, start
truth_train
Columns: enrollment_id, dropped_out
Example 2:
We applied same recipes to log data
5890
objects
and generated a flat file with 100s of
features!!!
Techniques we used in
… to describe course, enrollment and students from log
data:
counts
time statistics (min, mean, max, diff)
entropy
sequences treated as text on which we ran
SVD and logistic regression on 3grams
20 first components of SVD on user x object
More can be found in http://www.slideshare.net/DataRobot/featurizing-log-data-before-xgboost
Key takeaways
Machine Learning (ML) can automatically generate world class
predictive accuracy
But feature engineering is still an art that requires a lot of creativity,
business insight, curiosity and effort
Be careful! Infinite number of features can be generated… Start with
winning recipes (steal them from others and make up your own)
and then iterate with new recipes, ideas, external data... Stop when
you don’t get much additional accuracy

Contenu connexe

Tendances

10 R Packages to Win Kaggle Competitions
10 R Packages to Win Kaggle Competitions10 R Packages to Win Kaggle Competitions
10 R Packages to Win Kaggle CompetitionsDataRobot
 
General Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsGeneral Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsMark Peng
 
Hacking Predictive Modeling - RoadSec 2018
Hacking Predictive Modeling - RoadSec 2018Hacking Predictive Modeling - RoadSec 2018
Hacking Predictive Modeling - RoadSec 2018HJ van Veen
 
Introduction to Machine learning
Introduction to Machine learningIntroduction to Machine learning
Introduction to Machine learningKnoldus Inc.
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature EngineeringHJ van Veen
 
Machine learning_ Replicating Human Brain
Machine learning_ Replicating Human BrainMachine learning_ Replicating Human Brain
Machine learning_ Replicating Human BrainNishant Jain
 
Online Machine Learning: introduction and examples
Online Machine Learning:  introduction and examplesOnline Machine Learning:  introduction and examples
Online Machine Learning: introduction and examplesFelipe
 
H2O World - Ensembles with Erin LeDell
H2O World - Ensembles with Erin LeDellH2O World - Ensembles with Erin LeDell
H2O World - Ensembles with Erin LeDellSri Ambati
 
A Friendly Introduction to Machine Learning
A Friendly Introduction to Machine LearningA Friendly Introduction to Machine Learning
A Friendly Introduction to Machine LearningHaptik
 
Machine Learning presentation.
Machine Learning presentation.Machine Learning presentation.
Machine Learning presentation.butest
 
machine learning
machine learningmachine learning
machine learningMounisha A
 
Feature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsFeature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsGabriel Moreira
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningRebecca Bilbro
 
The Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistThe Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistRebecca Bilbro
 
Session 06 machine learning.pptx
Session 06 machine learning.pptxSession 06 machine learning.pptx
Session 06 machine learning.pptxbodaceacat
 
Machine learning the next revolution or just another hype
Machine learning   the next revolution or just another hypeMachine learning   the next revolution or just another hype
Machine learning the next revolution or just another hypeJorge Ferrer
 
Predicting Tweet Sentiment
Predicting Tweet SentimentPredicting Tweet Sentiment
Predicting Tweet SentimentLucinda Linde
 

Tendances (20)

10 R Packages to Win Kaggle Competitions
10 R Packages to Win Kaggle Competitions10 R Packages to Win Kaggle Competitions
10 R Packages to Win Kaggle Competitions
 
Machine Learning for Dummies
Machine Learning for DummiesMachine Learning for Dummies
Machine Learning for Dummies
 
kaggle_meet_up
kaggle_meet_upkaggle_meet_up
kaggle_meet_up
 
General Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsGeneral Tips for participating Kaggle Competitions
General Tips for participating Kaggle Competitions
 
Hacking Predictive Modeling - RoadSec 2018
Hacking Predictive Modeling - RoadSec 2018Hacking Predictive Modeling - RoadSec 2018
Hacking Predictive Modeling - RoadSec 2018
 
L11. The Future of Machine Learning
L11. The Future of Machine LearningL11. The Future of Machine Learning
L11. The Future of Machine Learning
 
Introduction to Machine learning
Introduction to Machine learningIntroduction to Machine learning
Introduction to Machine learning
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature Engineering
 
Machine learning_ Replicating Human Brain
Machine learning_ Replicating Human BrainMachine learning_ Replicating Human Brain
Machine learning_ Replicating Human Brain
 
Online Machine Learning: introduction and examples
Online Machine Learning:  introduction and examplesOnline Machine Learning:  introduction and examples
Online Machine Learning: introduction and examples
 
H2O World - Ensembles with Erin LeDell
H2O World - Ensembles with Erin LeDellH2O World - Ensembles with Erin LeDell
H2O World - Ensembles with Erin LeDell
 
A Friendly Introduction to Machine Learning
A Friendly Introduction to Machine LearningA Friendly Introduction to Machine Learning
A Friendly Introduction to Machine Learning
 
Machine Learning presentation.
Machine Learning presentation.Machine Learning presentation.
Machine Learning presentation.
 
machine learning
machine learningmachine learning
machine learning
 
Feature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsFeature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive models
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine Learning
 
The Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistThe Incredible Disappearing Data Scientist
The Incredible Disappearing Data Scientist
 
Session 06 machine learning.pptx
Session 06 machine learning.pptxSession 06 machine learning.pptx
Session 06 machine learning.pptx
 
Machine learning the next revolution or just another hype
Machine learning   the next revolution or just another hypeMachine learning   the next revolution or just another hype
Machine learning the next revolution or just another hype
 
Predicting Tweet Sentiment
Predicting Tweet SentimentPredicting Tweet Sentiment
Predicting Tweet Sentiment
 

En vedette

HackerEarth helping a startup hire developers - The Practo Case Study
HackerEarth helping a startup hire developers - The Practo Case StudyHackerEarth helping a startup hire developers - The Practo Case Study
HackerEarth helping a startup hire developers - The Practo Case StudyHackerEarth
 
How hackathons can drive top line revenue growth
How hackathons can drive top line revenue growthHow hackathons can drive top line revenue growth
How hackathons can drive top line revenue growthHackerEarth
 
How to assess & hire Java developers accurately?
How to assess & hire Java developers accurately?How to assess & hire Java developers accurately?
How to assess & hire Java developers accurately?HackerEarth
 
DataRobot R Package
DataRobot R PackageDataRobot R Package
DataRobot R PackageDataRobot
 
Open Innovation - A Case Study
Open Innovation - A Case StudyOpen Innovation - A Case Study
Open Innovation - A Case StudyHackerEarth
 
Tda presentation
Tda presentationTda presentation
Tda presentationHJ van Veen
 
HackerEarth Sourcing Solution
HackerEarth Sourcing SolutionHackerEarth Sourcing Solution
HackerEarth Sourcing SolutionHackerEarth
 
Data science at the command line
Data science at the command lineData science at the command line
Data science at the command lineSharat Chikkerur
 
Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...
Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...
Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...Spark Summit
 
Intra company hackathons using HackerEarth
Intra company hackathons using HackerEarthIntra company hackathons using HackerEarth
Intra company hackathons using HackerEarthHackerEarth
 
Druva Casestudy - HackerEarth
Druva Casestudy - HackerEarthDruva Casestudy - HackerEarth
Druva Casestudy - HackerEarthHackerEarth
 
USC LIGHT Ministry Introduction
USC LIGHT Ministry IntroductionUSC LIGHT Ministry Introduction
USC LIGHT Ministry IntroductionJeong-Yoon Lee
 
Leverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and RecruitingLeverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and RecruitingHackerEarth
 
Menstrual Health Reader - mEo
Menstrual Health Reader - mEoMenstrual Health Reader - mEo
Menstrual Health Reader - mEoHackerEarth
 
6 rules of enterprise innovation
6 rules of enterprise innovation6 rules of enterprise innovation
6 rules of enterprise innovationHackerEarth
 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingTed Xiao
 
Data Science Competition
Data Science CompetitionData Science Competition
Data Science CompetitionJeong-Yoon Lee
 
Wapid and wobust active online machine leawning with Vowpal Wabbit
Wapid and wobust active online machine leawning with Vowpal Wabbit Wapid and wobust active online machine leawning with Vowpal Wabbit
Wapid and wobust active online machine leawning with Vowpal Wabbit Antti Haapala
 

En vedette (20)

HackerEarth helping a startup hire developers - The Practo Case Study
HackerEarth helping a startup hire developers - The Practo Case StudyHackerEarth helping a startup hire developers - The Practo Case Study
HackerEarth helping a startup hire developers - The Practo Case Study
 
How hackathons can drive top line revenue growth
How hackathons can drive top line revenue growthHow hackathons can drive top line revenue growth
How hackathons can drive top line revenue growth
 
How to assess & hire Java developers accurately?
How to assess & hire Java developers accurately?How to assess & hire Java developers accurately?
How to assess & hire Java developers accurately?
 
Work - LIGHT Ministry
Work - LIGHT MinistryWork - LIGHT Ministry
Work - LIGHT Ministry
 
DataRobot R Package
DataRobot R PackageDataRobot R Package
DataRobot R Package
 
Open Innovation - A Case Study
Open Innovation - A Case StudyOpen Innovation - A Case Study
Open Innovation - A Case Study
 
Tda presentation
Tda presentationTda presentation
Tda presentation
 
HackerEarth Sourcing Solution
HackerEarth Sourcing SolutionHackerEarth Sourcing Solution
HackerEarth Sourcing Solution
 
Data science at the command line
Data science at the command lineData science at the command line
Data science at the command line
 
Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...
Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...
Feature Hashing for Scalable Machine Learning: Spark Summit East talk by Nick...
 
Intra company hackathons using HackerEarth
Intra company hackathons using HackerEarthIntra company hackathons using HackerEarth
Intra company hackathons using HackerEarth
 
Druva Casestudy - HackerEarth
Druva Casestudy - HackerEarthDruva Casestudy - HackerEarth
Druva Casestudy - HackerEarth
 
USC LIGHT Ministry Introduction
USC LIGHT Ministry IntroductionUSC LIGHT Ministry Introduction
USC LIGHT Ministry Introduction
 
Leverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and RecruitingLeverage Social Media for Employer Brand and Recruiting
Leverage Social Media for Employer Brand and Recruiting
 
Kill the wabbit
Kill the wabbitKill the wabbit
Kill the wabbit
 
Menstrual Health Reader - mEo
Menstrual Health Reader - mEoMenstrual Health Reader - mEo
Menstrual Health Reader - mEo
 
6 rules of enterprise innovation
6 rules of enterprise innovation6 rules of enterprise innovation
6 rules of enterprise innovation
 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language Processing
 
Data Science Competition
Data Science CompetitionData Science Competition
Data Science Competition
 
Wapid and wobust active online machine leawning with Vowpal Wabbit
Wapid and wobust active online machine leawning with Vowpal Wabbit Wapid and wobust active online machine leawning with Vowpal Wabbit
Wapid and wobust active online machine leawning with Vowpal Wabbit
 

Similaire à Make Sense Out of Data with Feature Engineering

How can a data scientist expert solve real world problems?
How can a data scientist expert solve real world problems? How can a data scientist expert solve real world problems?
How can a data scientist expert solve real world problems? priyanka rajput
 
DATI, AI E ROBOTICA @POLITO
DATI, AI E ROBOTICA @POLITODATI, AI E ROBOTICA @POLITO
DATI, AI E ROBOTICA @POLITOMarcoMellia
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaDatabricks
 
CTMS Data Migration by Krishnaveni Rapuru
CTMS Data Migration  by Krishnaveni RapuruCTMS Data Migration  by Krishnaveni Rapuru
CTMS Data Migration by Krishnaveni RapuruMuraliRaj M
 
Training and deploying an image classification model
Training and deploying an image classification modelTraining and deploying an image classification model
Training and deploying an image classification modelKnoldus Inc.
 
Maximize Your Understanding of Operational Realities in Manufacturing with Pr...
Maximize Your Understanding of Operational Realities in Manufacturing with Pr...Maximize Your Understanding of Operational Realities in Manufacturing with Pr...
Maximize Your Understanding of Operational Realities in Manufacturing with Pr...Bigfinite
 
Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned
Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned
Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned CaaS EU FP7 Project
 
20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vsIan Feller
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data SciencePouria Amirian
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data SciencePouria Amirian
 
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Predictive Model and Record Description with Segmented Sensitivity Analysis (...Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Predictive Model and Record Description with Segmented Sensitivity Analysis (...Greg Makowski
 
Comparison Between WEKA and Salford System in Data Mining Software
Comparison Between WEKA and Salford System in Data Mining SoftwareComparison Between WEKA and Salford System in Data Mining Software
Comparison Between WEKA and Salford System in Data Mining SoftwareUniversitas Pembangunan Panca Budi
 
Predicting Medical Test Results using Driverless AI
Predicting Medical Test Results using Driverless AIPredicting Medical Test Results using Driverless AI
Predicting Medical Test Results using Driverless AISri Ambati
 
Data Analytics Using R - Report
Data Analytics Using R - ReportData Analytics Using R - Report
Data Analytics Using R - ReportAkanksha Gohil
 
Philly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by ConstructionPhilly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by Constructionjxyz
 
Crossing the Analytics Chasm and Getting the Models You Developed Deployed
Crossing the Analytics Chasm and Getting the Models You Developed DeployedCrossing the Analytics Chasm and Getting the Models You Developed Deployed
Crossing the Analytics Chasm and Getting the Models You Developed DeployedRobert Grossman
 
Data science / Big Data
Data science / Big DataData science / Big Data
Data science / Big DataYasas Senarath
 

Similaire à Make Sense Out of Data with Feature Engineering (20)

How can a data scientist expert solve real world problems?
How can a data scientist expert solve real world problems? How can a data scientist expert solve real world problems?
How can a data scientist expert solve real world problems?
 
DATI, AI E ROBOTICA @POLITO
DATI, AI E ROBOTICA @POLITODATI, AI E ROBOTICA @POLITO
DATI, AI E ROBOTICA @POLITO
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
 
Data Science and Analysis.pptx
Data Science and Analysis.pptxData Science and Analysis.pptx
Data Science and Analysis.pptx
 
CTMS Data Migration by Krishnaveni Rapuru
CTMS Data Migration  by Krishnaveni RapuruCTMS Data Migration  by Krishnaveni Rapuru
CTMS Data Migration by Krishnaveni Rapuru
 
Training and deploying an image classification model
Training and deploying an image classification modelTraining and deploying an image classification model
Training and deploying an image classification model
 
Maximize Your Understanding of Operational Realities in Manufacturing with Pr...
Maximize Your Understanding of Operational Realities in Manufacturing with Pr...Maximize Your Understanding of Operational Realities in Manufacturing with Pr...
Maximize Your Understanding of Operational Realities in Manufacturing with Pr...
 
Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned
Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned
Applying Capability Modelling in the Genomics Diagnosis Domain: Lessons Learned
 
20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data Science
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data Science
 
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Predictive Model and Record Description with Segmented Sensitivity Analysis (...Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
 
Comparison Between WEKA and Salford System in Data Mining Software
Comparison Between WEKA and Salford System in Data Mining SoftwareComparison Between WEKA and Salford System in Data Mining Software
Comparison Between WEKA and Salford System in Data Mining Software
 
Predicting Medical Test Results using Driverless AI
Predicting Medical Test Results using Driverless AIPredicting Medical Test Results using Driverless AI
Predicting Medical Test Results using Driverless AI
 
Data Analytics Using R - Report
Data Analytics Using R - ReportData Analytics Using R - Report
Data Analytics Using R - Report
 
Philly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by ConstructionPhilly ETE 2016: Securing Software by Construction
Philly ETE 2016: Securing Software by Construction
 
Data science guide
Data science guideData science guide
Data science guide
 
Crossing the Analytics Chasm and Getting the Models You Developed Deployed
Crossing the Analytics Chasm and Getting the Models You Developed DeployedCrossing the Analytics Chasm and Getting the Models You Developed Deployed
Crossing the Analytics Chasm and Getting the Models You Developed Deployed
 
Resume_01022017
Resume_01022017Resume_01022017
Resume_01022017
 
Data science / Big Data
Data science / Big DataData science / Big Data
Data science / Big Data
 

Dernier

Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
Principles and Practices of Data Visualization
Principles and Practices of Data VisualizationPrinciples and Practices of Data Visualization
Principles and Practices of Data VisualizationKianJazayeri1
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
knowledge representation in artificial intelligence
knowledge representation in artificial intelligenceknowledge representation in artificial intelligence
knowledge representation in artificial intelligencePriyadharshiniG41
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxSimranPal17
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaManalVerma4
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelBoston Institute of Analytics
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectBoston Institute of Analytics
 
Rithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdfRithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdfrahulyadav957181
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfnikeshsingh56
 
World Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdf
World Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdfWorld Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdf
World Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdfsimulationsindia
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfNon Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfPratikPatil591646
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Boston Institute of Analytics
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...Jack Cole
 
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...boychatmate1
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfNicoChristianSunaryo
 

Dernier (20)

Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
Principles and Practices of Data Visualization
Principles and Practices of Data VisualizationPrinciples and Practices of Data Visualization
Principles and Practices of Data Visualization
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
knowledge representation in artificial intelligence
knowledge representation in artificial intelligenceknowledge representation in artificial intelligence
knowledge representation in artificial intelligence
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptx
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in India
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis Project
 
Rithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdfRithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdf
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdf
 
World Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdf
World Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdfWorld Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdf
World Economic Forum Metaverse Ecosystem By Utpal Chakraborty.pdf
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfNon Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdf
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
 
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdf
 

Make Sense Out of Data with Feature Engineering

  • 1. Make Sense Out of Data with Feature Engineering Xavier Conort Chief Data Scientist at DataRobot @Melbourne Data Science Initiative 2016
  • 3. Automation is integral part of human civilization
  • 4. Car Destination Crude oil Refined Oil process oil into more useful products such gasoline A successful journeyKey elements for a successful car journey
  • 5. Car = Modelling engine Machine Learning solutions replace more and more traditional statistical approach and can automate the modelling process and produce world- class predictive accuracy without much effort Destination = Outcome well defined outcome to predict and well defined process to use it to optimize business problems Crude Oil = Raw Data increased volume and capacity to handle terabytes of Data Refined oil = Feature Engineering talent to extract from raw data information that can be used by models open source programming social network of coders automated solutions Key elements for a successful data science journey
  • 6. Refined oil for Machine Learning: Flat File Data Format © DataRobot, Inc. All rights reserved. Confidential ● 1 record per prediction event ● 1 column for each predictive field / feature ● 1 column for the value to be predicted (training data only) 6 ID Feature 1 Feature 2 Feature 3 Feature 4 Feature 5 Target 1 0.73 Female 5.28 Thursday 37.52 Yes 2 0.20 Male 4.20 Tuesday 35.04 Yes 3 1.82 Male 14.71 Friday 7.02 Yes 4 -0.69 Female 11.82 Sunday -3.29 No 5 1.07 Male 16.55 Monday 12.59 Yes 6 -0.27 Male 10.87 Thursday -8.19 Yes 7 2.88 Male 5.24 Wednesday -21.67 No 8 1.35 Female 9.40 Tuesday 9.70 Yes 9 0.73 Female 1.04 Sunday 26.60 Yes 10 0.02 Female -9.79 Saturday -14.47 Yes 11 3.43 Male 11.59 Thursday 27.48 No 12 2.56 Female -13.25 Saturday 12.41 No
  • 7. Feature Engineering that we will cover today ● Variables you should not use ● Dealing with high dimensional features ● Using external data to add valuable information ● Dealing with transactional data © DataRobot, Inc. All rights reserved. Confidential 7
  • 8. 8 ● Hosted by Practice Fusion, a cloud-based electronic health record platform for doctors and patients ● Challenge: Given a de-identified data set of patient electronic health records, build a model to determine who has a diabetes diagnosis ● Data: ○ 17 tables containing 4 years history of medical records! Example 1:
  • 9. Think of variables you should not use © DataRobot, Inc. All rights reserved. Confidential Feature Engineering the YearOfBirth Value ● We expect that as a patient gets older their risk of diabetes will increase, yet their YearOfBirth value remains static ● We need a feature that changes as the patient gets older ● The true predictor of diabetes is more likely to be age than year of birth ● The data is extracted at the end of 2012 ● Age = 2012 - YearOfBirth 9
  • 10. Learn to deal with high dimensionality © DataRobot, Inc. All rights reserved. Confidential 10 ● Add characteristics of levels of categorical features to see how similar they are ● Use location for regional categories to see how close they are ● Group hierarchical categories together based on those hierarchies ● Text mine the descriptions ● Use the overall ordinal frequency ranking as a feature ● Top Kagglers likelihood / credibility features
  • 11. Case study: engineer state variable © DataRobot, Inc. All rights reserved. Confidential 11 ● So that the machine learning algorithms can know which states are near (and possibly similar to) each other ● Centroid for each of the 51 states http://dev.maxmind.com/geoip/legacy/codes/state_latlon/
  • 12. Case study: engineer diagnosis © DataRobot, Inc. All rights reserved. Confidential 12 ● Use the ICD9 code groupings https://en.wikipedia.org/wiki/List_of_ICD-9_codes ○ So that the machine learning algorithms can know which diagnoses are similar to each other ○ Count the observations in each group ● Use the ICD9 descriptions ○ Do text mining on the descriptions to find words or phrases within the descriptions
  • 13. Case Study: engineer drugs © DataRobot, Inc. All rights reserved. Confidential 13 ● Use drug databases http://www.fda.gov/drugs/informationondrugs/ucm142438.htm ● To enable the machine learning algorithm to know which drugs are similar: ○ Replace proprietary brand names with generic medication names ○ Text mine the list of pharmaceutical classes
  • 14. But What About Relational Databases? © DataRobot, Inc. All rights reserved. Confidential 14 Challenge: many records per patient ○ 9948 patients ○ 196,290 transcripts ○ 142,741 diagnostics ○ 66,487 medications ○ 3,030 lab results
  • 15. Deal with one to many relationships © DataRobot, Inc. All rights reserved. Confidential ● create predictive fields using summary statistics ○ e.g. averages of last 24 hours / week / month / year ○ e.g. variance or standard deviation ○ e.g. entropy ○ e.g. maximum or minimum values ○ e.g. counts ○ e.g. most frequent value ○ e.g. sequences of events 15 ID Feature 1 Feature 2 Feature 3 Feature 4 Feature 5 Target 1 0.73 Female 5.28 Thursday 37.52 Yes 2 0.20 Male 4.20 Tuesday 35.04 Yes 3 1.82 Male 14.71 Friday 7.02 Yes 4 -0.69 Female 11.82 Sunday -3.29 No 5 1.07 Male 16.55 Monday 12.59 Yes 6 -0.27 Male 10.87 Thursday -8.19 Yes 7 2.88 Male 5.24 Wednesday -21.67 No 8 1.35 Female 9.40 Tuesday 9.70 Yes 9 0.73 Female 1.04 Sunday 26.60 Yes 10 0.02 Female -9.79 Saturday -14.47 Yes 11 3.43 Male 11.59 Thursday 27.48 No 12 2.56 Female -13.25 Saturday 12.41 No
  • 16. Case Study: Relationship Between a Patient and Diagnosis © DataRobot, Inc. All rights reserved. Confidential ● One patient to many diagnoses ● Uniquely joined via PatientGuid 16
  • 17. Case Study: Build sequences string © DataRobot, Inc. All rights reserved. Confidential Feature Engineering the ICD9 Codes ● One patient can have from 1 to 75 diagnoses ● We need to compress this data to a single record per patient ● One way is to concatenate the sequence of diagnoses into a string and do text mining models that use ngrams on that string ● It often helps to remove consecutive duplicates ● Sometimes it is useful to know the first and last events, and the times of those events 17 Patient ID ICD9Code 12345 391 12345 401 12345 401 12345 454.1 12346 410.3 12346 463
  • 18. Case Study: Count and entropy © DataRobot, Inc. All rights reserved. Confidential Feature Engineering the ICD9 Codes ● One patient can have from 1 to 75 diagnoses ● We need to compress this data to a single record per patient ● Sometimes it is useful to know ○ The number of events ○ The most common event type ○ The level of variety of event types e.g. the entropy (as my colleague Owen Zhang did for the KKD Cup 2015) 18 Patient ID ICD9Code 12345 391 12345 401 12345 401 12345 454.1 12346 410.3 12346 463 -propn*ln(propn) = -0.25*ln(0.25) =0.347
  • 19. Case Study: Timing stats © DataRobot, Inc. All rights reserved. Confidential Feature Engineering the Timing of Diagnoses ● One patient can have from 1 to 75 diagnoses ● We need to compress this data to a single record per patient ● Sometimes it is useful to know information about the timing of events ○ The range of event times e.g. mean, median, maximum, minimum, quantiles ○ The amount of time between events e.g. mean, median, maximum, minimum, quantiles ○ The regularity of the timing of events e.g. variance 19
  • 20. Hosted by XuetangX, a Chinese MOOC learning platform initiated by Tsinghua University Challenge: predict whether a user will drop a course within next 10 days based on his or her prior activities. Data: enrollment_train (120K rows) / enrollment_test (80K rows): Columns: enrollment_id, username, course_id log_train / log_test Columns: enrollment_id, time, source, event, object object Columns: course_id, module_id, category, children, start truth_train Columns: enrollment_id, dropped_out Example 2:
  • 21. We applied same recipes to log data 5890 objects and generated a flat file with 100s of features!!!
  • 22. Techniques we used in … to describe course, enrollment and students from log data: counts time statistics (min, mean, max, diff) entropy sequences treated as text on which we ran SVD and logistic regression on 3grams 20 first components of SVD on user x object More can be found in http://www.slideshare.net/DataRobot/featurizing-log-data-before-xgboost
  • 23. Key takeaways Machine Learning (ML) can automatically generate world class predictive accuracy But feature engineering is still an art that requires a lot of creativity, business insight, curiosity and effort Be careful! Infinite number of features can be generated… Start with winning recipes (steal them from others and make up your own) and then iterate with new recipes, ideas, external data... Stop when you don’t get much additional accuracy