Skip to main content

Feature Store for the Daipe AI Platform

Project description

Feature Store bundle

This package is distributed under the "DataSentics SW packages Terms of Use." See license

Feature store bundle allows you to store features with metadata.

Installation

poetry add feature-store-bundle

Getting started

  1. Define entity and custom feature decorator
from featurestorebundle.entity.getter import get_entity
from featurestorebundle.feature.FeaturesStorage import FeaturesStorage
from featurestorebundle.notebook.decorator import feature_decorator_factory

entity = get_entity()
features_storage = FeaturesStorage(entity)

feature_decorator = feature_decorator_factory.create(entity, features_storage)
  1. Use the feature decorator to save features as you create them
import daipe as dp

from pyspark.sql import functions as f
from pyspark.sql import DataFrame

@dp.transformation(dp.read_table("silver.tbl_loans"), display=True)
@feature_decorator(
    ("Age", "Client's age"),
    ("Gender", "Client's gender"),
    ("WorkExperience", "Client's work experience"),
    category="personal",
)
def client_personal_features(df: DataFrame):
    return (
        df.select("UserName", "Age", "Gender", "WorkExperience")
        .groupBy("UserName")
        .agg(
            f.max("Age").alias("Age"),
            f.first("Gender").alias("Gender"),
            f.first("WorkExperience").alias("WorkExperience"),
        )
        .withColumn("timestamp", f.lit(today))
    )
  1. Write/Merge all features in one go
import daipe as dp
from featurestorebundle.feature.writer.FeaturesWriter import FeaturesWriter

@dp.notebook_function()
def write_features(writer: FeaturesWriter):
    writer.write(features_storage)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

feature_store_bundle-2.0.0b10-py3-none-any.whl (68.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page