Skip to content

Update pipelines #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'pyOpenSSL==23.0.0',

# Math
'pyts>=0.10.0',
'pyts>=0.11.0',

# Flask
'Flask==1.0.2',
Expand Down
2 changes: 1 addition & 1 deletion sintel/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
os.path.dirname(os.path.abspath(__file__)),
'data'
)
BUCKET = 'd3-ai-orion'
BUCKET = 'sintel-orion'
S3_URL = 'https://{}.s3.amazonaws.com/{}'

NASA_SIGNALS = (
Expand Down
9 changes: 4 additions & 5 deletions sintel/db/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _update_prediction(signalrun, v, stock=False):
print(e)


def _update_period(signalrun, v, stock=False):
def _update_period(signalrun, v, my_interval=1440, stock=False):
year_start = datetime.utcfromtimestamp(v['raw_index'][0]).year
year_end = datetime.utcfromtimestamp(v['raw_index'][-1]).year

Expand All @@ -320,7 +320,6 @@ def _update_period(signalrun, v, stock=False):

# optimal interval for periodical description
diff = (v['raw_index'][1] - v['raw_index'][0]) / 60
my_interval = 1440
for interval in [6, 30, 60, 120, 180, 240, 360, 480, 720]:
if diff <= interval:
my_interval = interval
Expand Down Expand Up @@ -447,7 +446,7 @@ def _update_raw(signal, interval=360, method=['mean'], stock=False):
schema.SignalRaw.insert(**raw_doc)


def update_db(fs, exp_filter=None, stock=False):
def update_db(fs, interval=360, my_interval=1440, exp_filter=None, stock=False):

global g_fs
g_fs = fs
Expand All @@ -463,7 +462,7 @@ def update_db(fs, exp_filter=None, stock=False):
cc += 1
LOGGER.info('{}/{}: Processing signal {}'.format(cc, total, signal.name))
if not schema.SignalRaw.find_one(signal=signal):
_update_raw(signal, stock=stock)
_update_raw(signal, interval=interval, stock=stock)
else:
LOGGER.info('Skip - this signal data has been processed previously')
except Exception as e:
Expand Down Expand Up @@ -494,7 +493,7 @@ def update_db(fs, exp_filter=None, stock=False):
if (schema.Period.find_one(signalrun=signalrun.id) is not None):
continue
else:
_update_period(signalrun, v, stock=stock)
_update_period(signalrun, v, my_interval=my_interval, stock=stock)

except Exception as e:
print(e)
Expand Down
4 changes: 2 additions & 2 deletions sintel/resources/datarun.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
# import json
import logging
import sys
# import sys

from bson import ObjectId
from flask_restful import Resource, reqparse
Expand Down
14 changes: 7 additions & 7 deletions tutorials/pipelines/orion_lstmdt.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"primitives": [
"mlprimitives.custom.timeseries_preprocessing.time_segments_aggregate",
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate",
"sklearn.impute.SimpleImputer",
"sklearn.preprocessing.MinMaxScaler",
"mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences",
"mlstars.custom.timeseries_preprocessing.rolling_window_sequences",
"keras.Sequential.LSTMTimeSeriesRegressor",
"orion.primitives.timeseries_errors.regression_errors",
"orion.primitives.timeseries_anomalies.find_anomalies"
],
"init_params": {
"mlprimitives.custom.timeseries_preprocessing.time_segments_aggregate#1": {
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1": {
"time_column": "timestamp",
"interval": 21600,
"method": "mean"
Expand All @@ -20,7 +20,7 @@
1
]
},
"mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences#1": {
"mlstars.custom.timeseries_preprocessing.rolling_window_sequences#1": {
"target_column": 0,
"window_size": 250
},
Expand Down Expand Up @@ -57,19 +57,19 @@
},
{
"name": "raw_index",
"variable": "mlprimitives.custom.timeseries_preprocessing.time_segments_aggregate#1.index"
"variable": "mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1.index"
},
{
"name": "X_nm",
"variable": "sklearn.preprocessing.MinMaxScaler#1.X"
},
{
"name": "target_index",
"variable": "mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences#1.target_index"
"variable": "mlstars.custom.timeseries_preprocessing.rolling_window_sequences#1.target_index"
},
{
"name": "y",
"variable": "mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences#1.y"
"variable": "mlstars.custom.timeseries_preprocessing.rolling_window_sequences#1.y"
},
{
"name": "y_hat",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"primitives": [
"mlprimitives.custom.timeseries_preprocessing.time_segments_aggregate",
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate",
"sklearn.impute.SimpleImputer",
"sklearn.preprocessing.MinMaxScaler",
"mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences",
"mlstars.custom.timeseries_preprocessing.rolling_window_sequences",
"orion.primitives.tadgan.TadGAN",
"orion.primitives.tadgan.score_anomalies",
"orion.primitives.timeseries_anomalies.find_anomalies"
],
"init_params": {
"mlprimitives.custom.timeseries_preprocessing.time_segments_aggregate#1": {
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1": {
"time_column": "timestamp",
"interval": 21600,
"method": "mean"
Expand All @@ -20,7 +20,7 @@
1
]
},
"mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences#1": {
"mlstars.custom.timeseries_preprocessing.rolling_window_sequences#1": {
"target_column": 0,
"window_size": 100,
"target_size": 1
Expand Down Expand Up @@ -49,7 +49,7 @@
"orion.primitives.tadgan.TadGAN#1": {
"y": "y_hat"
},
"mlprimitives.custom.timeseries_preprocessing.rolling_window_sequences#1": {
"mlstars.custom.timeseries_preprocessing.rolling_window_sequences#1": {
"index": "X_index"
}
},
Expand Down