Skip to content

Commit

Permalink
fix(KDP): fixing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrlaczkowski committed Apr 12, 2024
1 parent d500474 commit fbcb9d1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion kdp/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from typing import Any

import tensorflow as tf
from layers_factory import PreprocessorLayerFactory
from loguru import logger

from kdp.layers_factory import PreprocessorLayerFactory


class TextVectorizerOutputOptions(Enum):
TF_IDF = auto()
Expand Down
3 changes: 2 additions & 1 deletion kdp/layers_factory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import inspect

import tensorflow as tf
from custom_layers import TextPreprocessingLayer

from kdp.custom_layers import TextPreprocessingLayer


class PreprocessorLayerFactory:
Expand Down
2 changes: 1 addition & 1 deletion kdp/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from typing import Any

import tensorflow as tf
from features import CategoricalFeature, CategoryEncodingOptions, FeatureType, NumericalFeature, TextFeature
from loguru import logger

from kdp.features import CategoricalFeature, CategoryEncodingOptions, FeatureType, NumericalFeature, TextFeature
from kdp.layers_factory import PreprocessorLayerFactory
from kdp.pipeline import FeaturePreprocessor
from kdp.stats import DatasetStatistics
Expand Down
3 changes: 2 additions & 1 deletion kdp/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import numpy as np
import tensorflow as tf
from features import CategoricalFeature, FeatureType, NumericalFeature
from loguru import logger

from kdp.features import CategoricalFeature, FeatureType, NumericalFeature


class WelfordAccumulator:
"""Accumulator for computing the mean and variance of a sequence of numbers
Expand Down
4 changes: 4 additions & 0 deletions test/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ def test_chain_processing_steps(self):
output_layer = preprocessor.chain(input_layer)
print("type layer", type(output_layer))
self.assertTrue(tf.keras.utils.is_keras_tensor(output_layer))


if __name__ == "__main__":
unittest.main()

0 comments on commit fbcb9d1

Please sign in to comment.