Artifacts API
User has a possibility to associate with each feature set an artifact. Artifact can be either a file or a URL link.
Listing existing feature set artifacts
The list()
returns currently available artifacts.
- Python
- Scala
artifacts = feature_set.artifacts.list()
artifact = next(artifacts)
val artifacts = featureSet.artifacts.list()
val artifact = artifacts.next
The list()
method returns an iterator.
Artifact metadata
Each artifact contains some metadata that are accessible to the user
- Python
- Scala
Field Name | Meaning |
---|---|
id | internal id used by feature store |
title | title given when creating an artefact (automatically generated if not provided) |
description | description given when creating an artefact (automatically generated if not provided) |
artifact_type | specifies whether is artifact is a Link or File type |
filename | name of the provided file (only available for file artifacts) |
upload_status | status of the upload operation (only available for file artifacts) |
url | url provided when link artifact was created (only available for link artifacts) |
Field Name | Meaning |
---|---|
id | internal id used by feature store |
title | title given when creating an artefact (automatically generated if not provided) |
description | description given when creating an artefact (automatically generated if not provided) |
artifactType | specifies whether is artifact is a Link or File type |
filename | name of the provided file (only available for file artifacts) |
uploadStatus | status of the upload operation (only available for file artifacts) |
url | url provided when link artifact was created (only available for link artifacts) |
Retrieving file artifact
To download a file artifact use retrieve(path, overwrite_existing_file)
method.
The path argument has to point to a valid directory and can contain file name.
If the file name is not part of the path, then file name of the originally uploaded file is used instead.
The overwrite_existing_file argument specifies whether an already existing file can be overwritten.
By default, overwriting is not enabled and if a file already exists then the method ends with an exception.
- Python
- Scala
# assuming /home/alice/feature_set_artifacts folder exists
# save with original file name
artifact.retrive("/home/alice/feature_set_artifacts/")
# save with new file name
artifact.retrive("/home/alice/feature_set_artifacts/samples.txt")
# save with new file name, overwrite exisitng file
artifact.retrive("/home/alice/feature_set_artifacts/samples.txt", overwrite_existing_file="y")
// assuming /home/alice/feature_set_artifacts folder exists
// save with original file name
artifact.retrive("/home/alice/feature_set_artifacts/")
// save with new file name
artifact.retrive("/home/alice/feature_set_artifacts/samples.txt")
// save with new file name, overwrite exisitng file
artifact.retrive("/home/alice/feature_set_artifacts/samples.txt", overwriteExistingFile="y")
Saving file artifact
To upload a file artifact use store_file(path, title, description)
method.
The path argument has to point to a valid file which is going to be uploaded.
If the title or description argument is not provided, then it will be automatically generated.
- Python
- Scala
file_artifact = feature_set.artifacts.store_file(file_path="/home/bob/feature_set_artifacts/to_upload.txt", title="Remarks")
val fileArtifact = featureSet.artifacts.storeFile(file_path="/home/bob/feature_set_artifacts/to_upload.txt", title="Remarks")
Saving link artifact
To upload a file artifact use store_file(path, title, description)
method.
The path argument has to point to a valid file which is going to be uploaded.
If the title or description argument is not provided, then it will be automatically generated.
- Python
- Scala
link_artifact = feature_set.artifacts.store_link(url="/home/bob/feature_set_artifacts/to_upload.txt", title="Remarks")
val linkArtifact = featureSet.artifacts.storeLink(url="/home/bob/feature_set_artifacts/to_upload.txt", title="Remarks")
Deleting artefact
To save feature store resources, when an artifact is no more needed it can be removed
by calling a delete()
method on an artifact object.
- Python
- Scala
artifact.delete()
artifact.delete()
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai