CSV example
- Python
- Scala
from featurestore import Client, CSVFile
# Initialise feature store client
client = Client("url")
client.auth.login()
# Set project specifics
project = client.projects.create("demo")
# Create the csv source
csv = CSVFile("s3a://h2o-datasets/taxi_small.csv")
csv_schema = client.extract_schema_from_source(csv)
# Register the feature set
my_feature_set = project.feature_sets.register(csv_schema, "feature_set_name", primary_key=["key_name"])
# Ingest to cache
my_feature_set.ingest(csv)
# Retrieve feature set
ref = my_feature_set.retrieve()
ref.download()
import ai.h2o.featurestore.Client
import ai.h2o.featurestore.core.sources.CSVFile
// Initialise feature store client
val client = Client("url")
client.auth.login()
// Set project specifics
val project = client.projects.create("demo")
// Create the csv source
val csv = CSVFile("s3a://h2o-datasets/taxi_small.csv")
val csvSchema = client.extractSchemaFromSource(csv)
// Register the feature set
val myFeatureSet = project.featureSets.register(csvSchema, "featureSetName", primaryKey=Seq("keyName"))
// Ingest to cache
myFeatureSet.ingest(csv)
// Retrieve feature set
val ref = myFeatureSet.retrieve()
ref.download()
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai