JSON example
- Python
- Scala
from featurestore import Client, JSONFile
# Initialise feature store client
client = Client("url")
client.auth.login()
# Set project specifics
project = client.projects.create("demo")
# Create the json source
json =
JSONFile("wasbs://data@featurestoretesting.blob.core.windows.net/weather.json", multiline=True)
json_schema = client.extract_schema_from_source(json)
# Register the feature set
my_feature_set = project.feature_sets.register(json_schema, "feature_set_name", primary_key=["key_name"])
# Ingest to cache
my_feature_set.ingest(json)
# Retrieve feature set
ref = my_feature_set.retrieve()
ref.download()
import ai.h2o.featurestore.Client
import ai.h2o.featurestore.core.sources.JSONFile
// Initialise feature store client
val client = Client("url")
client.auth.login()
// Set project specifics
val project = client.projects.create("demo")
// Create the json source
val json = JSONFile("wasbs://data@featurestoretesting.blob.core.windows.net/weather.json", multiline=true)
val jsonSchema = client.extractSchemaFromSource(json)
// Register the feature set
val myFeatureSet = project.featureSets.register(jsonSchema, "featureSetName", primaryKey=Seq("keyName"))
// Ingest to cache
myFeatureSet.ingest(json)
// 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