@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.data_processing.CategoricalToBinary import CategoricalToBinaryPrimitive | |||||
class CategoricalToBinarySKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=CategoricalToBinaryPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.data_processing.ContinuityValidation import ContinuityValidationPrimitive | |||||
class ContinuityValidationSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=ContinuityValidationPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.data_processing.DuplicationValidation import DuplicationValidationPrimitive | |||||
class DuplicationValidationSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=DuplicationValidationPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.data_processing.SKImputer import SKImputerPrimitive | |||||
class SKImputerSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SKImputerPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.data_processing.TimeIntervalTransform import TimeIntervalTransformPrimitive | |||||
class TimeIntervalTransformSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=TimeIntervalTransformPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.data_processing.TimeStampValidation import TimeStampValidationPrimitive | |||||
class TimeStampValidationSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=TimeStampValidationPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,46 @@ | |||||
import re | |||||
import os | |||||
with open('../utils/entry_points/entry_points_data_processing.txt','r',encoding='utf-8') as f: | |||||
entry_file = f.read() | |||||
output_dir = '../data_processing' | |||||
fit_available_primitives = ['SKImputerPrimitive'] | |||||
primitive_folder_start_loc_buf = [i.start()+2 for i in re.finditer('=', entry_file)] | |||||
primitive_start_loc_buf = [i.start()+1 for i in re.finditer(':', entry_file)] | |||||
primitive_end_loc_buf = [i.start() for i in re.finditer('\n', entry_file)] | |||||
for primitive_index, primitive_start_loc in enumerate(primitive_start_loc_buf): | |||||
primitive_folder_start_loc = primitive_folder_start_loc_buf[primitive_index] | |||||
primitive_end_loc = primitive_end_loc_buf[primitive_index] | |||||
primitive_folder = entry_file[primitive_folder_start_loc:primitive_start_loc-1] | |||||
primitive_name = entry_file[primitive_start_loc:primitive_end_loc] | |||||
# print(entry_file[primitive_folder_start_loc:primitive_start_loc-1]) | |||||
# print(entry_file[primitive_start_loc:primitive_end_loc]) | |||||
import_line1 = 'import numpy as np \nfrom ..base import BaseSKI\n' | |||||
import_line2 = 'from ' + primitive_folder + ' import ' + primitive_name + '\n\n' | |||||
# print(import_line) | |||||
class_name = primitive_name.replace('Primitive', 'SKI') | |||||
class_line1 = 'class ' + class_name + '(BaseSKI):\n\tdef __init__(self, **hyperparams):\n\t\tsuper().__init__(primitive=' | |||||
class_line2 = primitive_name + ', **hyperparams)\n' | |||||
if primitive_name in fit_available_primitives: | |||||
class_line3 = '\t\tself.fit_available = True\n\t\tself.predict_available = False\n\t\tself.produce_available = True\n' | |||||
else: | |||||
class_line3 = '\t\tself.fit_available = False\n\t\tself.predict_available = False\n\t\tself.produce_available = True\n' | |||||
python_content = import_line1 + import_line2 + class_line1 + class_line2 + class_line3 | |||||
python_name = primitive_name.replace('Primitive', '_skinterface.py') | |||||
with open(os.path.join(output_dir, python_name), 'w', encoding='utf-8') as f: | |||||
f.write(python_content) | |||||
print(os.path.join(output_dir, python_name)) | |||||
print(python_content) | |||||
@@ -0,0 +1,46 @@ | |||||
import re | |||||
import os | |||||
with open('../utils/entry_points/entry_points_timeseries_processing.txt','r',encoding='utf-8') as f: | |||||
entry_file = f.read() | |||||
output_dir = '../timeseries_processing' | |||||
fit_unavailable_primitives = ['SubsequenceSegmentationPrimitive', 'TimeSeriesSeasonalityTrendDecompositionPrimitive', 'SKAxiswiseScalerPrimitive'] | |||||
primitive_folder_start_loc_buf = [i.start()+2 for i in re.finditer('=', entry_file)] | |||||
primitive_start_loc_buf = [i.start()+1 for i in re.finditer(':', entry_file)] | |||||
primitive_end_loc_buf = [i.start() for i in re.finditer('\n', entry_file)] | |||||
for primitive_index, primitive_start_loc in enumerate(primitive_start_loc_buf): | |||||
primitive_folder_start_loc = primitive_folder_start_loc_buf[primitive_index] | |||||
primitive_end_loc = primitive_end_loc_buf[primitive_index] | |||||
primitive_folder = entry_file[primitive_folder_start_loc:primitive_start_loc-1] | |||||
primitive_name = entry_file[primitive_start_loc:primitive_end_loc] | |||||
# print(entry_file[primitive_folder_start_loc:primitive_start_loc-1]) | |||||
# print(entry_file[primitive_start_loc:primitive_end_loc]) | |||||
import_line1 = 'import numpy as np \nfrom ..base import BaseSKI\n' | |||||
import_line2 = 'from ' + primitive_folder + ' import ' + primitive_name + '\n\n' | |||||
# print(import_line) | |||||
class_name = primitive_name.replace('Primitive', 'SKI') | |||||
class_line1 = 'class ' + class_name + '(BaseSKI):\n\tdef __init__(self, **hyperparams):\n\t\tsuper().__init__(primitive=' | |||||
class_line2 = primitive_name + ', **hyperparams)\n' | |||||
if primitive_name in fit_unavailable_primitives: | |||||
class_line3 = '\t\tself.fit_available = False\n\t\tself.predict_available = False\n\t\tself.produce_available = True\n' | |||||
else: | |||||
class_line3 = '\t\tself.fit_available = True\n\t\tself.predict_available = False\n\t\tself.produce_available = True\n' | |||||
python_content = import_line1 + import_line2 + class_line1 + class_line2 + class_line3 | |||||
python_name = primitive_name.replace('Primitive', '_skinterface.py') | |||||
with open(os.path.join(output_dir, python_name), 'w', encoding='utf-8') as f: | |||||
f.write(python_content) | |||||
print(os.path.join(output_dir, python_name)) | |||||
print(python_content) | |||||
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.HoltSmoothing import HoltSmoothingPrimitive | |||||
class HoltSmoothingSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=HoltSmoothingPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.HoltWintersExponentialSmoothing import HoltWintersExponentialSmoothingPrimitive | |||||
class HoltWintersExponentialSmoothingSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=HoltWintersExponentialSmoothingPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.MovingAverageTransformer import MovingAverageTransformerPrimitive | |||||
class MovingAverageTransformerSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=MovingAverageTransformerPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.SKAxiswiseScaler import SKAxiswiseScalerPrimitive | |||||
class SKAxiswiseScalerSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SKAxiswiseScalerPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.SKPowerTransformer import SKPowerTransformerPrimitive | |||||
class SKPowerTransformerSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SKPowerTransformerPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.SKQuantileTransformer import SKQuantileTransformerPrimitive | |||||
class SKQuantileTransformerSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SKQuantileTransformerPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.SKStandardScaler import SKStandardScalerPrimitive | |||||
class SKStandardScalerSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SKStandardScalerPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.SimpleExponentialSmoothing import SimpleExponentialSmoothingPrimitive | |||||
class SimpleExponentialSmoothingSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SimpleExponentialSmoothingPrimitive, **hyperparams) | |||||
self.fit_available = True | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.SubsequenceSegmentation import SubsequenceSegmentationPrimitive | |||||
class SubsequenceSegmentationSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=SubsequenceSegmentationPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,10 @@ | |||||
import numpy as np | |||||
from ..base import BaseSKI | |||||
from tods.timeseries_processing.TimeSeriesSeasonalityTrendDecomposition import TimeSeriesSeasonalityTrendDecompositionPrimitive | |||||
class TimeSeriesSeasonalityTrendDecompositionSKI(BaseSKI): | |||||
def __init__(self, **hyperparams): | |||||
super().__init__(primitive=TimeSeriesSeasonalityTrendDecompositionPrimitive, **hyperparams) | |||||
self.fit_available = False | |||||
self.predict_available = False | |||||
self.produce_available = True |
@@ -0,0 +1,6 @@ | |||||
tods.data_processing.time_interval_transform = tods.data_processing.TimeIntervalTransform:TimeIntervalTransformPrimitive | |||||
tods.data_processing.categorical_to_binary = tods.data_processing.CategoricalToBinary:CategoricalToBinaryPrimitive | |||||
tods.data_processing.timestamp_validation = tods.data_processing.TimeStampValidation:TimeStampValidationPrimitive | |||||
tods.data_processing.duplication_validation = tods.data_processing.DuplicationValidation:DuplicationValidationPrimitive | |||||
tods.data_processing.continuity_validation = tods.data_processing.ContinuityValidation:ContinuityValidationPrimitive | |||||
tods.data_processing.impute_missing = tods.data_processing.SKImputer:SKImputerPrimitive |
@@ -0,0 +1,10 @@ | |||||
tods.timeseries_processing.transformation.axiswise_scaler = tods.timeseries_processing.SKAxiswiseScaler:SKAxiswiseScalerPrimitive | |||||
tods.timeseries_processing.transformation.standard_scaler = tods.timeseries_processing.SKStandardScaler:SKStandardScalerPrimitive | |||||
tods.timeseries_processing.transformation.power_transformer = tods.timeseries_processing.SKPowerTransformer:SKPowerTransformerPrimitive | |||||
tods.timeseries_processing.transformation.quantile_transformer = tods.timeseries_processing.SKQuantileTransformer:SKQuantileTransformerPrimitive | |||||
tods.timeseries_processing.transformation.moving_average_transform = tods.timeseries_processing.MovingAverageTransformer:MovingAverageTransformerPrimitive | |||||
tods.timeseries_processing.transformation.simple_exponential_smoothing = tods.timeseries_processing.SimpleExponentialSmoothing:SimpleExponentialSmoothingPrimitive | |||||
tods.timeseries_processing.transformation.holt_smoothing = tods.timeseries_processing.HoltSmoothing:HoltSmoothingPrimitive | |||||
tods.timeseries_processing.transformation.subsequence_segmentation = tods.timeseries_processing.SubsequenceSegmentation:SubsequenceSegmentationPrimitive | |||||
tods.timeseries_processing.transformation.holt_winters_exponential_smoothing = tods.timeseries_processing.HoltWintersExponentialSmoothing:HoltWintersExponentialSmoothingPrimitive | |||||
tods.timeseries_processing.decomposition.time_series_seasonality_trend_decomposition = tods.timeseries_processing.TimeSeriesSeasonalityTrendDecomposition:TimeSeriesSeasonalityTrendDecompositionPrimitive |