import numpy as np import os from telemanom._globals import Config import logging from datetime import datetime import sys import csv import pandas as pd import plotly as py from plotly.offline import download_plotlyjs, init_notebook_mode import cufflinks as cf import glob config = Config("config.yaml") def make_dirs(_id): '''Create directories for storing data in repo (using datetime ID) if they don't already exist''' if not config.train or not config.predict: if not os.path.isdir('data/%s' %config.use_id): raise ValueError("Run ID %s is not valid. If loading prior models or predictions, must provide valid ID.") paths = ['data', 'data/%s' %_id, 'data/%s/models' %_id, 'data/%s/smoothed_errors' %_id, 'data/%s/y_hat' %_id] for p in paths: if not os.path.isdir(p): os.mkdir(p) def setup_logging(config, _id):
sys.path.insert(0, '..') # sys.path.insert(0, '/home/mike/Downloads/telemanom') from telemanom._globals import Config # sys.path.remove('/home/mike/Downloads/telemanom') # sys.path.insert(0, '/home/mike/Downloads/telemanom/telemanom') import telemanom.helpers as helpers import pandas as pd import plotly as py from plotly.offline import download_plotlyjs, init_notebook_mode import cufflinks as cf import glob cf.go_offline() init_notebook_mode(connected=True) # load in current system configs config = Config("../config.yaml") # %% %%javascript IPython.OutputArea.prototype._should_scroll = function(lines) { return false; } # %% markdown # ## Select set of results to visualize # %% # results_fn = '2018-05-18_16.17.03.csv' # print("Prior run: %s" %results_fn) # Default to most recent results_fn = glob.glob('*.csv')[-1] print("Using most recent run: %s" %results_fn) # %% markdown