Package com.logicalclocks.hsfs.spark
Class TrainingDataset
java.lang.Object
com.logicalclocks.hsfs.TrainingDatasetBase
com.logicalclocks.hsfs.spark.TrainingDataset
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.logicalclocks.hsfs.TrainingDatasetBase
coalesce, dataFormat, dataSource, description, eventEndTime, eventStartTime, extraFilter, features, featureStore, id, label, location, LOGGER, name, seed, splits, statisticsConfig, trainingDatasetType, trainSplit, type, version -
Constructor Summary
ConstructorsConstructorDescriptionTrainingDataset(Integer version, String description, DataFormat dataFormat, Boolean coalesce, StorageConnector storageConnector, String location, List<Split> splits, String trainSplit, Long seed, FeatureStoreBase featureStore, StatisticsConfig statisticsConfig, List<String> label, String eventStartTime, String eventEndTime, TrainingDatasetType trainingDatasetType, Float validationSize, Float testSize, String trainStart, String trainEnd, String validationStart, String validationEnd, String testStart, String testEnd, Integer timeSplitSize, FilterLogic extraFilterLogic, Filter extraFilter, DataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptionRecompute the statistics for the entire training dataset and save them to the feature store.org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>read()Read the content of the training dataset.org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>Read all a single split from the training dataset.org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>Read a single split from the training dataset.org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>Read the content of the training dataset.voidshow(int numRows) Show numRows from the training dataset (across all splits).Methods inherited from class com.logicalclocks.hsfs.TrainingDatasetBase
addTag, delete, deleteTag, getLabel, getStatistics, getStatistics, getTag, getTags, getTrainingDatasetType, setLabel, setTimeSeriesSplits, setValTestSplit
-
Constructor Details
-
TrainingDataset
public TrainingDataset(Integer version, String description, DataFormat dataFormat, Boolean coalesce, StorageConnector storageConnector, String location, List<Split> splits, String trainSplit, Long seed, FeatureStoreBase featureStore, StatisticsConfig statisticsConfig, List<String> label, String eventStartTime, String eventEndTime, TrainingDatasetType trainingDatasetType, Float validationSize, Float testSize, String trainStart, String trainEnd, String validationStart, String validationEnd, String testStart, String testEnd, Integer timeSplitSize, FilterLogic extraFilterLogic, Filter extraFilter, DataSource dataSource) throws FeatureStoreException, ParseException - Throws:
FeatureStoreExceptionParseException
-
-
Method Details
-
read
public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> read() throws FeatureStoreException, IOExceptionRead the content of the training dataset.- Returns:
- Spark Dataset containing the training dataset data
- Throws:
FeatureStoreException- if the training dataset has splits and the split was not specifiedIOException- IOException
-
read
public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> read(Map<String, String> readOptions) throws FeatureStoreException, IOExceptionRead the content of the training dataset.- Parameters:
readOptions- options to pass to the Spark read operation- Returns:
- Spark Dataset containing the training dataset data
- Throws:
FeatureStoreException- if the training dataset has splits and the split was not specifiedIOException- IOException
-
read
public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> read(String split) throws FeatureStoreException, IOException Read all a single split from the training dataset.- Parameters:
split- the split name- Returns:
- Spark Dataset containing the training dataset data
- Throws:
FeatureStoreException- if the training dataset has splits and the split was not specifiedIOException- IOException
-
read
public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> read(String split, Map<String, String> readOptions) throws FeatureStoreException, IOExceptionRead a single split from the training dataset.- Parameters:
split- the split namereadOptions- options to pass to the Spark read operation- Returns:
- Spark Dataset containing the training dataset data
- Throws:
FeatureStoreException- if the training dataset has splits and the split was not specifiedIOException- IOException
-
show
Show numRows from the training dataset (across all splits).- Parameters:
numRows- number of rows to display- Throws:
FeatureStoreException- FeatureStoreExceptionIOException- IOException
-
computeStatistics
Recompute the statistics for the entire training dataset and save them to the feature store.- Returns:
- statistics object of computed statistics
- Throws:
FeatureStoreException- FeatureStoreExceptionIOException- IOException
-