Exemplo n.º 1
0
    def encode(self, dataset, params: EncoderParams):
        cache_key = CacheHandler.generate_cache_key(
            self._prepare_caching_params(dataset, params))
        encoded_dataset = CacheHandler.memo(
            cache_key, lambda: self._encode_new_dataset(dataset, params))

        return encoded_dataset
Exemplo n.º 2
0
 def run(input_params: DataSplitterParams = None):
     cache_key = CacheHandler.generate_cache_key(
         DataSplitter._prepare_caching_params(input_params))
     fn = getattr(
         DataSplitter,
         "{}_split".format(input_params.split_strategy.name.lower()))
     datasets = CacheHandler.memo(cache_key, lambda: fn(input_params))
     return datasets