public abstract class FeatureViewBase<T extends FeatureViewBase,T3 extends FeatureStoreBase<T4>,T4 extends QueryBase,T5> extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
description |
protected Integer |
extraFilterVersion |
protected List<TrainingDatasetFeature> |
features |
protected T3 |
featureStore |
protected Integer |
id |
protected List<String> |
labels |
protected static org.slf4j.Logger |
LOGGER |
protected String |
name |
protected T4 |
query |
protected String |
type |
protected VectorServer |
vectorServer |
protected Integer |
version |
Constructor and Description |
---|
FeatureViewBase() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addTag(String name,
Object value)
Add name/value tag to the feature view.
|
abstract void |
addTrainingDatasetTag(Integer version,
String name,
Object value)
Add name/value tag to the training dataset.
|
abstract void |
clean(T3 featureStore,
String featureViewName,
Integer featureViewVersion) |
abstract void |
delete() |
abstract void |
deleteAllTrainingDatasets() |
abstract void |
deleteTag(String name)
Delete a tag of the feature view.
|
abstract void |
deleteTrainingDataset(Integer version) |
abstract void |
deleteTrainingDatasetTag(Integer version,
String name)
Delete a tag of the training dataset.
|
abstract T5 |
getBatchData() |
abstract T5 |
getBatchData(String startTime,
String endTime) |
abstract T5 |
getBatchData(String startTime,
String endTime,
Map<String,String> readOptions) |
abstract String |
getBatchQuery() |
abstract String |
getBatchQuery(String startTime,
String endTime) |
List<Object> |
getFeatureVector(Map<String,Object> entry)
Returns assembled feature vector from online feature store.
|
List<Object> |
getFeatureVector(Map<String,Object> entry,
boolean external)
Returns assembled feature vector from online feature store.
|
List<List<Object>> |
getFeatureVectors(Map<String,List<Object>> entry)
Returns assembled feature vectors in batches from online feature store.
|
List<List<Object>> |
getFeatureVectors(Map<String,List<Object>> entry,
boolean external)
Returns assembled feature vectors in batches from online feature store.
|
HashSet<String> |
getPrimaryKeys()
Set of primary key names that is used as keys in input dict object for `get_serving_vector` method.
|
abstract Object |
getTag(String name)
Get a single tag value of the feature view.
|
abstract Map<String,Object> |
getTags()
Get all tags of the feature view.
|
abstract Object |
getTrainingData(Integer version,
Map<String,String> readOptions) |
abstract Object |
getTrainingDatasetTag(Integer version,
String name)
Get a single tag value of the training dataset.
|
abstract Map<String,Object> |
getTrainingDatasetTags(Integer version)
Get all tags of the training dataset.
|
abstract Object |
getTrainTestSplit(Integer version,
Map<String,String> readOptions) |
abstract Object |
getTrainValidationTestSplit(Integer version,
Map<String,String> readOptions) |
void |
initBatchScoring(Integer trainingDatasetVersion)
Initialise feature view to retrieve feature vector from offline feature store.
|
void |
initServing()
Initialise feature view to retrieve feature vector from online feature store.
|
void |
initServing(Boolean batch,
Boolean external)
Deprecated.
|
abstract void |
purgeAllTrainingData() |
abstract void |
purgeTrainingData(Integer version) |
abstract T |
update(T other) |
protected void |
validateTrainTestSplit(Float testSize,
String trainEnd,
String testStart) |
protected void |
validateTrainValidationTestSplit(Float validationSize,
Float testSize,
String trainEnd,
String validationStart,
String validationEnd,
String testStart) |
protected T3 extends FeatureStoreBase<T4> featureStore
protected Integer id
protected String name
protected Integer version
protected String description
protected List<TrainingDatasetFeature> features
protected String type
protected static final org.slf4j.Logger LOGGER
protected VectorServer vectorServer
protected Integer extraFilterVersion
public void initServing() throws FeatureStoreException, IOException, SQLException, ClassNotFoundException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// Initialise feature view serving
fv.initServing();
FeatureStoreException
- In case client is not connected to Hopsworks.IOException
- Generic IO exception.SQLException
- In case there is online storage (RonDB) access error or other errors.ClassNotFoundException
- In case class `com.mysql.jdbc.Driver` can not be found.@Deprecated public void initServing(Boolean batch, Boolean external) throws FeatureStoreException, IOException, SQLException, ClassNotFoundException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// Initialise feature view batch serving
fv.initServing(true, false);
batch
- Whether to initialise feature view to retrieve feature vector from offline feature store.external
- If set to `true`, the connection to the online feature store is established using the same host as
for the `host` parameter in the connection object.
If set to False, the online feature store storage connector is used which relies on the private IP.FeatureStoreException
- In case client is not connected to Hopsworks.IOException
- Generic IO exception.SQLException
- In case there is online storage (RonDB) access error or other errors.ClassNotFoundException
- In case class `com.mysql.jdbc.Driver` can not be found.protected void validateTrainTestSplit(Float testSize, String trainEnd, String testStart) throws FeatureStoreException
FeatureStoreException
protected void validateTrainValidationTestSplit(Float validationSize, Float testSize, String trainEnd, String validationStart, String validationEnd, String testStart) throws FeatureStoreException
FeatureStoreException
public void initBatchScoring(Integer trainingDatasetVersion)
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// Initialise feature view batch scoring
fv.initBatchScoring(1);
trainingDatasetVersion
- Version of training dataset to identify additional filters attached to the training
dataset and statistics to use for transformation functions.public List<Object> getFeatureVector(Map<String,Object> entry) throws SQLException, FeatureStoreException, IOException, ClassNotFoundException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// define primary key values to fetch data from online feature store
Map<String, Object> pkMap = new HashMap<String, Object>() {
{put("customer_id", 1);
put("contract_id" , 100);
}
};
// get feature vector
fv.getFeatureVector(entry);
entry
- Fictionary of feature group primary key and values provided by serving application.FeatureStoreException
- In case client is not connected to Hopsworks.IOException
- Generic IO exception.SQLException
- In case there is online storage (RonDB) access error or other errors.ClassNotFoundException
- In case class `com.mysql.jdbc.Driver` can not be found.public List<Object> getFeatureVector(Map<String,Object> entry, boolean external) throws SQLException, FeatureStoreException, IOException, ClassNotFoundException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// define primary key values to fetch data from online feature store
Map<String, Object> pkMap = new HashMap<String, Object>() {
{put("customer_id", 1);
put("contract_id" , 100);
}
};
// get feature vector
fv.getFeatureVector(entry, false);
entry
- Dictionary of feature group primary key and values provided by serving application.external
- If set to true, the connection to the online feature store is established using the same host as
for the `host` parameter in the connection object.
If set to false, the online feature store storage connector is used which relies on the private IP.
Defaults to True if connection to Hopsworks is established from external environmentFeatureStoreException
- In case client is not connected to Hopsworks.IOException
- Generic IO exception.SQLException
- In case there is online storage (RonDB) access error or other errors.ClassNotFoundException
- In case class `com.mysql.jdbc.Driver` can not be found.public List<List<Object>> getFeatureVectors(Map<String,List<Object>> entry) throws SQLException, FeatureStoreException, IOException, ClassNotFoundException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// define primary key values to fetch data from online feature store
Map<String, List<Long>> entry = ...;
// get feature vector
fv.getFeatureVector(entry);
entry
- A list of dictionaries of feature group primary key and values provided by serving application.FeatureStoreException
- In case client is not connected to Hopsworks.IOException
- Generic IO exception.SQLException
- In case there is online storage (RonDB) access error or other errors.ClassNotFoundException
- In case class `com.mysql.jdbc.Driver` can not be found.public List<List<Object>> getFeatureVectors(Map<String,List<Object>> entry, boolean external) throws SQLException, FeatureStoreException, IOException, ClassNotFoundException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// get feature view handle
FeatureView fv = fs.getFeatureView("fv_name", 1);
// define primary key values to fetch data from online feature store
Map<String, List<Long>> entry = ...;
// get feature vector
fv.getFeatureVectors(entry, false);
entry
- A list of dictionaries of feature group primary key and values provided by serving application.external
- If set to `true`, the connection to the online feature store is established using the same host as
for the `host` parameter in the connection object.
If set to False, the online feature store storage connector is used which relies on the private IP.FeatureStoreException
- In case client is not connected to Hopsworks.IOException
- Generic IO exception.SQLException
- In case there is online storage (RonDB) access error or other errors.ClassNotFoundException
- In case class `com.mysql.jdbc.Driver` can not be found.public abstract void addTag(String name, Object value) throws FeatureStoreException, IOException
name
- name of the tagvalue
- value of the tag. The value of a tag can be any valid json - primitives, arrays or json objectsFeatureStoreException
IOException
public abstract Map<String,Object> getTags() throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract Object getTag(String name) throws FeatureStoreException, IOException
name
- name of the tagFeatureStoreException
IOException
public abstract void deleteTag(String name) throws FeatureStoreException, IOException
name
- name of the tag to be deletedFeatureStoreException
IOException
public abstract void addTrainingDatasetTag(Integer version, String name, Object value) throws FeatureStoreException, IOException
name
- name of the tagvalue
- value of the tag. The value of a tag can be any valid json - primitives, arrays or json objectsFeatureStoreException
IOException
public abstract Map<String,Object> getTrainingDatasetTags(Integer version) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract Object getTrainingDatasetTag(Integer version, String name) throws FeatureStoreException, IOException
name
- name of the tagFeatureStoreException
IOException
public abstract void deleteTrainingDatasetTag(Integer version, String name) throws FeatureStoreException, IOException
name
- name of the tag to be deletedFeatureStoreException
IOException
public HashSet<String> getPrimaryKeys() throws SQLException, IOException, FeatureStoreException, ClassNotFoundException
SQLException
IOException
FeatureStoreException
ClassNotFoundException
public abstract void delete() throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract void clean(T3 featureStore, String featureViewName, Integer featureViewVersion) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract T update(T other) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract String getBatchQuery() throws FeatureStoreException, IOException, ParseException
public abstract String getBatchQuery(String startTime, String endTime) throws FeatureStoreException, IOException, ParseException
public abstract T5 getBatchData() throws FeatureStoreException, IOException, ParseException
public abstract T5 getBatchData(String startTime, String endTime) throws FeatureStoreException, IOException, ParseException
public abstract T5 getBatchData(String startTime, String endTime, Map<String,String> readOptions) throws FeatureStoreException, IOException, ParseException
public abstract Object getTrainingData(Integer version, Map<String,String> readOptions) throws IOException, FeatureStoreException, ParseException
public abstract Object getTrainTestSplit(Integer version, Map<String,String> readOptions) throws IOException, FeatureStoreException, ParseException
public abstract Object getTrainValidationTestSplit(Integer version, Map<String,String> readOptions) throws IOException, FeatureStoreException, ParseException
public abstract void purgeTrainingData(Integer version) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract void purgeAllTrainingData() throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract void deleteTrainingDataset(Integer version) throws FeatureStoreException, IOException
FeatureStoreException
IOException
public abstract void deleteAllTrainingDatasets() throws FeatureStoreException, IOException
FeatureStoreException
IOException
Copyright © 2023. All rights reserved.