PyCon_Ireland_2022 = {

   "Getting Started":

       "Feature Stores"

}

Ramon Perez

13 November 2022

Prepared for PyCon Ireland 🇮🇪 2022

# CHAPTER 0

Introduction

Currently 🤓🤓

  • Data Science Consultant
  • Instructor @ Decoded

Agenda

WHAT?

...is a feature store and what will it enable at my organization, team, client, etc.?

1.

2.

WHY?

...do feature stores matter? Why were they created in the first place? Why should I care?

3.

HOW?

...do we get started with feature stores, and hat options do we have? Build or Buy?

# CHAPTER 0

4.

DEMO 😎

If the demo gods allow it, we will see how to get started building a feature store.

# CHAPTER 2

What?

We offer a variety of services and plans tailored to business needs of any kind and of any size.

Why?

1.You need to ingest features that are unknown to the client.
2. Data scientists, machine learning engineers, and others, are duplicating features to train different models.
3.You are using hard-to-compute and frequently updated features to constantly train new models.
# CHAPTER 2

1. Model ingests features unknown to the client.

# CHAPTER 1

Why?

Imagine having a centralized mall of data where DB Tables = Stores...

Table 1

Table 2

Table 4

Table 3

Table 5

Table 6

Table 7

Model 1

Recommendation System

User

User

User

User

User

User

User

User

Model 1

Table 1

Table 2

...

Table 3

Simplicity = {

 

"The Why again but with Code"

 

}

// This slide uses Auto-Animate to animate between
// two different code blocks
const distanceBetween = ( p1, p2 ) => {
 // TODO
}

distanceBetween([10,10], [50,50])
# PRESENTING CODE

Get Historical Features and Train

How = "?"

feast init -m feature_store
# PRESENTING CODE

Starting a Project

feast init -m feature_store

# output
Creating a new Feast repository in pycon_ireland22/home_credit
# PRESENTING CODE
cd feature_store/feature_repo/
touch feature_definitions.py
vim feature_repo

# output
project: home_credit
registry: /path/to/registry.db
provider: local
online_store:
    path: /path/to/online_store.db
entity_key_serialization_version: 2
# PRESENTING CODE

Adjusting the Configurations

vim feature_repo

# output
project: home_credit
registry: data/registry.db
provider: local
online_store:
    path: data/online_store.db
entity_key_serialization_version: 2
vim feature_definitions.py
# PRESENTING CODE

Defining Entities and Sources

from datetime import timedelta
import pandas as pd
from feast import Entity, FeatureView, Field, FileSource, ValueType
from feast.types import Float32, Int64
from pathlib import Path

data_path = Path().cwd().parents[1]/"data"

usr_id = Entity(
  name="user_id", join_keys=["SK_ID_CURR"],
  value_type=ValueType.INT64, description="Eeach Customer's ID"
)

where_cc_data_is = FileSource(
  path=str(data_path/"processed/cc_df.parquet"), 
  event_timestamp_column="event_timestamp", name="target_df"
)
# PRESENTING CODE

Defining Feature Views

# ...continued
cc_fv = FeatureView(
    name="credi_card",
    entities=[user_id],
    ttl=timedelta(days=365),
    schema=[
        Field(name="NAME_CONTRACT_TYPE", dtype=Int64),
        Field(name="FLAG_OWN_CAR", dtype=Int64),
        Field(name="FLAG_OWN_REALTY", dtype=Int64),
        Field(name="AMT_INCOME_TOTAL", dtype=Int64),
        Field(name="AMT_CREDIT", dtype=Int64),
      ...
    ],
    source=cc_source
)
# CHAPTER 2

Resources

We offer a variety of services and plans tailored to business needs of any kind and of any size.

ACME Offices

Blog Posts Tutorials Websites
USA Los Angeles +1 555 0194
USA New York +1 555 0142
Sweden Stockholm +46 555 0077
UK London +44 555 0211
South Korea Seoul +82 555 0138

Blog Posts

1. What is a Feature Store?

2. Feature Platform vs Feature Stores

3. Do You Really Need a Feature Store?

4. Feature Stores Explained: Three Common Architectures

5. Feature Stores Explained: Three Common Architectures

6. Feature Stores Explained: Three Common Architectures

7. Feature Stores Explained: Three Common Architectures

8. Feature Stores Explained: Three Common Architectures

Tutorials

1. Crating a Feature Store with Feast P1, P2, P3

Build

Price $Free.99?

You own it

Customised to your needs

Time Consuming

Little-to-no references

Buy - Integrate

Price $199 /mo

Faster roll up (potentially)

Support

Save on headcount

Very new

NEW

Buy - End-to-End

Solutions

Price $599 /mo

Up to five projects

Five designs/project

3-day turnaround

24/7 support

Choose From

Copy of Code

By ramongz

Copy of Code

  • 43