| @@ -1,9 +1,8 @@ | |||||
| #!/bin/bash | #!/bin/bash | ||||
| #modules="data_processing timeseries_processing feature_analysis detection_algorithms reinforcement" | |||||
| modules="data_processing timeseries_processing feature_analysis detection_algorithm reinforcement" | |||||
| #modules="data_processing timeseries_processing" | #modules="data_processing timeseries_processing" | ||||
| modules="detection_algorithm" | |||||
| #test_scripts=$(ls primitive_tests | grep -v -f tested_file.txt) | |||||
| #modules="detection_algorithm" | |||||
| for module in $modules | for module in $modules | ||||
| do | do | ||||
| @@ -35,13 +35,14 @@ setup( | |||||
| ] | ] | ||||
| }, | }, | ||||
| install_requires=[ | install_requires=[ | ||||
| 'tamu_d3m', | |||||
| 'tamu_axolotl', | |||||
| 'Jinja2', | |||||
| #'tamu_d3m', | |||||
| #'tamu_axolotl', | |||||
| #'Jinja2', | |||||
| 'numpy==1.18.2', | 'numpy==1.18.2', | ||||
| 'combo', | 'combo', | ||||
| 'simplejson==3.12.0', | 'simplejson==3.12.0', | ||||
| 'scikit-learn==0.22.0', | |||||
| #'scikit-learn==0.22.0', | |||||
| 'scikit-learn', | |||||
| 'statsmodels==0.11.1', | 'statsmodels==0.11.1', | ||||
| 'PyWavelets>=1.1.1', | 'PyWavelets>=1.1.1', | ||||
| 'pillow==7.1.2', | 'pillow==7.1.2', | ||||
| @@ -7,10 +7,10 @@ import sklearn | |||||
| import numpy | import numpy | ||||
| import typing | import typing | ||||
| import numpy as np | import numpy as np | ||||
| from keras.models import Sequential | |||||
| from keras.layers import Dense, Dropout , LSTM | |||||
| from keras.regularizers import l2 | |||||
| from keras.losses import mean_squared_error | |||||
| from tensorflow.keras.models import Sequential | |||||
| from tensorflow.keras.layers import Dense, Dropout , LSTM | |||||
| from tensorflow.keras.regularizers import l2 | |||||
| from tensorflow.keras.losses import mean_squared_error | |||||
| from sklearn.preprocessing import StandardScaler | from sklearn.preprocessing import StandardScaler | ||||
| from sklearn.utils import check_array | from sklearn.utils import check_array | ||||
| from sklearn.utils.validation import check_is_fitted | from sklearn.utils.validation import check_is_fitted | ||||
| @@ -196,7 +196,7 @@ class LSTMODetectorPrimitive(UnsupervisedOutlierDetectorBase[Inputs, Outputs, Pa | |||||
| "python_path": "d3m.primitives.tods.detection_algorithm.LSTMODetector", | "python_path": "d3m.primitives.tods.detection_algorithm.LSTMODetector", | ||||
| "source": {'name': "DATALAB @Taxes A&M University", 'contact': 'mailto:khlai037@tamu.edu', | "source": {'name': "DATALAB @Taxes A&M University", 'contact': 'mailto:khlai037@tamu.edu', | ||||
| 'uris': ['https://gitlab.com/lhenry15/tods.git', 'https://gitlab.com/lhenry15/tods/-/blob/Junjie/anomaly-primitives/anomaly_primitives/LSTMOD.py']}, | 'uris': ['https://gitlab.com/lhenry15/tods.git', 'https://gitlab.com/lhenry15/tods/-/blob/Junjie/anomaly-primitives/anomaly_primitives/LSTMOD.py']}, | ||||
| "algorithm_types": [metadata_base.PrimitiveAlgorithmType.ISOLATION_FOREST, ], # up to update | |||||
| "algorithm_types": [metadata_base.PrimitiveAlgorithmType.TODS_PRIMITIVE ], # up to update | |||||
| "primitive_family": metadata_base.PrimitiveFamily.ANOMALY_DETECTION, | "primitive_family": metadata_base.PrimitiveFamily.ANOMALY_DETECTION, | ||||
| "version": "0.0.1", | "version": "0.0.1", | ||||
| "hyperparams_to_tune": ['contamination', 'train_contamination', 'min_attack_time', | "hyperparams_to_tune": ['contamination', 'train_contamination', 'min_attack_time', | ||||
| @@ -9,11 +9,11 @@ import typing | |||||
| import pandas as pd | import pandas as pd | ||||
| from keras.models import Sequential, load_model | |||||
| from keras.callbacks import History, EarlyStopping, Callback | |||||
| from keras.layers.recurrent import LSTM | |||||
| from keras.layers.core import Dense, Activation, Dropout | |||||
| from keras.layers import Flatten | |||||
| from tensorflow.keras.models import Sequential, load_model | |||||
| from tensorflow.keras.callbacks import History, EarlyStopping, Callback | |||||
| from tensorflow.keras.layers import LSTM | |||||
| from tensorflow.keras.layers import Dense, Activation, Dropout | |||||
| from tensorflow.keras.layers import Flatten | |||||
| from d3m import container, utils | from d3m import container, utils | ||||
| from d3m.base import utils as base_ut | from d3m.base import utils as base_ut | ||||
| @@ -11,8 +11,8 @@ from .CollectiveBase import CollectiveBaseDetector | |||||
| # from tod.utility import get_sub_matrices | # from tod.utility import get_sub_matrices | ||||
| from keras.layers import Dense, LSTM | |||||
| from keras.models import Sequential | |||||
| from tensorflow.keras.layers import Dense, LSTM | |||||
| from tensorflow.keras.models import Sequential | |||||
| class LSTMOutlierDetector(CollectiveBaseDetector): | class LSTMOutlierDetector(CollectiveBaseDetector): | ||||
| @@ -1,8 +1,8 @@ | |||||
| from keras.models import Sequential, load_model | |||||
| from keras.callbacks import History, EarlyStopping, Callback | |||||
| from keras.layers.recurrent import LSTM | |||||
| from keras.layers.core import Dense, Activation, Dropout | |||||
| from keras.layers import Flatten | |||||
| from tensorflow.keras.models import Sequential, load_model | |||||
| from tensorflow.keras.callbacks import History, EarlyStopping, Callback | |||||
| from tensorflow.keras.layers import LSTM | |||||
| from tensorflow.keras.layers import Dense, Activation, Dropout | |||||
| from tensorflow.keras.layers import Flatten | |||||
| import numpy as np | import numpy as np | ||||
| import os | import os | ||||
| import logging | import logging | ||||
| @@ -115,8 +115,8 @@ class RuleBasedFilter(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hype | |||||
| "python_path": "d3m.primitives.tods.reinforcement.rule_filter", | "python_path": "d3m.primitives.tods.reinforcement.rule_filter", | ||||
| "source": {'name': 'DATA Lab at Texas A&M University', 'contact': 'mailto:khlai037@tamu.edu', | "source": {'name': 'DATA Lab at Texas A&M University', 'contact': 'mailto:khlai037@tamu.edu', | ||||
| 'uris': ['https://gitlab.com/lhenry15/tods.git', ]}, | 'uris': ['https://gitlab.com/lhenry15/tods.git', ]}, | ||||
| "algorithm_types": [metadata_base.PrimitiveAlgorithmType.RULE_BASED_FILTER,], | |||||
| "primitive_family": metadata_base.PrimitiveFamily.REINFORCEMENT, | |||||
| "algorithm_types": [metadata_base.PrimitiveAlgorithmType.TODS_PRIMITIVE,], | |||||
| "primitive_family": metadata_base.PrimitiveFamily.ANOMALY_DETECTION, | |||||
| "id": "42744c37-8879-4785-9f18-6de9d612ea93", | "id": "42744c37-8879-4785-9f18-6de9d612ea93", | ||||
| "hyperparams_to_tune": ['rule',], | "hyperparams_to_tune": ['rule',], | ||||
| "version": "0.0.1", | "version": "0.0.1", | ||||
| @@ -4,11 +4,11 @@ import sys | |||||
| import unittest | import unittest | ||||
| runner = unittest.TextTestRunner(verbosity=1) | runner = unittest.TextTestRunner(verbosity=1) | ||||
| tests = unittest.TestLoader().discover('./') | |||||
| if not runner.run(tests).wasSuccessful(): | |||||
| sys.exit(1) | |||||
| #tests = unittest.TestLoader().discover('./') | |||||
| #if not runner.run(tests).wasSuccessful(): | |||||
| # sys.exit(1) | |||||
| #for each in ['data_processing', 'timeseries_processing', 'feature_analysis', 'detection_algorithm']: | |||||
| # tests = unittest.TestLoader().discover(each) | |||||
| # if not runner.run(tests).wasSuccessful(): | |||||
| # sys.exit(1) | |||||
| for each in ['data_processing', 'timeseries_processing', 'feature_analysis', 'detection_algorithm']: | |||||
| tests = unittest.TestLoader().discover(each) | |||||
| if not runner.run(tests).wasSuccessful(): | |||||
| sys.exit(1) | |||||