Using SingleStore as a Machine Learning Feature Store

Abstract

Introduction

Figure 1. Feast.

Create the Database

CREATE DATABASE IF NOT EXISTS feast;

Install and Configure Feast

pip install feast
git clone https://github.com/feast-dev/feast-custom-online-store-demo
cd feast-custom-online-store-demo
pip install -r requirements.txt
pip install PyMySQL
cd feast_custom_online_store

Modify the Example Application

  • Replace import mysql.connector with import pymysql
  • Replace mysql.connector.connect with pymysql.connect
  • Replace all conn.cursor(buffered=True) with conn.cursor()
host=online_store_config.host or "127.0.0.1",
user=online_store_config.user or "root",
password=online_store_config.password,
database=online_store_config.database or "feast",
host=online_store_config.host or "<TO DO>",
user=online_store_config.user or "admin",
password=online_store_config.password or "<TO DO>",
database=online_store_config.database or "feast",

Run the Code

PYTHONPATH=$PYTHONPATH:/$(pwd) feast -c feature_repo apply
Registered entity driver_id
Registered feature view driver_hourly_stats
Deploying infrastructure for driver_hourly_stats
PYTHONPATH=$PYTHONPATH:/$(pwd) feast -c feature_repo materialize-incremental 2021-08-19T22:29:28
Materializing 1 feature views to 2021-08-19 23:29:28+01:00 into the feast_custom_online_store.mysql.MySQLOnlineStore online store.driver_hourly_stats from 2020-09-28 19:54:28+01:00 to 2021-08-19 23:29:28+01:00:
0%| | 20%|█████████████ | 1/5 [00: 40%|██████████████████████████ | 2/5 [00: 60%|███████████████████████████████████████ | 3/5 [00: 80%|████████████████████████████████████████████████████ | 4/5 [00:100%|█████████████████████████████████████████████████████
| 5/5 [00:100%|█████████████████████████████████████████████████████
| 5/5 [00:07<00:00, 1.50s/it]

Summary

--

--

--

I help build global developer communities and raise awareness of technology through presentations and technical writing.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Better Programming’s Weekly Top 10 (September 5–18, 2020)

With transparency to zero-defect production and added value for the customer

Strategic Partnership Announcement: NFTGO.io and Dataverse

Models in MongoDB

Thoughts on Internal Complexity

Kadane’s Algorithm

TDD vs ATDD vs BDD

Why are we still renting domains?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akmal Chaudhri

Akmal Chaudhri

I help build global developer communities and raise awareness of technology through presentations and technical writing.

More from Medium

Deploying and scheduling data applications with Magniv

A well-known e-commerce platform: Building a top data platform with StarRocks

Why Timeplus?

Replace Apache Spark with Wallaroo for Lower Infrastructure Costs & Faster Deployments