Search in sources :

Example 1 with StatisticsConfigDTO

use of io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO in project hopsworks by logicalclocks.

the class TestStatisticColumnController method testVerifyStatisticColumnsExistFg.

@Test
public void testVerifyStatisticColumnsExistFg() throws Exception {
    FeaturegroupDTO featuregroupDTO = new FeaturegroupDTO();
    featuregroupDTO.setName("fg1");
    featuregroupDTO.setVersion(1);
    StatisticsConfigDTO statisticsConfig = new StatisticsConfigDTO();
    featuregroupDTO.setStatisticsConfig(statisticsConfig);
    statisticsConfig.setColumns(Arrays.asList("ft1", "ft4"));
    featuregroupDTO.setFeatures(Arrays.asList(new FeatureGroupFeatureDTO("ft1", null, ""), new FeatureGroupFeatureDTO("ft2", null, ""), new FeatureGroupFeatureDTO("ft3", null, "")));
    // should throw exception
    thrown.expect(FeaturestoreException.class);
    statisticColumnController.verifyStatisticColumnsExist(featuregroupDTO);
    // should not throw exception
    statisticsConfig.setColumns(Arrays.asList("ft1", "ft2"));
    statisticColumnController.verifyStatisticColumnsExist(featuregroupDTO);
}
Also used : FeatureGroupFeatureDTO(io.hops.hopsworks.common.featurestore.feature.FeatureGroupFeatureDTO) FeaturegroupDTO(io.hops.hopsworks.common.featurestore.featuregroup.FeaturegroupDTO) StatisticsConfigDTO(io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO) Test(org.junit.Test)

Example 2 with StatisticsConfigDTO

use of io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO in project hopsworks by logicalclocks.

the class TestStatisticColumnController method testVerifyStatisticColumnsExistTD.

@Test
public void testVerifyStatisticColumnsExistTD() throws Exception {
    TrainingDataset trainingDataset = new TrainingDataset();
    StatisticsConfigDTO statisticsConfig = new StatisticsConfigDTO();
    statisticsConfig.setColumns(Arrays.asList("ft1", "ft4"));
    trainingDataset.setFeatures(Arrays.asList(new TrainingDatasetFeature(trainingDataset, "ft1", null, null, false, null), new TrainingDatasetFeature(trainingDataset, "ft2", null, null, false, null), new TrainingDatasetFeature(trainingDataset, "ft3", null, null, false, null)));
    TrainingDatasetDTO trainingDatasetDTO = new TrainingDatasetDTO();
    trainingDatasetDTO.setName("td1");
    trainingDatasetDTO.setVersion(1);
    trainingDatasetDTO.setStatisticsConfig(statisticsConfig);
    // should throw exception
    thrown.expect(FeaturestoreException.class);
    statisticColumnController.verifyStatisticColumnsExist(trainingDatasetDTO, trainingDataset);
    // should not throw exception
    statisticsConfig.setColumns(Arrays.asList("ft1", "ft2"));
    statisticColumnController.verifyStatisticColumnsExist(trainingDatasetDTO, trainingDataset);
}
Also used : TrainingDatasetDTO(io.hops.hopsworks.common.featurestore.trainingdatasets.TrainingDatasetDTO) TrainingDatasetFeature(io.hops.hopsworks.persistence.entity.featurestore.trainingdataset.TrainingDatasetFeature) TrainingDataset(io.hops.hopsworks.persistence.entity.featurestore.trainingdataset.TrainingDataset) StatisticsConfigDTO(io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO) Test(org.junit.Test)

Aggregations

StatisticsConfigDTO (io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO)2 Test (org.junit.Test)2 FeatureGroupFeatureDTO (io.hops.hopsworks.common.featurestore.feature.FeatureGroupFeatureDTO)1 FeaturegroupDTO (io.hops.hopsworks.common.featurestore.featuregroup.FeaturegroupDTO)1 TrainingDatasetDTO (io.hops.hopsworks.common.featurestore.trainingdatasets.TrainingDatasetDTO)1 TrainingDataset (io.hops.hopsworks.persistence.entity.featurestore.trainingdataset.TrainingDataset)1 TrainingDatasetFeature (io.hops.hopsworks.persistence.entity.featurestore.trainingdataset.TrainingDatasetFeature)1