SlideShare a Scribd company logo
Transforming Feature Ideas
into Machine Learning Inputs
Xavier Conort
9th May 2023 - Singapore
Transforming Feature Ideas into actionable ML inputs
2
FeatureByte is a free and source-available platform designed to
empower data enthusiasts who love creating innovative features and
improving model accuracy through data.
With FeatureByte, you can:
● Quickly create features,
● Seamlessly experiment with features and
● Effortlessly deploy features
All without the headache of creating and managing new pipelines.
Free and source available platform released on May 8!
3
You can access our repository at https://github.com/featurebyte/featurebyte and our documentation at
https://docs.featurebyte.com/0.2/. Please check it out and give us your feedback! We're eager to hear your thoughts and
improve FeatureByte to better suit your needs.
Agenda
4
● Quick introduction to FeatureByte Architecture
● Introduction to the Grocery dataset
● Transform 9 Features Ideas
● Get training data and deploy our new features in production!
FeatureByte
Architecture
6
Your DataBricks, Snowflake or Spark data warehouse is used as:
● data source
● compute engine
● feature store
The FeatureByte Service, which runs on Docker, acts
as the interface between the SDK and your data
warehouse.
It automatically manages tasks like validating
requests, scheduling and executing tasks, and storing
metadata.
This Python module transpiles the feature logical plan
to platform-specific SQL
Light-weight installation that leverages your Data Warehouse
You interact with the tool through the SDK, which
provides an intuitive framework for creating, sharing,
experimenting, deploying, and managing features.
Grocery dataset
Note: To access the Grocery dataset or play with FeatureByte's tutorials - you can install a pre-built local Spark data warehouse with pre-populated data, via
the command featurebyte.playground().
8
We will work with a Catalog where 4 tables were registered from a grocery dataset.
Dimension table with
static description on
products
Item table with details on
purchased products in
customer invoices
Event table where each
row indicates an invoice
Slowly Changing Dimension table that contains data
on customers that change over time.
A catalog is an object that help organize your
feature engineering assets by domain
Simple observation set to preview features
9
Observation sets are used to materialize historical
feature values. They combine entity values and
historical points-in-time that you want to learn from.
We will work here with a small Pandas DataFrame to
preview features when customers are doing a purchase.
The observation set is retrieved from a sample of the
GROCERYINVOICE table’s view.
The column containing points-in-time must be named
‘POINT-IN-TIME’
The column containing entity values must be named
with an accepted serving name as defined during the
entity registration.
View objects are used to prepare data. Work like SQL
views but with a syntax similar to Pandas!
9 Feature ideas for the
Grocery dataset
9 feature ideas for the Customer entity
1. Frequency: the count of invoices by Customer in the past 12 weeks
2. Monetary: the amount spent by Customer in the past 12 weeks
3. Recency: the time since the Customer’s last invoice
4. Basket: the sum spent by Customer per Product Group in the past 12 weeks
5. Diversity: the entropy of the Customer’s basket per Product Group in the past 12 weeks
6. Stability: the cosine similarity of the Customer’s basket in the past 2 weeks compared to their
basket in the past 12 weeks
7. Similarity: the cosine similarity of the Customer’s basket compared to the baskets of Customers
living in the same state in the past 12 weeks
8. Regularity: the entropy of weekdays of the customer invoices in the past 12 weeks
9. Change: whether the Customer’s Address changed in the past 12 weeks
11
Feature Idea 1: Frequency
Count of invoices by Customer in the past 12 weeks
12
The groupby() method enables to group a view by
columns representing entities.
The aggregate_over() method enables aggregation
operation over a window prior to the observation point,
here 12 weeks.
Feature objects contain the logical plan to compute a feature
Feature Idea 2: Monetary
Amount spent by Customer in the past 12 weeks
13
Aggregation operations include latest, count, sum,
average, minimum, maximum, and standard deviation.
Feature Idea 3: Recency
Time since Customer last invoice
14
RequestColumn.point_in_time() enables the creation of
features that compare the value of an other feature with
the observation point
Another example of using this method would be to
derive a customer's age from their birth date and the
observation point.
Feature Idea 4: Basket
Sum spent by Customer per Product Group in the past 2 and 12 weeks
15
Aggregation can be done across a categorical column,
here ProductGroup.
When the feature is materialized, a dictionary is
returned.
In our example, the keys represent the ProductGroup,
and their corresponding values represent the total
amount spent on each Product Group.
Feature Idea 5: Diversity
Entropy of the Customer’s basket in the past 12 weeks
16
A dictionary feature can be transformed into another
feature. We apply here the entropy.
Feature Idea 6: Stability
Cosine Similarity of the Customer’s basket in the past 2 weeks vs their
basket in the past 12 weeks
17
2 dictionary features with different
windows can be compared using the cosine
similarity.
Feature Idea 7: Similarity
Cosine Similarity of the Customer’s basket in the past 12 weeks
vs the baskets of Customers living in the same state
18
When 2 dictionary features are grouped with 2 different
entities,
● they can be still compared using the cosine similarity.
● the entity of the resulting feature is determined based
on the relationship between the 2 entities.
In our example, the primary entity of
“Customer_Similarity_with_State_12w” is
grocerycustomer because grocerycustomer
is a child of the frenchstate entity.
The feature can be served by providing only
the grocerycustomer entity values. Values
for frenchstate entity are derived
automatically by FeatureByte.
Feature Idea 8: Regularity
Entropy of weekdays of the Customer’s invoices in the past 12 weeks
19
In this example, the keys of the dictionary will represent
the weekday, and their corresponding values will
represent the total amount spent on each weekday.
The weekdays dictionary feature is here transformed
into another feature by applying the entropy.
Feature Idea 9: Change
Whether Customer’s Address Changed in the past 12 weeks
20
Change View can be created from a Slowly Changing Dimension
(SCD) table to analyze changes that occur in an attribute, here the
StreetAddress of the grocerycustomer.
Get training data and
deploy our 9 features in
production!
Audit one feature via its Definition file
22
The feature definition file is critical for maintaining the integrity
of a feature. It serves as the single source of truth for the feature,
providing an explicit outline of the intended operations of the
feature declaration, including inherited operations.
The file is automatically generated when a feature is declared or a
new version is derived. It is used to generate the final logical
execution graph, which is then transpiled into platform-specific
SQL for feature materialization.
Create feature list
23
Compute training data
24
You can choose to store your training data in the feature store for
reuse or audit.
If you connect FeatureByte to your data warehouse, the
computation of features is performed in the data warehouse,
taking advantage of its scalability, stability, and efficiency.
In this case, you can work with much larger observation tables with
millions of rows.
Deploy and get shell template for REST API
25
Thank You!
To get started, check out
Repo: https://github.com/featurebyte/featurebyte
Documentation: https://docs.featurebyte.com/0.2/
27
Catalog objects help organize
assets by domain
View objects are used to prepare data. Work like SQL
views but with a syntax similar to Pandas!
Table objects centralize essential
metadata for feature engineering.
4 types: event table, item table,
SCD table and dimension table.
Entity objects and relationships facilitate
feature organization and serving Feature objects contain the logical plan to compute a feature
Python SDK to register, share and manage tables, features and
more…

More Related Content

PDF
Simplify Feature Engineering in Your Data Warehouse
PDF
Maximizing Your ML Success with Innovative Feature Engineering
PDF
Accelerating Data Science through Feature Platform, Transformers and GenAI
PDF
Accelerating Data Science through Feature Platform, Transformers, and GenAI
PDF
Feature Ideation
PDF
Deep Feature Synthesis
PDF
Do you have too many meaningless features? — Featurebyte @ ODSC East 2023
PPTX
Outlier and fraud detection using Hadoop
Simplify Feature Engineering in Your Data Warehouse
Maximizing Your ML Success with Innovative Feature Engineering
Accelerating Data Science through Feature Platform, Transformers and GenAI
Accelerating Data Science through Feature Platform, Transformers, and GenAI
Feature Ideation
Deep Feature Synthesis
Do you have too many meaningless features? — Featurebyte @ ODSC East 2023
Outlier and fraud detection using Hadoop

Similar to Transforming Feature Ideas into Machine Learning Inputs (20)

PDF
Z suzanne van_den_bosch
PPTX
Lecture-1-Introduction to Deep learning.pptx
PDF
A Practical Enterprise Feature Store on Delta Lake
PDF
Streamlining Data Science Workflows with a Feature Catalog
PPTX
Xomia_20220602.pptx
PDF
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
PDF
Feature Engineering.pdf
PDF
KnowledgeFromDataAtScaleProject
PDF
Ch 1 intro_dw
PPT
Datamining
KEY
Anchor Modeling GSE11 Presentation
PDF
Streamlining Feature Engineering Pipelines with Open Source
PDF
Introduction of Feature Hashing
PDF
Value extraction from BBVA credit card transactions. IVAN DE PRADO at Big Dat...
PDF
Accelerating ML using Production Feature Engineering
PPTX
Requirements for Processing Datasets for Recommender Systems
PDF
Using Graphs for Feature Engineering_ Graph Reduce-2.pdf
PPTX
C11BD 22-23 data ana-Exploration II.pptx
PPT
Dimensional Modeling For engineering drawings.ppt
Z suzanne van_den_bosch
Lecture-1-Introduction to Deep learning.pptx
A Practical Enterprise Feature Store on Delta Lake
Streamlining Data Science Workflows with a Feature Catalog
Xomia_20220602.pptx
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
Feature Engineering.pdf
KnowledgeFromDataAtScaleProject
Ch 1 intro_dw
Datamining
Anchor Modeling GSE11 Presentation
Streamlining Feature Engineering Pipelines with Open Source
Introduction of Feature Hashing
Value extraction from BBVA credit card transactions. IVAN DE PRADO at Big Dat...
Accelerating ML using Production Feature Engineering
Requirements for Processing Datasets for Recommender Systems
Using Graphs for Feature Engineering_ Graph Reduce-2.pdf
C11BD 22-23 data ana-Exploration II.pptx
Dimensional Modeling For engineering drawings.ppt
Ad

Recently uploaded (20)

PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
Foundation of Data Science unit number two notes
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Computer network topology notes for revision
PPTX
Introduction to machine learning and Linear Models
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
Fluorescence-microscope_Botany_detailed content
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPT
Reliability_Chapter_ presentation 1221.5784
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Qualitative Qantitative and Mixed Methods.pptx
Foundation of Data Science unit number two notes
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Miokarditis (Inflamasi pada Otot Jantung)
Introduction-to-Cloud-ComputingFinal.pptx
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Computer network topology notes for revision
Introduction to machine learning and Linear Models
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Fluorescence-microscope_Botany_detailed content
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Data_Analytics_and_PowerBI_Presentation.pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Reliability_Chapter_ presentation 1221.5784
Ad

Transforming Feature Ideas into Machine Learning Inputs

  • 1. Transforming Feature Ideas into Machine Learning Inputs Xavier Conort 9th May 2023 - Singapore
  • 2. Transforming Feature Ideas into actionable ML inputs 2 FeatureByte is a free and source-available platform designed to empower data enthusiasts who love creating innovative features and improving model accuracy through data. With FeatureByte, you can: ● Quickly create features, ● Seamlessly experiment with features and ● Effortlessly deploy features All without the headache of creating and managing new pipelines.
  • 3. Free and source available platform released on May 8! 3 You can access our repository at https://github.com/featurebyte/featurebyte and our documentation at https://docs.featurebyte.com/0.2/. Please check it out and give us your feedback! We're eager to hear your thoughts and improve FeatureByte to better suit your needs.
  • 4. Agenda 4 ● Quick introduction to FeatureByte Architecture ● Introduction to the Grocery dataset ● Transform 9 Features Ideas ● Get training data and deploy our new features in production!
  • 6. 6 Your DataBricks, Snowflake or Spark data warehouse is used as: ● data source ● compute engine ● feature store The FeatureByte Service, which runs on Docker, acts as the interface between the SDK and your data warehouse. It automatically manages tasks like validating requests, scheduling and executing tasks, and storing metadata. This Python module transpiles the feature logical plan to platform-specific SQL Light-weight installation that leverages your Data Warehouse You interact with the tool through the SDK, which provides an intuitive framework for creating, sharing, experimenting, deploying, and managing features.
  • 7. Grocery dataset Note: To access the Grocery dataset or play with FeatureByte's tutorials - you can install a pre-built local Spark data warehouse with pre-populated data, via the command featurebyte.playground().
  • 8. 8 We will work with a Catalog where 4 tables were registered from a grocery dataset. Dimension table with static description on products Item table with details on purchased products in customer invoices Event table where each row indicates an invoice Slowly Changing Dimension table that contains data on customers that change over time. A catalog is an object that help organize your feature engineering assets by domain
  • 9. Simple observation set to preview features 9 Observation sets are used to materialize historical feature values. They combine entity values and historical points-in-time that you want to learn from. We will work here with a small Pandas DataFrame to preview features when customers are doing a purchase. The observation set is retrieved from a sample of the GROCERYINVOICE table’s view. The column containing points-in-time must be named ‘POINT-IN-TIME’ The column containing entity values must be named with an accepted serving name as defined during the entity registration. View objects are used to prepare data. Work like SQL views but with a syntax similar to Pandas!
  • 10. 9 Feature ideas for the Grocery dataset
  • 11. 9 feature ideas for the Customer entity 1. Frequency: the count of invoices by Customer in the past 12 weeks 2. Monetary: the amount spent by Customer in the past 12 weeks 3. Recency: the time since the Customer’s last invoice 4. Basket: the sum spent by Customer per Product Group in the past 12 weeks 5. Diversity: the entropy of the Customer’s basket per Product Group in the past 12 weeks 6. Stability: the cosine similarity of the Customer’s basket in the past 2 weeks compared to their basket in the past 12 weeks 7. Similarity: the cosine similarity of the Customer’s basket compared to the baskets of Customers living in the same state in the past 12 weeks 8. Regularity: the entropy of weekdays of the customer invoices in the past 12 weeks 9. Change: whether the Customer’s Address changed in the past 12 weeks 11
  • 12. Feature Idea 1: Frequency Count of invoices by Customer in the past 12 weeks 12 The groupby() method enables to group a view by columns representing entities. The aggregate_over() method enables aggregation operation over a window prior to the observation point, here 12 weeks. Feature objects contain the logical plan to compute a feature
  • 13. Feature Idea 2: Monetary Amount spent by Customer in the past 12 weeks 13 Aggregation operations include latest, count, sum, average, minimum, maximum, and standard deviation.
  • 14. Feature Idea 3: Recency Time since Customer last invoice 14 RequestColumn.point_in_time() enables the creation of features that compare the value of an other feature with the observation point Another example of using this method would be to derive a customer's age from their birth date and the observation point.
  • 15. Feature Idea 4: Basket Sum spent by Customer per Product Group in the past 2 and 12 weeks 15 Aggregation can be done across a categorical column, here ProductGroup. When the feature is materialized, a dictionary is returned. In our example, the keys represent the ProductGroup, and their corresponding values represent the total amount spent on each Product Group.
  • 16. Feature Idea 5: Diversity Entropy of the Customer’s basket in the past 12 weeks 16 A dictionary feature can be transformed into another feature. We apply here the entropy.
  • 17. Feature Idea 6: Stability Cosine Similarity of the Customer’s basket in the past 2 weeks vs their basket in the past 12 weeks 17 2 dictionary features with different windows can be compared using the cosine similarity.
  • 18. Feature Idea 7: Similarity Cosine Similarity of the Customer’s basket in the past 12 weeks vs the baskets of Customers living in the same state 18 When 2 dictionary features are grouped with 2 different entities, ● they can be still compared using the cosine similarity. ● the entity of the resulting feature is determined based on the relationship between the 2 entities. In our example, the primary entity of “Customer_Similarity_with_State_12w” is grocerycustomer because grocerycustomer is a child of the frenchstate entity. The feature can be served by providing only the grocerycustomer entity values. Values for frenchstate entity are derived automatically by FeatureByte.
  • 19. Feature Idea 8: Regularity Entropy of weekdays of the Customer’s invoices in the past 12 weeks 19 In this example, the keys of the dictionary will represent the weekday, and their corresponding values will represent the total amount spent on each weekday. The weekdays dictionary feature is here transformed into another feature by applying the entropy.
  • 20. Feature Idea 9: Change Whether Customer’s Address Changed in the past 12 weeks 20 Change View can be created from a Slowly Changing Dimension (SCD) table to analyze changes that occur in an attribute, here the StreetAddress of the grocerycustomer.
  • 21. Get training data and deploy our 9 features in production!
  • 22. Audit one feature via its Definition file 22 The feature definition file is critical for maintaining the integrity of a feature. It serves as the single source of truth for the feature, providing an explicit outline of the intended operations of the feature declaration, including inherited operations. The file is automatically generated when a feature is declared or a new version is derived. It is used to generate the final logical execution graph, which is then transpiled into platform-specific SQL for feature materialization.
  • 24. Compute training data 24 You can choose to store your training data in the feature store for reuse or audit. If you connect FeatureByte to your data warehouse, the computation of features is performed in the data warehouse, taking advantage of its scalability, stability, and efficiency. In this case, you can work with much larger observation tables with millions of rows.
  • 25. Deploy and get shell template for REST API 25
  • 26. Thank You! To get started, check out Repo: https://github.com/featurebyte/featurebyte Documentation: https://docs.featurebyte.com/0.2/
  • 27. 27 Catalog objects help organize assets by domain View objects are used to prepare data. Work like SQL views but with a syntax similar to Pandas! Table objects centralize essential metadata for feature engineering. 4 types: event table, item table, SCD table and dimension table. Entity objects and relationships facilitate feature organization and serving Feature objects contain the logical plan to compute a feature Python SDK to register, share and manage tables, features and more…