├── grand ├── _version.py ├── group_anomaly │ ├── __init__.py │ ├── peer_grouping.py │ ├── transformer.py │ └── group_anomaly.py ├── datasets │ ├── __init__.py │ ├── data_loader.py │ └── data │ │ ├── toy6 │ │ ├── unit3.csv │ │ └── unit1.csv │ │ ├── toy7 │ │ └── unit1.csv │ │ ├── toy2 │ │ └── unit1.csv │ │ ├── toy5 │ │ └── unit4.csv │ │ ├── toy1 │ │ └── unit3.csv │ │ └── toy4 │ │ └── unit4.csv ├── individual_anomaly │ ├── __init__.py │ ├── individual_anomaly_inductive.py │ └── individual_anomaly_transductive.py ├── __init__.py ├── conformal.py └── utils.py ├── requirements.txt ├── examples └── notebooks │ ├── imgs │ ├── pvalue.png │ └── features-exploration.png │ └── data │ ├── stationary-0.csv │ ├── stationary-1.csv │ └── stationary-2.csv ├── setup.py ├── LICENSE ├── .gitignore └── README.md /grand/_version.py: -------------------------------------------------------------------------------- 1 | __version__ = "0.2.0" -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib>=2.1.0 2 | numpy>=1.13.3 3 | pandas>=0.22.0 4 | scipy>=1.0.0 5 | scikit-learn>=0.20.0 6 | -------------------------------------------------------------------------------- /examples/notebooks/imgs/pvalue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caisr-hh/group-anomaly-detection/HEAD/examples/notebooks/imgs/pvalue.png -------------------------------------------------------------------------------- /examples/notebooks/imgs/features-exploration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caisr-hh/group-anomaly-detection/HEAD/examples/notebooks/imgs/features-exploration.png -------------------------------------------------------------------------------- /grand/group_anomaly/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = "Mohamed-Rafik Bouguelia" 2 | __license__ = "MIT" 3 | __email__ = "mohamed-rafik.bouguelia@hh.se" 4 | 5 | from .group_anomaly import GroupAnomaly 6 | -------------------------------------------------------------------------------- /grand/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = "Mohamed-Rafik Bouguelia" 2 | __license__ = "MIT" 3 | __email__ = "mohamed-rafik.bouguelia@hh.se" 4 | 5 | from .data_loader import load_vehicles 6 | from .data_loader import load_artificial 7 | from .data_loader import load_taxi 8 | -------------------------------------------------------------------------------- /grand/individual_anomaly/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = "Mohamed-Rafik Bouguelia" 2 | __license__ = "MIT" 3 | __email__ = "mohamed-rafik.bouguelia@hh.se" 4 | 5 | from .individual_anomaly_inductive import IndividualAnomalyInductive 6 | from .individual_anomaly_transductive import IndividualAnomalyTransductive 7 | -------------------------------------------------------------------------------- /grand/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = "Mohamed-Rafik Bouguelia" 2 | __license__ = "MIT" 3 | __email__ = "mohamed-rafik.bouguelia@hh.se" 4 | 5 | from .individual_anomaly.individual_anomaly_inductive import IndividualAnomalyInductive 6 | from .individual_anomaly.individual_anomaly_transductive import IndividualAnomalyTransductive 7 | from .group_anomaly import GroupAnomaly 8 | from ._version import __version__ 9 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | import os, re 3 | 4 | verfile = ".{}grand{}_version.py".format(os.sep, os.sep) 5 | verstrline = open(verfile, "rt").read() 6 | VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" 7 | mo = re.search(VSRE, verstrline, re.M) 8 | version_str = mo.group(1) 9 | 10 | data_path = '.{}grand{}datasets{}data'.format(os.sep, os.sep, os.sep) 11 | data_files = [ 'datasets' + os.sep + 'data' + os.sep + dirname + os.sep + '*' for dirname in os.listdir(data_path) ] 12 | 13 | setup(name='grand', 14 | version=version_str, 15 | description='GRAND: Group-based Anomaly Detection for Large-Scale Monitoring of Complex Systems', 16 | url='https://github.com/caisr-hh', 17 | author='Mohamed-Rafik Bouguelia - Center for Applied Intelligent Systems Research (CAISR)', 18 | author_email='mohbou@hh.se', 19 | license='MIT', 20 | packages=find_packages(), 21 | package_data={'grand':data_files}, 22 | install_requires=['matplotlib>=2.1.0', 'numpy>=1.13.3', 'pandas>=0.22.0', 'scipy>=1.0.0', 'scikit-learn>=0.20.0'], 23 | zip_safe=False, 24 | python_requires='>=3.4') 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 CAISR 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Other files from the project 2 | examples/test_individual_anomaly_inductive.py 3 | examples/test_individual_anomaly_transductive.py 4 | examples/test_group_anomaly.py 5 | 6 | # Byte-compiled / optimized / DLL files 7 | __pycache__/ 8 | *.py[cod] 9 | *$py.class 10 | 11 | # C extensions 12 | *.so 13 | 14 | # Distribution / packaging 15 | .Python 16 | build/ 17 | develop-eggs/ 18 | dist/ 19 | downloads/ 20 | eggs/ 21 | .eggs/ 22 | lib/ 23 | lib64/ 24 | parts/ 25 | sdist/ 26 | var/ 27 | wheels/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | MANIFEST 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | *.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .coverage 47 | .coverage.* 48 | .cache 49 | nosetests.xml 50 | coverage.xml 51 | *.cover 52 | .hypothesis/ 53 | .pytest_cache/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # pyenv 81 | .python-version 82 | 83 | # celery beat schedule file 84 | celerybeat-schedule 85 | 86 | # SageMath parsed files 87 | *.sage.py 88 | 89 | # Environments 90 | .env 91 | .venv 92 | env/ 93 | venv/ 94 | ENV/ 95 | env.bak/ 96 | venv.bak/ 97 | 98 | # Spyder project settings 99 | .spyderproject 100 | .spyproject 101 | 102 | # Rope project settings 103 | .ropeproject 104 | 105 | # mkdocs documentation 106 | /site 107 | 108 | # mypy 109 | .mypy_cache/ 110 | 111 | # pycharm 112 | .idea/ -------------------------------------------------------------------------------- /grand/group_anomaly/peer_grouping.py: -------------------------------------------------------------------------------- 1 | """Provides ways to group similar systems together. 2 | Status: under development. 3 | """ 4 | 5 | __author__ = "Mohamed-Rafik Bouguelia" 6 | __license__ = "MIT" 7 | __email__ = "mohamed-rafik.bouguelia@hh.se" 8 | 9 | from grand import utils 10 | import pandas as pd, numpy as np 11 | 12 | class PeerGrouping: 13 | '''Construct reference groups 14 | 15 | Parameters: 16 | ----------- 17 | w_ref_group : string 18 | Time window used to define the reference group, e.g. "7days", "12h" ... 19 | Possible values for the units can be found in https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_timedelta.html 20 | ''' 21 | 22 | def __init__(self, w_ref_group): 23 | self.w_ref_group = w_ref_group 24 | 25 | # =========================================== 26 | def get_target_and_reference(self, uid_test, dt, dffs): 27 | '''Extracts a test sample and its reference group 28 | 29 | Parameters: 30 | ----------- 31 | uid_test : int 32 | Index (in dffs) of the test unit. Must be in range(len(dffs)). 33 | 34 | dt : datetime 35 | Current datetime period 36 | 37 | dffs : list 38 | Each element in dffs corresponds to one unit. The length of dffs should be the number of units. 39 | Each element in dffs is a DataFrame containing the previous data (after features extraction) of the corresponding unit. 40 | 41 | Returns: 42 | -------- 43 | x : array-like, shape (n_features,) 44 | Test sample extracted from the test unit (dffs[uid_test]) at time dt 45 | 46 | Xref : array-like, shape (n_samples, n_features) 47 | Latest samples in the reference group (other units) over a period of w_ref_group 48 | ''' 49 | 50 | utils.validate_reference_grouping_input(uid_test, dt, dffs) 51 | 52 | x = dffs[uid_test].loc[dt].values 53 | Xref = [] 54 | for i, dff in enumerate(dffs): 55 | if i == uid_test: continue 56 | Xref += list( dff[dt - pd.to_timedelta(self.w_ref_group) : dt].values ) 57 | 58 | utils.validate_reference_group(Xref) 59 | Xref = np.array(Xref) 60 | return x, Xref 61 | 62 | # =========================================== -------------------------------------------------------------------------------- /grand/group_anomaly/transformer.py: -------------------------------------------------------------------------------- 1 | """Provides ways to transform the data of each system, so that the data from 2 | various systems is more fairly comparable. 3 | """ 4 | 5 | __author__ = "Mohamed-Rafik Bouguelia" 6 | __license__ = "MIT" 7 | __email__ = "mohamed-rafik.bouguelia@hh.se" 8 | 9 | import numpy as np 10 | from scipy.stats import linregress 11 | from grand import utils 12 | 13 | 14 | class Transformer: 15 | def __init__(self, w=20, transformer="pvalue"): 16 | self.w = w 17 | self.transformer = transformer 18 | self.X = None 19 | self.P = None 20 | self.MIN_HISTORY_SIZE = 10 21 | 22 | # TODO: validate the parameters (accepted strings) for self.transformer 23 | 24 | def transform_all(self, X): 25 | Z = np.array([self.transform(x) for x in X]) 26 | return Z 27 | 28 | def transform(self, x): 29 | if len(x) == 0 or self.transformer is None: 30 | return x 31 | 32 | if self.X is None and self.P is None: 33 | self.X = np.empty((0, len(x))) 34 | self.P = np.empty((0, len(x))) 35 | 36 | if self.transformer in ["mean_normalize", "std_normalize", "mean_std_normalize"]: 37 | with_mean = (self.transformer != "std_normalize") 38 | with_std = (self.transformer != "mean_normalize") 39 | return self.transform_normalize(x, with_mean, with_std) 40 | 41 | elif self.transformer in ["pvalue", "mean_pvalue"]: 42 | aggregate = (self.transformer == "mean_pvalue") 43 | return self.transform_pvalue(x, aggregate) 44 | 45 | elif self.transformer in ["slope"]: 46 | return self.transform_slope(x) 47 | 48 | else: 49 | raise utils.InputValidationError("transformer should be one of {}".format(["mean_normalize", "std_normalize", "mean_std_normalize", "slope", "pvalue", "mean_pvalue"])) 50 | 51 | 52 | def transform_slope(self, x): 53 | self.X = np.vstack([self.X, x]) 54 | if len(self.X) < self.w: return np.zeros(x.shape) 55 | return np.array([ linregress(range(self.w), self.X[-self.w:, j])[0] for j in range(len(x)) ]) 56 | 57 | 58 | def transform_normalize(self, x, with_mean=True, with_std=True): 59 | self.X = np.vstack([self.X, x]) 60 | x_normalized = np.array(x) 61 | 62 | if with_mean: 63 | x_normalized -= np.mean(self.X, axis=0) 64 | 65 | if with_std: 66 | std = np.std(self.X, axis=0) 67 | x_normalized /= (std if std>0 else 1) 68 | 69 | return x_normalized 70 | 71 | def transform_pvalue(self, x, aggregate=True): 72 | if len(self.X) < self.MIN_HISTORY_SIZE: 73 | p_arr = [0.5 for _ in range(len(x))] 74 | else: 75 | pvalue = lambda val, values: len([1 for v in values if v > val]) / len(values) 76 | p_arr = [pvalue(x[i], self.X[:, i]) for i in range(len(x))] 77 | 78 | self.P = np.vstack([self.P, p_arr]) 79 | self.X = np.vstack([self.X, x]) 80 | 81 | z = [] 82 | for i in range(len(x)): 83 | pvalues = self.P[-self.w:, i] 84 | if aggregate: 85 | z += [1. - np.mean(pvalues)] if len(pvalues) >= 1 else [0.5] 86 | else: 87 | z += [1. - pvalues[-1]] if len(pvalues) >= 1 else [0.5] 88 | 89 | return z 90 | -------------------------------------------------------------------------------- /grand/conformal.py: -------------------------------------------------------------------------------- 1 | """Provide functions for conformal anomaly detection. 2 | This module implements functions to compute non-conformity measures, p-values, 3 | and tests for the uniformity of p-values. 4 | """ 5 | 6 | __author__ = "Mohamed-Rafik Bouguelia" 7 | __license__ = "MIT" 8 | __email__ = "mohamed-rafik.bouguelia@hh.se" 9 | 10 | from grand import utils 11 | from sklearn.neighbors import LocalOutlierFactor 12 | import numpy as np 13 | 14 | 15 | def get_strangeness(measure="median", k=10): 16 | utils.validate_measure_str(measure) 17 | if measure == "median": 18 | return StrangenessMedian() 19 | elif measure == "knn": 20 | return StrangenessKNN(k) 21 | else: 22 | return StrangenessLOF(k) 23 | 24 | 25 | class Strangeness: 26 | '''Class that wraps StrangenessMedian and StrangenessKNN and StrangenessLOF''' 27 | 28 | def __init__(self): 29 | self.X = None 30 | self.scores = None 31 | 32 | def is_fitted(self): 33 | return self.X is not None 34 | 35 | def fit(self, X): 36 | utils.validate_fit_input(X) 37 | self.X = X 38 | 39 | def predict(self, x): 40 | utils.validate_is_fitted(self.is_fitted()) 41 | utils.validate_get_input(x) 42 | 43 | def pvalue(self, score): 44 | utils.validate_is_fitted(self.is_fitted()) 45 | utils.validate_list_not_empty(self.scores) 46 | return len([1 for v in self.scores if v > score]) / len(self.scores) 47 | 48 | 49 | class StrangenessMedian(Strangeness): 50 | '''Strangeness based on the distance to the median data (or most central pattern)''' 51 | 52 | def __init__(self): 53 | super().__init__() 54 | 55 | def fit(self, X): 56 | super().fit(X) 57 | self.med = np.median(X, axis=0) 58 | self.scores = [self.predict(x)[0] for x in self.X] 59 | 60 | def predict(self, x): 61 | super().predict(x) 62 | diff = x - self.med 63 | dist = np.linalg.norm(diff) 64 | return dist, diff, self.med 65 | 66 | 67 | class StrangenessKNN(Strangeness): 68 | '''Strangeness based on the average distance to the k nearest neighbors''' 69 | 70 | def __init__(self, k=10): 71 | super().__init__() 72 | self.k = k 73 | 74 | def fit(self, X): 75 | super().fit(X) 76 | self.scores = [self.predict(xx)[0] for xx in self.X] 77 | 78 | def predict(self, x): 79 | super().predict(x) 80 | dists = np.array([np.linalg.norm(x - xx) for xx in self.X]) 81 | ids = np.argsort(dists) 82 | ids = ids[1:self.k+1] if np.array_equal(x, self.X[ids[0]]) else ids[:self.k] 83 | 84 | mean_knn_dists = np.mean(dists[ids]) 85 | representative = np.mean(np.array(self.X)[ids], axis=0) 86 | diff = x - representative 87 | return mean_knn_dists, diff, representative 88 | 89 | 90 | class StrangenessLOF(Strangeness): 91 | '''Strangeness based on the local outlier factor (LOF)''' 92 | 93 | def __init__(self, k=10): 94 | super().__init__() 95 | utils.validate_int_higher(k, 0) 96 | self.k = k 97 | self.lof = LocalOutlierFactor(n_neighbors=k, novelty=True, contamination="auto") 98 | 99 | def fit(self, X): 100 | super().fit(X) 101 | X_ = list(X) + [ X[-1] for _ in range(self.k - len(X)) ] 102 | self.lof.fit(X_) 103 | self.scores = -1 * self.lof.negative_outlier_factor_ 104 | 105 | def predict(self, x): 106 | super().predict(x) 107 | outlier_score = -1 * self.lof.score_samples([x])[0] 108 | med = np.median(self.X, axis=0) # FIXME: temporary hack 109 | diff = x - med 110 | return outlier_score, diff, med 111 | -------------------------------------------------------------------------------- /grand/datasets/data_loader.py: -------------------------------------------------------------------------------- 1 | """Provides an easy way to load data from several CSV files in a repository and stream it. 2 | Each CSV file contains the dataset of one unit. The class provides an easy way to stream the data from 3 | all units. 4 | """ 5 | 6 | __author__ = "Mohamed-Rafik Bouguelia" 7 | __license__ = "MIT" 8 | __email__ = "mohamed-rafik.bouguelia@hh.se" 9 | 10 | import pandas as pd, numpy as np, matplotlib.pyplot as plt 11 | from pandas.plotting import register_matplotlib_converters 12 | from os import listdir 13 | from os.path import isfile, join, dirname 14 | 15 | 16 | # =================================================================================== 17 | class DataCSVs: 18 | '''Helper class to read data from several units. 19 | The data of each unit is presented as a CSV file. 20 | ''' 21 | def __init__(self, data_path): 22 | self.files_csv = sorted([ join(data_path, f) for f in listdir(data_path) if isfile(join(data_path, f)) ]) 23 | self.dfs, self.dates = [], [] 24 | 25 | # ------------------------------------- 26 | def load(self): 27 | for file_csv in self.files_csv: 28 | df = pd.read_csv(file_csv, index_col=0, parse_dates=[0]).dropna() 29 | self.dfs.append(df) 30 | 31 | index = self.dfs[0].index 32 | self.dates = index.union_many([ df.index for df in self.dfs ]).to_pydatetime() 33 | return self 34 | 35 | # ------------------------------------- 36 | def get_nb_features(self): 37 | return self.dfs[0].values.shape[1] 38 | 39 | # ------------------------------------- 40 | def get_nb_units(self): 41 | return len(self.files_csv) 42 | 43 | # ------------------------------------- 44 | def normalize(self, with_mean=True, with_std=True): 45 | if with_mean: 46 | self.dfs = [df - df.mean() for df in self.dfs] 47 | 48 | if with_std: 49 | stds = [df.std() for df in self.dfs] 50 | for std in stds: std[std==0] = 1 51 | self.dfs = [df / std for df, std in zip(self.dfs, stds)] 52 | 53 | return self 54 | 55 | # ------------------------------------- 56 | def stream(self): 57 | for dt in self.dates: 58 | x_units = [] 59 | for df in self.dfs: 60 | try: x_units.append( df.loc[dt].values ) 61 | except: x_units.append( np.array([]) ) 62 | 63 | yield dt, x_units 64 | 65 | # ------------------------------------- 66 | def stream_unit(self, i): 67 | for dt in self.dates: 68 | df = self.dfs[i] 69 | try: yield dt, df.loc[dt].values 70 | except: pass 71 | 72 | # ------------------------------------- 73 | def plot(self, icol=0, max_units=6, figsize=None): 74 | register_matplotlib_converters() 75 | fig, ax = plt.subplots(figsize = figsize) 76 | ax.set_xlabel("Time") 77 | ax.set_ylabel("Feature {}".format(icol)) 78 | 79 | for i, df in enumerate(self.dfs): 80 | if i == max_units: break 81 | ax.plot(df.index, df.values[:, icol], label="Unit {}".format(i)) 82 | 83 | plt.legend() 84 | fig.autofmt_xdate() 85 | plt.show() 86 | 87 | 88 | # =================================================================================== 89 | def loader(foldname): 90 | data_path = join(dirname(__file__), 'data', foldname) 91 | return DataCSVs(data_path).load() 92 | 93 | 94 | # =================================================================================== 95 | def load_vehicles(): 96 | return loader('vehicles') 97 | 98 | 99 | def load_artificial(i, smoothing=1): 100 | data_loader = loader("toy" + str(int(i%8))) 101 | data_loader.dfs = [df.rolling(window=smoothing).mean().dropna() for df in data_loader.dfs] 102 | data_loader.dfs[2][:] *= 2 # double the values from Unit 2 103 | return data_loader 104 | 105 | 106 | def load_taxi(): 107 | return loader("taxi") 108 | 109 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GRAND 2 | GRAND: Group-based Anomaly Detection for Self-Monitoring of Complex Systems 3 | 4 | This is an implementation a group-based anomaly detection method. It allows to autonomously monitor a system (unit) that generates data over time, by comparing it against its own past history, or against a group of other similar systems (units). It detects anomalies/deviations in a streaming fashion while accounting for concept drift which is due to external factors that can affect the data. 5 | 6 | # Install 7 | You can install the package locally (for use on your system), with: 8 | ``` 9 | $ pip install . 10 | ``` 11 | 12 | You can also install the package with a symlink, so that changes to the source files will be immediately available to other users of the package on our system: 13 | ``` 14 | $ pip install -e . 15 | ``` 16 | 17 | # Examples 18 | For intuitive examples and explanations, please check the [Jupyter notebook](examples/notebooks/examples.ipynb) at *./examples/notebooks/examples.ipynb* 19 | 20 | # Usage 21 | The library can perform individual anomaly detection (where a system is compared against it's own past history), or group-based anomaly detection (where the system's behaviour is modeled and compared against the behaviour of other systems). 22 | Please check the examples in the *./examples* directory. Here is a brief explanation for the group-based anomaly detection: 23 | 24 | First, you need to import `GroupAnomaly` and create an instance: 25 | ```python 26 | from grand import GroupAnomaly 27 | 28 | # Create an instance of GroupDeviation 29 | gdev = GroupAnomaly( nb_units=19, # Number of units (vehicles) 30 | ids_target_units=[0, 1], # Ids of the (target) units to diagnoise 31 | w_ref_group="7days", # Time window for the reference group 32 | w_martingale=15, # Window size for computing the deviation level 33 | non_conformity="median", # Non-conformity (strangeness) measure: "median" or "knn" 34 | k=50, # Used if non_conformity is "knn" 35 | dev_threshold=.6) # Threshold on the deviation level 36 | ``` 37 | 38 | An example of data is provided. It contains data from 19 units (consisting of vehicles). Each csv file contains data from one unit (vehicle). To use this example data, you can import the `load_vehicles` function from `cosmo.datasets` as folows: 39 | ```python 40 | from grand.datasets import load_vehicles 41 | 42 | # Streams data from several units (vehicles) over time 43 | dataset = load_vehicles() 44 | nb_units = dataset.get_nb_units() # nb_units = 19 vehicles in this example 45 | 46 | # dataset.stream() can then be used as a generator 47 | # to simulate a stream (see example below) 48 | 49 | # dataset.stream_unit(uid) can also be used to generate 50 | # a stream from one unit identified by index (e.g. uid=0) 51 | ``` 52 | 53 | A streaming setting is considered where data (indicated as `x_units` in the example below) is received from the units at each time step `dt`. The method `GroupDeviation.predict(uid, dt, x_units)` is then called each time to diagnoise the test unit indicated by the index `uid` (i.e. the data-point received from this unit at time `dt` is `x_units[uid]`). The `predict` method returns a list of DeviationContext objects. Each DeviationContext object contains the following information: 54 | 1. a *strangeness* score : the non-conformity of the test unit to the other units). 55 | 2. a *p-value* (in [0, 1]) : the ratio of data from other units which are stranger than the test unit's data. 56 | 3. an updated *devaliation* level (in [0, 1]) for the test unit. 57 | 4. a boolean *is_dev* indicating if the test unit is significantly deviating from the group. 58 | ```python 59 | # At each time dt, x_units contains data from all units. 60 | # Each data-point x_units[i] comes from the i'th unit. 61 | 62 | for dt, x_units in dataset.stream(): 63 | 64 | # diagnoise the selected target units (0 and 1) 65 | devContextList = gdev.predict(dt, x_units) 66 | 67 | for uid, devCon in enumerate(devContextList): 68 | print("Unit:{}, Time: {} ==> strangeness: {}, p-value: {}, deviation: {} ({})".format(uid, dt, devCon.strangeness, 69 | devCon.pvalue, devCon.deviation, "high" if devCon.is_deviating else "low")) 70 | 71 | # Plot p-values and deviation levels over time 72 | gdev.plot_deviations() 73 | 74 | ``` 75 | -------------------------------------------------------------------------------- /grand/utils.py: -------------------------------------------------------------------------------- 1 | """Provide some utility functions. 2 | """ 3 | 4 | __author__ = "Mohamed-Rafik Bouguelia" 5 | __license__ = "MIT" 6 | __email__ = "mohamed-rafik.bouguelia@hh.se" 7 | 8 | from collections import namedtuple 9 | import numpy as np, pandas as pd, pathlib as pl, os 10 | 11 | # =========================================== 12 | DeviationContext = namedtuple('DeviationContext', 'strangeness pvalue deviation is_deviating') 13 | 14 | 15 | # =========================================== 16 | class NotFittedError(Exception): pass 17 | class InputValidationError(Exception): pass 18 | class TestUnitError(Exception): pass 19 | class NoRefGroupError(Exception): pass 20 | 21 | 22 | # =========================================== 23 | def append_to_df(df, dt, x): # Appends a new row to a DataFrame 24 | if df is None or len(df) == 0: 25 | if len(x) > 0: return pd.DataFrame( data = [x], index = [dt] ) 26 | else: return pd.DataFrame( data = [], index = [] ) 27 | else: 28 | if len(x) > 0: df.loc[dt] = x 29 | return df 30 | 31 | 32 | # =========================================== 33 | def create_directory_from_path(pathname): 34 | pathname = pl.Path(pathname).resolve() 35 | directory = os.path.dirname(os.path.abspath(pathname)) 36 | if not os.path.exists(directory): 37 | os.makedirs(directory) 38 | return pathname 39 | 40 | # =========================================== 41 | # TODO add week-end 42 | def dt2num(dt, criterion): 43 | if criterion == "hour-of-day": 44 | return dt.hour 45 | elif criterion == "day-of-week": 46 | return dt.weekday() 47 | elif criterion == "day-of-month": 48 | return dt.day 49 | elif criterion == "week-of-year": 50 | return dt.isocalendar()[1] 51 | elif criterion == "month-of-year": 52 | return dt.month 53 | elif criterion == "season-of-year": 54 | season = {12: 1, 1: 1, 2: 1, 3: 2, 4: 2, 5: 2, 6: 3, 7: 3, 8: 3, 9: 4, 10: 4, 11: 4} 55 | return season[dt.month] 56 | else: 57 | raise InputValidationError("Unknown criterion {} in ref_group.".format(criterion)) 58 | 59 | 60 | # =========================================== 61 | def validate_measure_str(string): 62 | strings = ["median", "knn", "lof"] 63 | if string not in strings: 64 | raise InputValidationError("measure should be one of {}. Given measure = '{}'".format(strings, string)) 65 | 66 | 67 | def validate_int_higher(k, low): 68 | if not k > low: raise InputValidationError("The specified integer {} should be higher than {}".format(k, low)) 69 | 70 | 71 | def validate_list_not_empty(lst): 72 | if len(lst) == 0: 73 | raise InputValidationError("The list should not be empty") 74 | 75 | 76 | def validate_all_in_range(lst, bounds): 77 | low, up = bounds 78 | for v in lst: 79 | if not (low <= v <= up): 80 | raise InputValidationError("Values of the list should be in [{}, {}]".format(low, up)) 81 | 82 | 83 | def validate_is_fitted(is_fitted): 84 | if not is_fitted: 85 | raise NotFittedError("'fit' must be called before calling 'get'") 86 | 87 | 88 | def validate_reference_group(Xref): 89 | if len(Xref) == 0: 90 | raise NoRefGroupError("Empty reference group data.") 91 | 92 | 93 | def validate_reference_grouping_input(uid_test, dt, dffs): 94 | if not (0 <= uid_test < len(dffs)): 95 | raise InputValidationError("uid_test should be in range(nb_units). Given uid_test = {}, nb_units is {}".format(uid_test, len(dffs))) 96 | 97 | if len(dffs[uid_test]) == 0: 98 | raise TestUnitError("Test unit (uid={}) does not have data".format(uid_test)) 99 | 100 | try: 101 | x = dffs[uid_test].loc[dt].values 102 | except KeyError: 103 | raise TestUnitError("Test unit (uid={}) does not have data at time {}".format(uid_test, dt)) 104 | 105 | 106 | def validate_individual_deviation_params(w_martingale, non_conformity, k, dev_threshold, ref_group=None): 107 | if w_martingale < 1: 108 | raise InputValidationError("w_martingale should be an integer higher than 0. Given w_martingale = {}".format(w_martingale)) 109 | 110 | strings = ["median", "knn", "lof"] 111 | if non_conformity not in strings: 112 | raise InputValidationError("non_conformity should be one of {}. Given non_conformity = '{}'".format(strings, non_conformity)) 113 | 114 | if non_conformity == "knn": 115 | if k < 1: 116 | raise InputValidationError("k should be an integer higher than 0. Given k = {}".format(k)) 117 | 118 | if not (0 <= dev_threshold <= 1): 119 | raise InputValidationError("dev_threshold should be in [0, 1]. Given dev_threshold = {}".format(dev_threshold)) 120 | 121 | strings = ["hour-of-day", "day-of-week", "day-of-month", "week-of-year", "month-of-year", "season-of-year"] 122 | if (ref_group is not None) and (ref_group != "external") and (not isinstance(ref_group, (list, np.ndarray))) and (not callable(ref_group)): 123 | raise InputValidationError("ref_group should be either a list containing one or many of {}, or the string 'external', " 124 | "or a callable function(times, values, x)" 125 | "Given ref_group = '{}'".format(strings, ref_group)) 126 | 127 | 128 | def validate_fit_input(X): 129 | if len(X) == 0 or not isinstance(X, (list, np.ndarray)): 130 | raise InputValidationError("X must be a non empty array-like of shape (n_samples, n_features)") 131 | 132 | 133 | def validate_get_input(x): 134 | if len(x) == 0 or not isinstance(x,(list, np.ndarray)): 135 | raise InputValidationError("x must be a non empty array-like of shape (n_features,)") 136 | 137 | -------------------------------------------------------------------------------- /examples/notebooks/data/stationary-0.csv: -------------------------------------------------------------------------------- 1 | Date,Feature 0,Feature 1 2 | 1959-01-01,35,20.835501727036185 3 | 1959-01-02,32,19.059136975735985 4 | 1959-01-03,30,21.119310152135483 5 | 1959-01-04,31,12.945256185062945 6 | 1959-01-05,44,29.281085140461208 7 | 1959-01-06,29,17.45321366346135 8 | 1959-01-07,45,20.531653877371266 9 | 1959-01-08,43,20.680676080511795 10 | 1959-01-09,38,23.199382785214024 11 | 1959-01-10,27,17.644975468576767 12 | 1959-01-11,38,23.21922830859579 13 | 1959-01-12,33,32.33710493903455 14 | 1959-01-13,55,10.540954882560946 15 | 1959-01-14,47,16.754320964276936 16 | 1959-01-15,45,10.785633247233 17 | 1959-01-16,37,23.306189673382484 18 | 1959-01-17,50,12.828844902407344 19 | 1959-01-18,43,25.924371564907016 20 | 1959-01-19,41,16.944716500564997 21 | 1959-01-20,52,27.89036170504706 22 | 1959-01-21,34,25.75014348678772 23 | 1959-01-22,53,20.160255969403345 24 | 1959-01-23,39,17.12033110901343 25 | 1959-01-24,32,23.155316793608748 26 | 1959-01-25,37,20.209383632301144 27 | 1959-01-26,43,20.336227089807615 28 | 1959-01-27,39,12.332383871324874 29 | 1959-01-28,35,25.70012657734548 30 | 1959-01-29,44,8.930512194248983 31 | 1959-01-30,38,12.465519082807978 32 | 1959-01-31,24,12.54873293669382 33 | 1959-02-01,23,28.318253662479417 34 | 1959-02-02,31,17.477078859603985 35 | 1959-02-03,44,20.963917416519827 36 | 1959-02-04,38,19.91128131545577 37 | 1959-02-05,50,24.60664471317338 38 | 1959-02-06,38,16.77881754855514 39 | 1959-02-07,51,20.76869507720173 40 | 1959-02-08,31,22.1517447156965 41 | 1959-02-09,31,19.954139894137477 42 | 1959-02-10,51,25.018204085460923 43 | 1959-02-11,36,22.761924452091606 44 | 1959-02-12,45,19.76605503682941 45 | 1959-02-13,51,18.884957013328403 46 | 1959-02-14,34,16.855419046638975 47 | 1959-02-15,52,20.393931582271232 48 | 1959-02-16,47,12.583328194773145 49 | 1959-02-17,45,18.070677898164284 50 | 1959-02-18,46,18.86192200621991 51 | 1959-02-19,39,22.42671442179852 52 | 1959-02-20,48,21.193964522054483 53 | 1959-02-21,37,15.749335941405633 54 | 1959-02-22,35,28.296971860230848 55 | 1959-02-23,52,26.553632096086847 56 | 1959-02-24,42,17.886071075757698 57 | 1959-02-25,45,17.74320869870218 58 | 1959-02-26,39,9.270687972211181 59 | 1959-02-27,37,21.747178359576512 60 | 1959-02-28,30,13.698969492803844 61 | 1959-03-01,35,14.982288426683816 62 | 1959-03-02,28,18.13515671822819 63 | 1959-03-03,45,24.43433607497198 64 | 1959-03-04,34,23.328586638771526 65 | 1959-03-05,36,20.009666235093356 66 | 1959-03-06,50,12.200942503176329 67 | 1959-03-07,44,16.4855493989434 68 | 1959-03-08,39,13.119075789975575 69 | 1959-03-09,32,18.49135541316485 70 | 1959-03-10,39,14.761030428660765 71 | 1959-03-11,45,22.288310825393527 72 | 1959-03-12,43,24.110116948403345 73 | 1959-03-13,39,17.18622890088645 74 | 1959-03-14,31,21.026839206538753 75 | 1959-03-15,27,20.63103142578357 76 | 1959-03-16,30,16.970560206542846 77 | 1959-03-17,42,24.05463961973403 78 | 1959-03-18,46,24.005952394548533 79 | 1959-03-19,41,5.803449971630881 80 | 1959-03-20,36,18.334146210843738 81 | 1959-03-21,45,21.074652442785265 82 | 1959-03-22,46,16.15547134459422 83 | 1959-03-23,43,19.233431761824257 84 | 1959-03-24,38,21.398979774623562 85 | 1959-03-25,34,17.096428813827185 86 | 1959-03-26,35,16.21138079080529 87 | 1959-03-27,56,22.756598760203683 88 | 1959-03-28,36,15.819946631966022 89 | 1959-03-29,32,21.58372381657187 90 | 1959-03-30,50,26.361827940367146 91 | 1959-03-31,41,18.325917018202865 92 | 1959-04-01,39,13.393620804720085 93 | 1959-04-02,41,20.00489242620598 94 | 1959-04-03,47,26.22118359631925 95 | 1959-04-04,34,8.078725065326097 96 | 1959-04-05,36,12.77280295937107 97 | 1959-04-06,33,18.148873411090694 98 | 1959-04-07,35,18.897360245168393 99 | 1959-04-08,38,23.517445905732593 100 | 1959-04-09,38,23.24625309593858 101 | 1959-04-10,34,24.94499788185282 102 | 1959-04-11,53,18.264707279453386 103 | 1959-04-12,34,29.79729886645327 104 | 1959-04-13,34,22.494817757038778 105 | 1959-04-14,38,17.01048178667468 106 | 1959-04-15,35,18.12420157457012 107 | 1959-04-16,32,16.474608417238 108 | 1959-04-17,42,19.250785938847635 109 | 1959-04-18,34,15.893859921242274 110 | 1959-04-19,46,27.471111735671677 111 | 1959-04-20,30,24.418568845273136 112 | 1959-04-21,46,18.169713783767246 113 | 1959-04-22,45,15.176284820356162 114 | 1959-04-23,54,22.70978135043641 115 | 1959-04-24,34,15.874547201783466 116 | 1959-04-25,37,22.253724443414804 117 | 1959-04-26,35,26.417087134553476 118 | 1959-04-27,40,21.471787875919414 119 | 1959-04-28,42,20.116557779993922 120 | 1959-04-29,58,24.078008302743985 121 | 1959-04-30,51,17.16499190185516 122 | 1959-05-01,32,17.366599139080897 123 | 1959-05-02,35,23.848095300266024 124 | 1959-05-03,38,15.086086958742762 125 | 1959-05-04,33,23.918523244262808 126 | 1959-05-05,39,24.10223020169712 127 | 1959-05-06,47,20.460155096979765 128 | 1959-05-07,38,16.6065218909107 129 | 1959-05-08,52,22.78449082322308 130 | 1959-05-09,30,14.890075073324379 131 | 1959-05-10,34,15.866188209898723 132 | 1959-05-11,40,30.17387210585521 133 | 1959-05-12,35,15.883832919706652 134 | 1959-05-13,42,25.275406696876402 135 | 1959-05-14,41,21.561501247314858 136 | 1959-05-15,42,22.613726218818318 137 | 1959-05-16,38,19.30409682906272 138 | 1959-05-17,24,14.784491960655984 139 | 1959-05-18,34,21.419481420734897 140 | 1959-05-19,43,14.885349055849467 141 | 1959-05-20,36,14.835018404500868 142 | 1959-05-21,55,21.01666479983712 143 | 1959-05-22,41,13.441062295204329 144 | 1959-05-23,45,17.786513932673103 145 | 1959-05-24,41,24.500433322436415 146 | 1959-05-25,37,21.061510596284087 147 | 1959-05-26,43,18.379120869326307 148 | 1959-05-27,39,14.38762950498131 149 | 1959-05-28,33,16.727794888500767 150 | 1959-05-29,43,13.316976546663858 151 | 1959-05-30,40,24.555224079476798 152 | 1959-05-31,38,22.454251641249765 153 | 1959-06-01,45,7.586989891564864 154 | 1959-06-02,46,26.110820107918386 155 | 1959-06-03,34,14.977369459161345 156 | 1959-06-04,35,17.757486247988894 157 | 1959-06-05,48,24.103740286404207 158 | 1959-06-06,51,22.448223586976994 159 | 1959-06-07,36,25.272571300099088 160 | 1959-06-08,33,24.398244953683932 161 | 1959-06-09,46,23.650274990975912 162 | 1959-06-10,42,19.795524589133464 163 | 1959-06-11,48,10.731441559419684 164 | 1959-06-12,34,15.115657077033264 165 | 1959-06-13,41,17.220402972549536 166 | 1959-06-14,35,14.44593185316925 167 | 1959-06-15,40,20.69223679238351 168 | 1959-06-16,34,14.998869461823674 169 | 1959-06-17,30,25.009850553952635 170 | 1959-06-18,36,18.815867048588665 171 | 1959-06-19,40,19.792248234882646 172 | 1959-06-20,39,14.747612172429674 173 | 1959-06-21,45,22.094170796178773 174 | 1959-06-22,38,24.080753729339975 175 | 1959-06-23,47,18.352701249187476 176 | 1959-06-24,33,11.312967701602478 177 | 1959-06-25,30,23.302149570815672 178 | 1959-06-26,42,20.894940196192664 179 | 1959-06-27,43,14.12207319273545 180 | 1959-06-28,41,23.42097068006357 181 | 1959-06-29,41,23.59368618305812 182 | 1959-06-30,59,26.19484474335951 183 | 1959-07-01,43,22.303512041340607 184 | 1959-07-02,45,22.270575021516173 185 | 1959-07-03,38,13.379290806114724 186 | 1959-07-04,37,22.20815697171935 187 | 1959-07-05,45,17.66129702665004 188 | 1959-07-06,42,13.607186156272842 189 | 1959-07-07,57,23.72236889495042 190 | 1959-07-08,46,27.215737433767167 191 | 1959-07-09,51,17.13694339078769 192 | 1959-07-10,41,15.80185710762399 193 | 1959-07-11,47,25.186891803273824 194 | 1959-07-12,26,16.08932510026946 195 | 1959-07-13,35,20.051179484625095 196 | 1959-07-14,44,12.747366290910367 197 | 1959-07-15,41,22.85577073654874 198 | 1959-07-16,42,32.63558677186806 199 | 1959-07-17,36,29.240971560607555 200 | 1959-07-18,45,24.319359951168313 201 | 1959-07-19,45,24.36952414949859 202 | 1959-07-20,45,26.426693696092805 203 | 1959-07-21,47,22.35104885688846 204 | 1959-07-22,38,16.47235454478513 205 | 1959-07-23,42,14.573109359811255 206 | 1959-07-24,35,22.822475466606836 207 | 1959-07-25,36,16.724372935329026 208 | 1959-07-26,39,21.02160015519355 209 | 1959-07-27,45,14.801562114707956 210 | 1959-07-28,43,25.838414533837703 211 | 1959-07-29,47,10.452152527622271 212 | 1959-07-30,36,19.34299657748936 213 | 1959-07-31,41,18.754720324817352 214 | 1959-08-01,50,12.929518540414941 215 | 1959-08-02,39,29.624848496652845 216 | 1959-08-03,41,19.50707238272979 217 | 1959-08-04,46,18.282926497013456 218 | 1959-08-05,64,16.150602725563463 219 | 1959-08-06,45,22.98384676349622 220 | 1959-08-07,34,21.636350914354423 221 | 1959-08-08,38,8.206120602686317 222 | -------------------------------------------------------------------------------- /examples/notebooks/data/stationary-1.csv: -------------------------------------------------------------------------------- 1 | Date,Feature 0,Feature 1 2 | 1959-01-01,35,20.835501727036185 3 | 1959-01-02,32,19.059136975735985 4 | 1959-01-03,30,21.119310152135483 5 | 1959-01-04,31,12.945256185062945 6 | 1959-01-05,44,29.281085140461208 7 | 1959-01-06,29,17.45321366346135 8 | 1959-01-07,45,20.531653877371266 9 | 1959-01-08,43,20.680676080511795 10 | 1959-01-09,38,23.199382785214024 11 | 1959-01-10,27,17.644975468576767 12 | 1959-01-11,38,23.21922830859579 13 | 1959-01-12,33,32.33710493903455 14 | 1959-01-13,55,10.540954882560946 15 | 1959-01-14,47,16.754320964276936 16 | 1959-01-15,45,10.785633247233 17 | 1959-01-16,37,23.306189673382484 18 | 1959-01-17,50,12.828844902407344 19 | 1959-01-18,43,25.924371564907016 20 | 1959-01-19,41,16.944716500564997 21 | 1959-01-20,52,27.89036170504706 22 | 1959-01-21,34,25.75014348678772 23 | 1959-01-22,53,20.160255969403345 24 | 1959-01-23,39,17.12033110901343 25 | 1959-01-24,32,23.155316793608748 26 | 1959-01-25,37,20.209383632301144 27 | 1959-01-26,43,20.336227089807615 28 | 1959-01-27,39,12.332383871324874 29 | 1959-01-28,35,25.70012657734548 30 | 1959-01-29,44,8.930512194248983 31 | 1959-01-30,38,12.465519082807978 32 | 1959-01-31,24,12.54873293669382 33 | 1959-02-01,23,28.318253662479417 34 | 1959-02-02,31,17.477078859603985 35 | 1959-02-03,44,20.963917416519827 36 | 1959-02-04,38,19.91128131545577 37 | 1959-02-05,50,24.60664471317338 38 | 1959-02-06,38,16.77881754855514 39 | 1959-02-07,51,20.76869507720173 40 | 1959-02-08,31,22.1517447156965 41 | 1959-02-09,31,19.954139894137477 42 | 1959-02-10,51,25.018204085460923 43 | 1959-02-11,36,22.761924452091606 44 | 1959-02-12,45,19.76605503682941 45 | 1959-02-13,51,18.884957013328403 46 | 1959-02-14,34,16.855419046638975 47 | 1959-02-15,52,20.393931582271232 48 | 1959-02-16,47,12.583328194773145 49 | 1959-02-17,45,18.070677898164284 50 | 1959-02-18,46,18.86192200621991 51 | 1959-02-19,39,22.42671442179852 52 | 1959-02-20,48,21.193964522054483 53 | 1959-02-21,37,15.749335941405633 54 | 1959-02-22,35,28.296971860230848 55 | 1959-02-23,52,26.553632096086847 56 | 1959-02-24,42,17.886071075757698 57 | 1959-02-25,45,17.74320869870218 58 | 1959-02-26,39,9.270687972211181 59 | 1959-02-27,37,21.747178359576512 60 | 1959-02-28,30,13.698969492803844 61 | 1959-03-01,35,14.982288426683816 62 | 1959-03-02,28,18.13515671822819 63 | 1959-03-03,45,24.43433607497198 64 | 1959-03-04,34,23.328586638771526 65 | 1959-03-05,36,20.009666235093356 66 | 1959-03-06,50,12.200942503176329 67 | 1959-03-07,44,16.4855493989434 68 | 1959-03-08,39,13.119075789975575 69 | 1959-03-09,32,18.49135541316485 70 | 1959-03-10,39,14.761030428660765 71 | 1959-03-11,45,22.288310825393527 72 | 1959-03-12,43,24.110116948403345 73 | 1959-03-13,39,17.18622890088645 74 | 1959-03-14,31,21.026839206538753 75 | 1959-03-15,27,20.63103142578357 76 | 1959-03-16,30,16.970560206542846 77 | 1959-03-17,42,24.05463961973403 78 | 1959-03-18,46,24.005952394548533 79 | 1959-03-19,41,5.803449971630881 80 | 1959-03-20,36,18.334146210843738 81 | 1959-03-21,45,21.074652442785265 82 | 1959-03-22,46,16.15547134459422 83 | 1959-03-23,43,19.233431761824257 84 | 1959-03-24,38,21.398979774623562 85 | 1959-03-25,34,17.096428813827185 86 | 1959-03-26,35,16.21138079080529 87 | 1959-03-27,56,22.756598760203683 88 | 1959-03-28,36,15.819946631966022 89 | 1959-03-29,32,21.58372381657187 90 | 1959-03-30,50,26.361827940367146 91 | 1959-03-31,41,18.325917018202865 92 | 1959-04-01,39,13.393620804720085 93 | 1959-04-02,41,20.00489242620598 94 | 1959-04-03,47,26.22118359631925 95 | 1959-04-04,34,8.078725065326097 96 | 1959-04-05,36,12.77280295937107 97 | 1959-04-06,33,18.148873411090694 98 | 1959-04-07,35,18.897360245168393 99 | 1959-04-08,38,23.517445905732593 100 | 1959-04-09,38,23.24625309593858 101 | 1959-04-10,34,24.94499788185282 102 | 1959-04-11,53,18.264707279453386 103 | 1959-04-12,34,29.79729886645327 104 | 1959-04-13,34,22.494817757038778 105 | 1959-04-14,38,17.01048178667468 106 | 1959-04-15,35,18.12420157457012 107 | 1959-04-16,32,16.474608417238 108 | 1959-04-17,42,19.250785938847635 109 | 1959-04-18,34,15.893859921242274 110 | 1959-04-19,46,27.471111735671677 111 | 1959-04-20,30,24.418568845273136 112 | 1959-04-21,46,18.169713783767246 113 | 1959-04-22,45,15.176284820356162 114 | 1959-04-23,54,22.70978135043641 115 | 1959-04-24,34,15.874547201783466 116 | 1959-04-25,37,22.253724443414804 117 | 1959-04-26,35,26.417087134553476 118 | 1959-04-27,40,21.471787875919414 119 | 1959-04-28,42,20.116557779993922 120 | 1959-04-29,58,24.078008302743985 121 | 1959-04-30,51,17.16499190185516 122 | 1959-05-01,32,17.366599139080897 123 | 1959-05-02,35,23.848095300266024 124 | 1959-05-03,38,15.086086958742762 125 | 1959-05-04,33,23.918523244262808 126 | 1959-05-05,39,24.10223020169712 127 | 1959-05-06,47,20.460155096979765 128 | 1959-05-07,38,16.6065218909107 129 | 1959-05-08,52,22.78449082322308 130 | 1959-05-09,30,14.890075073324379 131 | 1959-05-10,34,15.866188209898723 132 | 1959-05-11,40,30.17387210585521 133 | 1959-05-12,35,15.883832919706652 134 | 1959-05-13,42,25.275406696876402 135 | 1959-05-14,41,21.561501247314858 136 | 1959-05-15,42,22.613726218818318 137 | 1959-05-16,38,19.30409682906272 138 | 1959-05-17,24,14.784491960655984 139 | 1959-05-18,34,21.419481420734897 140 | 1959-05-19,43,14.885349055849467 141 | 1959-05-20,36,14.835018404500868 142 | 1959-05-21,55,21.01666479983712 143 | 1959-05-22,41,13.441062295204329 144 | 1959-05-23,45,17.786513932673103 145 | 1959-05-24,41,24.500433322436415 146 | 1959-05-25,37,21.061510596284087 147 | 1959-05-26,43,18.379120869326307 148 | 1959-05-27,39,14.38762950498131 149 | 1959-05-28,33,16.727794888500767 150 | 1959-05-29,43,13.316976546663858 151 | 1959-05-30,40,24.555224079476798 152 | 1959-05-31,38,22.454251641249765 153 | 1959-06-01,45,7.586989891564864 154 | 1959-06-02,46,26.110820107918386 155 | 1959-06-03,34,14.977369459161345 156 | 1959-06-04,35,17.757486247988894 157 | 1959-06-05,48,24.103740286404207 158 | 1959-06-06,51,22.448223586976994 159 | 1959-06-07,36,25.272571300099088 160 | 1959-06-08,33,24.398244953683932 161 | 1959-06-09,46,23.650274990975912 162 | 1959-06-10,42,19.795524589133464 163 | 1959-06-11,48,10.731441559419684 164 | 1959-06-12,34,15.115657077033264 165 | 1959-06-13,41,17.220402972549536 166 | 1959-06-14,35,14.44593185316925 167 | 1959-06-15,40,20.69223679238351 168 | 1959-06-16,34,14.998869461823674 169 | 1959-06-17,30,25.009850553952635 170 | 1959-06-18,36,18.815867048588665 171 | 1959-06-19,40,19.792248234882646 172 | 1959-06-20,39,14.747612172429674 173 | 1959-06-21,45,22.094170796178773 174 | 1959-06-22,38,24.080753729339975 175 | 1959-06-23,47,18.352701249187476 176 | 1959-06-24,33,11.312967701602478 177 | 1959-06-25,30,23.302149570815672 178 | 1959-06-26,42,20.894940196192664 179 | 1959-06-27,43,14.12207319273545 180 | 1959-06-28,41,23.42097068006357 181 | 1959-06-29,41,23.59368618305812 182 | 1959-06-30,59,26.19484474335951 183 | 1959-07-01,43,22.303512041340607 184 | 1959-07-02,45,22.270575021516173 185 | 1959-07-03,38,13.379290806114724 186 | 1959-07-04,37,22.20815697171935 187 | 1959-07-05,45,17.66129702665004 188 | 1959-07-06,42,13.607186156272842 189 | 1959-07-07,57,23.72236889495042 190 | 1959-07-08,46,27.215737433767167 191 | 1959-07-09,51,17.13694339078769 192 | 1959-07-10,41,15.80185710762399 193 | 1959-07-11,47,25.186891803273824 194 | 1959-07-12,26,16.08932510026946 195 | 1959-07-13,35,20.051179484625095 196 | 1959-07-14,44,12.747366290910367 197 | 1959-07-15,41,22.85577073654874 198 | 1959-07-16,42,32.63558677186806 199 | 1959-07-17,36,29.240971560607555 200 | 1959-07-18,45,24.319359951168313 201 | 1959-07-19,45,24.36952414949859 202 | 1959-07-20,45,26.426693696092805 203 | 1959-07-21,47,22.35104885688846 204 | 1959-07-22,38,16.47235454478513 205 | 1959-07-23,42,14.573109359811255 206 | 1959-07-24,35,22.822475466606836 207 | 1959-07-25,36,16.724372935329026 208 | 1959-07-26,39,21.02160015519355 209 | 1959-07-27,45,14.801562114707956 210 | 1959-07-28,43,25.838414533837703 211 | 1959-07-29,47,10.452152527622271 212 | 1959-07-30,36,19.34299657748936 213 | 1959-07-31,41,18.754720324817352 214 | 1959-08-01,50,12.929518540414941 215 | 1959-08-02,39,29.624848496652845 216 | 1959-08-03,41,19.50707238272979 217 | 1959-08-04,46,18.282926497013456 218 | 1959-08-05,64,16.150602725563463 219 | 1959-08-06,45,22.98384676349622 220 | 1959-08-07,34,21.636350914354423 221 | 1959-08-08,38,8.206120602686317 222 | 1959-08-09,44,18.477694840511674 223 | 1959-08-10,48,15.841656404674694 224 | 1959-08-11,46,15.401510709372294 225 | 1959-08-12,44,8.362083168573982 226 | 1959-08-13,37,9.451395269850476 227 | 1959-08-14,39,19.185551786389862 228 | 1959-08-15,44,18.15685475089071 229 | 1959-08-16,45,9.978769793034878 230 | 1959-08-17,33,8.594527677755437 231 | 1959-08-18,44,15.135013497254398 232 | 1959-08-19,38,6.65426929999982 233 | 1959-08-20,46,15.345275579777205 234 | 1959-08-21,46,11.689680173772413 235 | 1959-08-22,40,13.160442579909557 236 | 1959-08-23,39,23.422853186308146 237 | 1959-08-24,44,2.457149976562076 238 | 1959-08-25,48,6.438791430160158 239 | 1959-08-26,50,13.548008372008063 240 | 1959-08-27,41,13.353094048526094 241 | 1959-08-28,42,22.337239459361534 242 | 1959-08-29,51,11.380884375132595 243 | 1959-08-30,41,18.52435283032382 244 | 1959-08-31,44,1.7728169670059408 245 | 1959-09-01,38,9.324982954106897 246 | 1959-09-02,68,4.411868987212607 247 | 1959-09-03,40,9.204214476552007 248 | 1959-09-04,42,7.547235361156281 249 | 1959-09-05,51,13.154035339369248 250 | 1959-09-06,44,21.35085718613378 251 | 1959-09-07,45,4.3186740636421055 252 | 1959-09-08,36,9.439539787320497 253 | 1959-09-09,57,0.1371299536188788 254 | 1959-09-10,44,10.68138861226554 255 | 1959-09-11,42,13.069854982078233 256 | 1959-09-12,53,7.188361121801117 257 | 1959-09-13,42,4.313989062805451 258 | 1959-09-14,34,0.2313644328278368 259 | 1959-09-15,40,9.039993512095311 260 | 1959-09-16,56,2.6611002268439545 261 | 1959-09-17,44,3.358913384278374 262 | 1959-09-18,53,10.110185450881193 263 | 1959-09-19,55,9.246644823425747 264 | 1959-09-20,39,-1.9094228650826537 265 | 1959-09-21,59,6.825724261181598 266 | 1959-09-22,55,2.7010522508634587 267 | 1959-09-23,73,4.113849411321802 268 | 1959-09-24,55,10.400983430521405 269 | 1959-09-25,44,4.547351600849156 270 | 1959-09-26,43,11.013092596255913 271 | 1959-09-27,40,5.959441557785284 272 | 1959-09-28,47,10.965799090159527 273 | 1959-09-29,51,10.729927517469218 274 | 1959-09-30,56,5.033922347244724 275 | 1959-10-01,49,11.067383854565126 276 | 1959-10-02,54,7.991942955263889 277 | 1959-10-03,56,3.731181054383444 278 | 1959-10-04,47,9.60849204948153 279 | 1959-10-05,44,5.436376615746947 280 | 1959-10-06,43,10.403980076356627 281 | 1959-10-07,42,8.836794933266088 282 | 1959-10-08,45,7.940394946568858 283 | 1959-10-09,50,23.567661642445497 284 | 1959-10-10,48,14.81649308474506 285 | 1959-10-11,43,8.687688025095138 286 | 1959-10-12,40,3.2882923916551423 287 | 1959-10-13,59,11.423203849179803 288 | 1959-10-14,41,18.409464328260796 289 | 1959-10-15,42,6.410814721879816 290 | 1959-10-16,51,15.373182383063028 291 | 1959-10-17,49,19.670907062071112 292 | 1959-10-18,45,18.3370995037562 293 | 1959-10-19,43,17.89103172455656 294 | 1959-10-20,42,24.21485164425647 295 | 1959-10-21,38,13.522628096252465 296 | 1959-10-22,47,14.95654145487521 297 | 1959-10-23,38,6.489404554597201 298 | 1959-10-24,36,22.296867216858825 299 | 1959-10-25,42,13.332329969459654 300 | 1959-10-26,35,18.92324692746712 301 | 1959-10-27,28,17.330560302285207 302 | 1959-10-28,44,27.44072675278098 303 | 1959-10-29,36,26.0151823780754 304 | 1959-10-30,45,28.795546314342438 305 | 1959-10-31,46,17.812249784621585 306 | 1959-11-01,48,15.033542025232439 307 | 1959-11-02,49,22.267337471447867 308 | 1959-11-03,43,15.357449494914375 309 | 1959-11-04,42,9.643615197290227 310 | 1959-11-05,59,23.167328249047852 311 | 1959-11-06,45,8.150711943827837 312 | 1959-11-07,52,19.56682188423375 313 | 1959-11-08,46,18.85283597805902 314 | 1959-11-09,42,21.47908410276248 315 | 1959-11-10,40,29.832367759209653 316 | 1959-11-11,40,10.945042257184081 317 | 1959-11-12,45,21.52961001918512 318 | 1959-11-13,35,22.901294946745253 319 | 1959-11-14,35,24.80910754087445 320 | 1959-11-15,40,18.110657626535087 321 | 1959-11-16,39,20.63667418706687 322 | 1959-11-17,33,19.28194918569956 323 | 1959-11-18,42,13.439096842005121 324 | 1959-11-19,47,20.733219587347286 325 | 1959-11-20,51,22.03982666851866 326 | 1959-11-21,44,24.436059277141005 327 | 1959-11-22,40,21.161869157797412 328 | 1959-11-23,57,6.065335222735346 329 | 1959-11-24,49,23.33703409664802 330 | 1959-11-25,45,13.093323926256645 331 | 1959-11-26,49,23.246490799816865 332 | 1959-11-27,51,9.245937065251436 333 | 1959-11-28,46,24.89841530595614 334 | 1959-11-29,44,15.699361440585887 335 | 1959-11-30,52,23.32960056489824 336 | 1959-12-01,45,26.112262290194145 337 | 1959-12-02,32,22.602370029034383 338 | 1959-12-03,46,18.690399516936125 339 | 1959-12-04,41,20.296506776192782 340 | 1959-12-05,34,21.41441735242775 341 | 1959-12-06,33,22.808001690397656 342 | 1959-12-07,36,19.870001775963726 343 | 1959-12-08,49,16.681689282962463 344 | 1959-12-09,43,23.3577428841644 345 | 1959-12-10,43,21.809747379508966 346 | 1959-12-11,34,23.364904340708787 347 | 1959-12-12,39,13.86468086136473 348 | 1959-12-13,35,22.653689381503753 349 | 1959-12-14,52,22.264954470444273 350 | 1959-12-15,47,16.205839097009335 351 | 1959-12-16,52,16.57805401880027 352 | 1959-12-17,39,14.163965261080396 353 | 1959-12-18,40,17.10101117992792 354 | 1959-12-19,42,17.955041475896067 355 | 1959-12-20,42,9.9620479209517 356 | 1959-12-21,53,15.94374880960628 357 | 1959-12-22,39,31.53343285693175 358 | 1959-12-23,40,20.58164057317812 359 | 1959-12-24,38,15.967818084255073 360 | 1959-12-25,44,24.954509056234098 361 | 1959-12-26,34,14.055442399138535 362 | 1959-12-27,37,14.147027262903713 363 | 1959-12-28,52,27.04020048372552 364 | 1959-12-29,48,23.62485931531552 365 | 1959-12-30,55,18.22520036207125 366 | 1959-12-31,50,22.33373484768547 367 | -------------------------------------------------------------------------------- /grand/individual_anomaly/individual_anomaly_inductive.py: -------------------------------------------------------------------------------- 1 | """An inductive anomaly detection model for an individual system. 2 | To detect anomalies, the IndividualAnomalyInductive model compares the data from 3 | a system against a fixed reference dataset. 4 | """ 5 | 6 | __author__ = "Mohamed-Rafik Bouguelia" 7 | __license__ = "MIT" 8 | __email__ = "mohamed-rafik.bouguelia@hh.se" 9 | 10 | from grand.conformal import get_strangeness 11 | from grand.utils import DeviationContext, append_to_df 12 | from grand import utils 13 | import matplotlib.pylab as plt, pandas as pd, numpy as np 14 | from pandas.plotting import register_matplotlib_converters 15 | 16 | 17 | class IndividualAnomalyInductive: 18 | '''Deviation detection for a single/individual unit 19 | 20 | Parameters: 21 | ---------- 22 | w_martingale : int 23 | Window used to compute the deviation level based on the last w_martingale samples. 24 | 25 | non_conformity : string 26 | Strangeness (or non-conformity) measure used to compute the deviation level. 27 | It must be either "median" or "knn" 28 | 29 | k : int 30 | Parameter used for k-nearest neighbours, when non_conformity is set to "knn" 31 | 32 | dev_threshold : float 33 | Threshold in [0,1] on the deviation level 34 | ''' 35 | 36 | def __init__(self, w_martingale=15, non_conformity="median", k=20, dev_threshold=0.6, columns=None): 37 | utils.validate_individual_deviation_params(w_martingale, non_conformity, k, dev_threshold) 38 | 39 | self.w_martingale = w_martingale 40 | self.non_conformity = non_conformity 41 | self.k = k 42 | self.dev_threshold = dev_threshold 43 | self.columns = columns 44 | 45 | self.strg = get_strangeness(non_conformity, k) 46 | self.T, self.S, self.P, self.M = [], [], [], [] 47 | self.representatives, self.diffs = [], [] 48 | 49 | self.mart = 0 50 | self.marts = [0, 0, 0] 51 | 52 | self.df = pd.DataFrame(data=[], index=[]) 53 | 54 | # =========================================== 55 | def fit(self, X): 56 | '''Fit the anomaly detector to the data X (assumed to be normal) 57 | Parameters: 58 | ----------- 59 | X : array-like, shape (n_samples, n_features) 60 | Samples assumed to be not deviating from normal 61 | 62 | Returns: 63 | -------- 64 | self : object 65 | ''' 66 | 67 | self.strg.fit(X) 68 | return self 69 | 70 | # =========================================== 71 | def predict(self, dtime, x): 72 | '''Update the deviation level based on the new test sample x 73 | 74 | Parameters: 75 | ----------- 76 | dtime : datetime 77 | datetime corresponding to the sample x 78 | 79 | x : array-like, shape (n_features,) 80 | Sample for which the strangeness, p-value and deviation level are computed 81 | 82 | Returns: 83 | -------- 84 | strangeness : float 85 | Strangeness of x with respect to samples in Xref 86 | 87 | pval : float, in [0, 1] 88 | p-value that represents the proportion of samples in Xref that are stranger than x. 89 | 90 | deviation : float, in [0, 1] 91 | Normalized deviation level updated based on the last w_martingale steps 92 | ''' 93 | 94 | self.T.append(dtime) 95 | self.df = append_to_df(self.df, dtime, x) 96 | 97 | strangeness, diff, representative = self.strg.predict(x) 98 | self.S.append(strangeness) 99 | self.diffs.append(diff) 100 | self.representatives.append(representative) 101 | 102 | pval = self.strg.pvalue(strangeness) 103 | self.P.append(pval) 104 | 105 | deviation = self._update_martingale(pval) 106 | self.M.append(deviation) 107 | 108 | is_deviating = deviation > self.dev_threshold 109 | return DeviationContext(strangeness, pval, deviation, is_deviating) 110 | 111 | # =========================================== 112 | def _update_martingale(self, pval): 113 | '''Incremental additive martingale over the last w_martingale steps. 114 | 115 | Parameters: 116 | ----------- 117 | pval : int, in [0, 1] 118 | The most recent p-value 119 | 120 | Returns: 121 | -------- 122 | normalized_one_sided_mart : float, in [0, 1] 123 | Deviation level. A normalized version of the current martingale value. 124 | ''' 125 | 126 | betting = lambda p: -p + .5 127 | 128 | self.mart += betting(pval) 129 | self.marts.append(self.mart) 130 | 131 | w = min(self.w_martingale, len(self.marts)) 132 | mat_in_window = self.mart - self.marts[-w] 133 | 134 | normalized_mart = ( mat_in_window ) / (.5 * w) 135 | normalized_one_sided_mart = max(normalized_mart, 0) 136 | return normalized_one_sided_mart 137 | 138 | # =========================================== 139 | def get_stats(self): 140 | stats = np.array([self.S, self.M, self.P]).T 141 | return pd.DataFrame(index=self.T, data=stats, columns=["strangeness", "deviation", "pvalue"]) 142 | 143 | # =========================================== 144 | def get_all_deviations(self, min_len=5, dev_threshold=None): 145 | if dev_threshold is None: dev_threshold = self.dev_threshold 146 | 147 | arr = np.arange(len(self.M)) 148 | boo = np.array(self.M) > dev_threshold 149 | indices = np.nonzero(boo[1:] != boo[:-1])[0] + 1 150 | groups_ids = np.split(arr, indices) 151 | groups_ids = groups_ids[0::2] if boo[0] else groups_ids[1::2] 152 | 153 | diffs_df = pd.DataFrame(index=self.T, data=self.diffs) 154 | sub_diffs_dfs = [diffs_df.iloc[ids, :] for ids in groups_ids if len(ids) >= min_len] 155 | 156 | dev_signatures = [np.mean(sub_diffs_df.values, axis=0) for sub_diffs_df in sub_diffs_dfs] 157 | periods = [(sub_diffs_df.index[0], sub_diffs_df.index[-1]) for sub_diffs_df in sub_diffs_dfs] 158 | 159 | deviations = [(devsig, p_from, p_to) for (devsig, (p_from, p_to)) in zip(dev_signatures, periods)] 160 | return deviations 161 | 162 | # =========================================== 163 | def get_deviation_signature(self, from_time, to_time): 164 | sub_diffs_df = pd.DataFrame(index=self.T, data=self.diffs)[from_time: to_time] 165 | deviation_signature = np.mean(sub_diffs_df.values, axis=0) 166 | return deviation_signature 167 | 168 | # =========================================== 169 | def get_similar_deviations(self, from_time, to_time, k_devs=2, min_len=5, dev_threshold=None): 170 | target_devsig = self.get_deviation_signature(from_time, to_time) 171 | deviations = self.get_all_deviations(min_len, dev_threshold) 172 | dists = [np.linalg.norm(target_devsig - devsig) for (devsig, *_) in deviations] 173 | ids = np.argsort(dists)[:k_devs] 174 | return [deviations[id] for id in ids] 175 | 176 | # =========================================== 177 | def plot_deviations(self, figsize=None, savefig=None, plots=["data", "strangeness", "pvalue", "deviation", "threshold"], debug=False): 178 | '''Plots the anomaly score, deviation level and p-value, over time.''' 179 | 180 | register_matplotlib_converters() 181 | 182 | plots, nb_axs, i = list(set(plots)), 0, 0 183 | if "data" in plots: 184 | nb_axs += 1 185 | if "strangeness" in plots: 186 | nb_axs += 1 187 | if any(s in ["pvalue", "deviation", "threshold"] for s in plots): 188 | nb_axs += 1 189 | 190 | fig, axes = plt.subplots(nb_axs, sharex="row", figsize=figsize) 191 | if not isinstance(axes, (np.ndarray) ): 192 | axes = np.array([axes]) 193 | 194 | if "data" in plots: 195 | axes[i].set_xlabel("Time") 196 | axes[i].set_ylabel("Feature 0") 197 | axes[i].plot(self.df.index, self.df.values[:, 0], label="Data") 198 | if debug: 199 | axes[i].plot(self.T, np.array(self.representatives)[:, 0], label="Reference") 200 | axes[i].legend() 201 | i += 1 202 | 203 | if "strangeness" in plots: 204 | axes[i].set_xlabel("Time") 205 | axes[i].set_ylabel("Strangeness") 206 | axes[i].plot(self.T, self.S, label="Strangeness") 207 | if debug: 208 | axes[i].plot(self.T, np.array(self.diffs)[:, 0], label="Difference") 209 | axes[i].legend() 210 | i += 1 211 | 212 | if any(s in ["pvalue", "deviation", "threshold"] for s in plots): 213 | axes[i].set_xlabel("Time") 214 | axes[i].set_ylabel("Deviation") 215 | axes[i].set_ylim(0, 1) 216 | if "pvalue" in plots: 217 | axes[i].scatter(self.T, self.P, alpha=0.25, marker=".", color="green", label="p-value") 218 | if "deviation" in plots: 219 | axes[i].plot(self.T, self.M, label="Deviation") 220 | if "threshold" in plots: 221 | axes[i].axhline(y=self.dev_threshold, color='r', linestyle='--', label="Threshold") 222 | axes[i].legend() 223 | 224 | fig.autofmt_xdate() 225 | 226 | if savefig is None: 227 | plt.draw() 228 | plt.show() 229 | else: 230 | figpathname = utils.create_directory_from_path(savefig) 231 | plt.savefig(figpathname) 232 | 233 | # =========================================== 234 | def plot_explanations(self, from_time, to_time, figsize=None, savefig=None, k_features=4): 235 | # TODO: validate if the period (from_time, to_time) has data before plotting 236 | 237 | from_time_pad = from_time - (to_time - from_time) 238 | to_time_pad = to_time + (to_time - from_time) 239 | 240 | sub_df = self.df[from_time: to_time] 241 | sub_df_before = self.df[from_time_pad: from_time] 242 | sub_df_after = self.df[to_time: to_time_pad] 243 | 244 | sub_representatives_df_pad = pd.DataFrame(index=self.T, data=self.representatives)[from_time_pad: to_time_pad] 245 | sub_diffs_df = pd.DataFrame(index=self.T, data=self.diffs)[from_time: to_time] 246 | 247 | nb_features = sub_diffs_df.values.shape[1] 248 | if (self.columns is None) or (len(self.columns) != nb_features): 249 | self.columns = ["Feature {}".format(j) for j in range(nb_features)] 250 | self.columns = np.array(self.columns) 251 | 252 | features_scores = np.array([np.abs(col).mean() for col in sub_diffs_df.values.T]) 253 | features_scores = 100 * features_scores / features_scores.sum() 254 | k_features = min(k_features, nb_features) 255 | selected_features_ids = np.argsort(features_scores)[-k_features:][::-1] 256 | selected_features_names = self.columns[selected_features_ids] 257 | selected_features_scores = features_scores[selected_features_ids] 258 | 259 | fig, axs = plt.subplots(k_features, figsize=figsize) 260 | fig.autofmt_xdate() 261 | fig.suptitle("Ranked features\nFrom {} to {}".format(from_time, to_time)) 262 | if k_features == 1 or not isinstance(axs, (np.ndarray) ): 263 | axs = np.array([axs]) 264 | 265 | for i, (j, name, score) in enumerate(zip(selected_features_ids, selected_features_names, selected_features_scores)): 266 | print("{0}, score: {1:.2f}%".format(name, score)) 267 | axs[i].set_xlabel("Time") 268 | axs[i].set_ylabel("{0}\n(Score: {1:.1f})".format(name, score)) 269 | axs[i].plot(sub_representatives_df_pad.index, sub_representatives_df_pad.values[:, j], color="grey", linestyle='--') 270 | axs[i].plot(sub_df_before.index, sub_df_before.values[:, j], color="green") 271 | axs[i].plot(sub_df_after.index, sub_df_after.values[:, j], color="lime") 272 | axs[i].plot(sub_df.index, sub_df.values[:, j], color="red") 273 | 274 | figg = None 275 | if k_features > 1: 276 | figg, ax1 = plt.subplots(figsize=figsize) 277 | figg.suptitle("Top 2 ranked features\nFrom {} to {}".format(from_time, to_time)) 278 | (j1, j2) , (nm1, nm2), (s1, s2) = selected_features_ids[:2], selected_features_names[:2], selected_features_scores[:2] 279 | 280 | ax1.set_xlabel("{0}\n(Score: {1:.1f})".format(nm1, s1)) 281 | ax1.set_ylabel("{0}\n(Score: {1:.1f})".format(nm2, s2)) 282 | 283 | self.strg.X = np.array(self.strg.X) 284 | ax1.scatter(self.strg.X[:, j1], self.strg.X[:, j2], color="silver", marker=".", label="Reference Data") 285 | ax1.scatter(sub_df_before.values[:, j1], sub_df_before.values[:, j2], color="green", marker=".", label="Before Selected Period") 286 | ax1.scatter(sub_df_after.values[:, j1], sub_df_after.values[:, j2], color="lime", marker=".", label="After Selected Period") 287 | ax1.scatter(sub_df.values[:, j1], sub_df.values[:, j2], color="red", marker=".", label="Selected Period") 288 | ax1.legend() 289 | 290 | if savefig is None: 291 | plt.show() 292 | else: 293 | figpathname = utils.create_directory_from_path(savefig) 294 | fig.savefig(figpathname) 295 | if figg is not None: figg.savefig(figpathname + "_2.png") 296 | -------------------------------------------------------------------------------- /grand/group_anomaly/group_anomaly.py: -------------------------------------------------------------------------------- 1 | """A group-based anomaly detection model (for a group of systems). 2 | To detect anomalies, the GroupAnomaly model compares the data from each 3 | target system against a group of other similar systems. 4 | """ 5 | 6 | __author__ = "Mohamed-Rafik Bouguelia" 7 | __license__ = "MIT" 8 | __email__ = "mohamed-rafik.bouguelia@hh.se" 9 | 10 | from .peer_grouping import PeerGrouping 11 | from .transformer import Transformer 12 | from grand import IndividualAnomalyInductive 13 | from grand.utils import DeviationContext, append_to_df, TestUnitError, NoRefGroupError 14 | from grand import utils 15 | import pandas as pd, matplotlib.pylab as plt, numpy as np 16 | from pandas.plotting import register_matplotlib_converters 17 | 18 | class GroupAnomaly: 19 | '''Self monitoring for a group of units (machines) 20 | 21 | Parameters: 22 | ---------- 23 | nb_units : int 24 | Number of units. Must be equal to len(x_units), where x_units is a parameter of the method self.predict 25 | 26 | ids_target_units : list 27 | List of indexes of the target units (to be diagnoised). Each element of the list should be an integer between 0 (included) and nb_units (excluded). 28 | 29 | w_ref_group : string 30 | Time window used to define the reference group, e.g. "7days", "12h" ... 31 | Possible values for the units can be found in https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_timedelta.html 32 | 33 | w_martingale : int 34 | Window used to compute the deviation level based on the last w_martingale samples. 35 | 36 | non_conformity : string 37 | Strangeness (or non-conformity) measure used to compute the deviation level. 38 | It must be either "median" or "knn" or "lof" 39 | 40 | k : int 41 | Parameter used for k-nearest neighbours, when non_conformity is set to "knn" 42 | 43 | dev_threshold : float 44 | Threshold in [0,1] on the deviation level 45 | ''' 46 | 47 | def __init__(self, nb_units, ids_target_units, w_ref_group="7days", w_martingale=15, non_conformity="median", k=20, 48 | dev_threshold=.6, transformer=None, w_transform=30, columns=None): 49 | self.nb_units = nb_units 50 | self.ids_target_units = ids_target_units 51 | self.w_ref_group = w_ref_group 52 | self.w_martingale = w_martingale 53 | self.non_conformity = non_conformity 54 | self.k = k 55 | self.dev_threshold = dev_threshold 56 | self.transformer = transformer 57 | self.w_transform = w_transform 58 | self.columns = columns 59 | 60 | self.dfs_original = [ pd.DataFrame( data = [], index = [] ) for _ in range(nb_units) ] 61 | self.dfs = [ pd.DataFrame( data = [], index = [] ) for _ in range(nb_units) ] # FIXME: duplicates with self.detectors[i].df 62 | self.pg = PeerGrouping(self.w_ref_group) 63 | self.detectors = [ IndividualAnomalyInductive(w_martingale, non_conformity, k, dev_threshold) for _ in range(nb_units) ] 64 | self.transformers = [Transformer(w_transform, transformer) for _ in range(nb_units)] 65 | 66 | # =========================================== 67 | # TODO assert len(x_units) == nb_units, or include the name of units with the data ... 68 | def predict(self, dt, x_units): 69 | '''Diagnoise each target unit based on its data x_units[uid] (where uid is in ids_target_units). 70 | Compute deviation level by comparing the data from the target unit (x_units[uid]) against the reference group. 71 | 72 | Parameters: 73 | ----------- 74 | dt : datetime 75 | Current datetime period 76 | 77 | x_units : array-like, shape (n_units, n_features) 78 | Each element x_units[i] corresponds to a data-point from the i'th unit at time dt. 79 | len(x_units) should correspond to the number of units (nb_units). 80 | 81 | Returns: 82 | -------- 83 | strangeness : float 84 | Non-conformity score of the test unit compared to the reference group. 85 | 86 | pvalue : float, in [0, 1] 87 | p-value for the test sample. Represents the proportion of samples in the reference group that are stranger than the test sample. 88 | 89 | deviation : float, in [0, 1] 90 | Scaled deviation level computed based on the martingale method. 91 | 92 | is_deviating : boolean 93 | True if the deviation is above the threshold (dev_threshold) 94 | ''' 95 | 96 | self.dfs_original = [append_to_df(self.dfs_original[i], dt, x) for i, x in enumerate(x_units)] 97 | 98 | x_units_tr = [transformer.transform(x) for x, transformer in zip(x_units, self.transformers)] 99 | self.dfs = [append_to_df(self.dfs[i], dt, x) for i, x in enumerate(x_units_tr)] 100 | 101 | deviations = [] 102 | 103 | for uid in self.ids_target_units: 104 | detector = self.detectors[uid] 105 | 106 | try: 107 | x, Xref = self.pg.get_target_and_reference(uid, dt, self.dfs) 108 | detector.fit(Xref) 109 | devContext = detector.predict(dt, x) 110 | except (TestUnitError, NoRefGroupError): 111 | devContext = DeviationContext(0, 0.5, 0, False) # no deviation by default 112 | 113 | deviations.append(devContext) 114 | 115 | return deviations 116 | 117 | # =========================================== 118 | def get_similar_deviations(self, uid, from_time, to_time, k_devs=2, min_len=5, dev_threshold=None): 119 | target_devsig = self.detectors[uid].get_deviation_signature(from_time, to_time) 120 | deviations = [self.detectors[uuid].get_all_deviations(min_len, dev_threshold) for uuid in self.ids_target_units] 121 | 122 | deviations = [] 123 | for uuid in self.ids_target_units: 124 | deviations_uuid = self.detectors[uuid].get_all_deviations(min_len, dev_threshold) 125 | deviations_uuid = [(devsig, p_from, p_to, uuid) for (devsig, p_from, p_to) in deviations_uuid] 126 | deviations += deviations_uuid 127 | 128 | dists = [np.linalg.norm(target_devsig - devsig) for (devsig, *_) in deviations] 129 | ids = np.argsort(dists)[:k_devs] 130 | return [deviations[id] for id in ids] 131 | 132 | # =========================================== 133 | def plot_deviations(self, figsize=None, savefig=None, plots=["data", "transformed_data", "strangeness", "deviation", "threshold"], debug=False): 134 | '''Plots the anomaly score, deviation level and p-value, over time.''' 135 | 136 | register_matplotlib_converters() 137 | 138 | if self.transformer is None and "transformed_data" in plots: 139 | plots.remove("transformed_data") 140 | 141 | plots, nb_axs, i = list(set(plots)), 0, 0 142 | if "data" in plots: 143 | nb_axs += 1 144 | if "transformed_data" in plots: 145 | nb_axs += 1 146 | if "strangeness" in plots: 147 | nb_axs += 1 148 | if any(s in ["pvalue", "deviation", "threshold"] for s in plots): 149 | nb_axs += 1 150 | 151 | fig, axs = plt.subplots(nb_axs, sharex="row", figsize=figsize) 152 | fig.autofmt_xdate() 153 | if not isinstance(axs, (np.ndarray) ): axs = np.array([axs]) 154 | 155 | if "data" in plots: 156 | axs[i].set_xlabel("Time") 157 | axs[i].set_ylabel("Feature 0") 158 | for uid in self.ids_target_units: 159 | df = self.dfs_original[uid] 160 | axs[i].plot(df.index, df.values[:, 0], label="Unit {}".format(uid)) 161 | axs[i].legend() 162 | i += 1 163 | 164 | if "transformed_data" in plots: 165 | axs[i].set_xlabel("Time") 166 | axs[i].set_ylabel("Trans. Feature 0") 167 | for uid in self.ids_target_units: 168 | df = self.dfs[uid] 169 | axs[i].plot(df.index, df.values[:, 0], label="Unit {}".format(uid)) 170 | if debug and uid == self.ids_target_units[-1]: 171 | T, representatives = self.detectors[uid].T, self.detectors[uid].representatives 172 | axs[i].plot(T, np.array(representatives)[:, 0], label="Representative", ls="--", color="black") 173 | 174 | axs[i].legend() 175 | i += 1 176 | 177 | if "strangeness" in plots: 178 | axs[i].set_xlabel("Time") 179 | axs[i].set_ylabel("Strangeness") 180 | for uid in self.ids_target_units: 181 | T, S = self.detectors[uid].T, self.detectors[uid].S 182 | axs[i].plot(T, S, label="Unit {}".format(uid)) 183 | axs[i].legend() 184 | i += 1 185 | 186 | if any(s in ["pvalue", "deviation", "threshold"] for s in plots): 187 | axs[i].set_xlabel("Time") 188 | axs[i].set_ylabel("Deviation") 189 | axs[i].set_ylim(0, 1) 190 | for uid in self.ids_target_units: 191 | T, P, M = self.detectors[uid].T, self.detectors[uid].P, self.detectors[uid].M 192 | if "pvalue" in plots: 193 | axs[i].scatter(T, P, alpha=0.25, marker=".", color="green") 194 | if "deviation" in plots: 195 | axs[i].plot(T, M) 196 | if "threshold" in plots: 197 | axs[i].axhline(y=self.dev_threshold, color='r', linestyle='--') 198 | 199 | if savefig is None: 200 | plt.show() 201 | else: 202 | figpathname = utils.create_directory_from_path(savefig) 203 | plt.savefig(figpathname) 204 | 205 | # =========================================== 206 | def plot_explanations(self, uid, from_time, to_time, figsize=None, savefig=None, k_features=4): 207 | # TODO: validate if the period (from_time, to_time) has data before plotting 208 | detector = self.detectors[uid] 209 | sub_dfs_ori = [self.dfs_original[uuid][from_time: to_time] for uuid in range(self.nb_units)] 210 | sub_dfs = [self.dfs[uuid][from_time: to_time] for uuid in range(self.nb_units)] 211 | sub_representatives_df = pd.DataFrame(index=detector.T, data=detector.representatives)[from_time: to_time] 212 | sub_diffs_df = pd.DataFrame(index=detector.T, data=detector.diffs)[from_time: to_time] 213 | 214 | nb_features = sub_diffs_df.values.shape[1] 215 | if (self.columns is None) or (len(self.columns) != nb_features): 216 | self.columns = ["Feature {}".format(j) for j in range(nb_features)] 217 | self.columns = np.array(self.columns) 218 | 219 | features_scores = np.array([np.abs(col).mean() for col in sub_diffs_df.values.T]) 220 | features_scores = 100 * features_scores / features_scores.sum() 221 | k_features = min(k_features, nb_features) 222 | selected_features_ids = np.argsort(features_scores)[-k_features:][::-1] 223 | selected_features_names = self.columns[selected_features_ids] 224 | selected_features_scores = features_scores[selected_features_ids] 225 | 226 | fig, axs = plt.subplots(k_features, 2, figsize=figsize) 227 | fig.autofmt_xdate() 228 | fig.suptitle("Ranked features of Unit {}\nFrom {} to {}".format(uid, from_time, to_time)) 229 | if k_features == 1: axs = np.array([axs]).reshape(1, -1) 230 | 231 | for i, (j, name, score) in enumerate(zip(selected_features_ids, selected_features_names, selected_features_scores)): 232 | if i == 0: axs[i][0].set_title("Original data") 233 | axs[i][0].set_xlabel("Time") 234 | axs[i][0].set_ylabel("{0}\n(Score: {1:.1f})".format(name, score)) 235 | for df_ori in sub_dfs_ori: axs[i][0].plot(df_ori.index, df_ori.values[:, j], color="silver") 236 | axs[i][0].plot(sub_dfs_ori[uid].index, sub_dfs_ori[uid].values[:, j], color="red") 237 | 238 | if i == 0: axs[i][1].set_title("Transformed data") 239 | axs[i][1].set_xlabel("Time") 240 | axs[i][1].set_ylabel("{}".format(name)) 241 | for df in sub_dfs: axs[i][1].plot(df.index, df.values[:, j], color="silver") 242 | axs[i][1].plot(sub_representatives_df.index, sub_representatives_df.values[:, j], color="black", linestyle='--') 243 | axs[i][1].plot(sub_dfs[uid].index, sub_dfs[uid].values[:, j], color="red") 244 | 245 | figg = None 246 | if k_features > 1: 247 | figg, (ax1, ax2) = plt.subplots(1, 2, figsize=figsize) 248 | figg.suptitle("Top 2 ranked features of Unit {}\nFrom {} to {}".format(uid, from_time, to_time)) 249 | (j1, j2) , (nm1, nm2), (s1, s2) = selected_features_ids[:2], selected_features_names[:2], selected_features_scores[:2] 250 | 251 | ax1.set_title("Original data") 252 | ax1.set_xlabel("{0}\n(Score: {1:.1f})".format(nm1, s1)) 253 | ax1.set_ylabel("{0}\n(Score: {1:.1f})".format(nm2, s2)) 254 | for df_ori in sub_dfs_ori: ax1.scatter(df_ori.values[:, j1], df_ori.values[:, j2], color="silver", marker=".") 255 | ax1.scatter(sub_dfs_ori[uid].values[:, j1], sub_dfs_ori[uid].values[:, j2], color="red", marker=".", label="Unit {}".format(uid)) 256 | ax1.legend() 257 | 258 | ax2.set_title("Transformed data") 259 | ax2.set_xlabel("{0}\n(Score: {1:.1f})".format(nm1, s1)) 260 | ax2.set_ylabel("{0}\n(Score: {1:.1f})".format(nm2, s2)) 261 | for df in sub_dfs: ax2.scatter(df.values[:, j1], df.values[:, j2], color="silver", marker=".") 262 | ax2.scatter(sub_dfs[uid].values[:, j1], sub_dfs[uid].values[:, j2], color="red", marker=".", label="Unit {}".format(uid)) 263 | ax2.legend() 264 | 265 | if savefig is None: 266 | plt.show() 267 | else: 268 | figpathname = utils.create_directory_from_path(savefig) 269 | fig.savefig(figpathname) 270 | if figg is not None: figg.savefig(figpathname + "_2.png") 271 | -------------------------------------------------------------------------------- /examples/notebooks/data/stationary-2.csv: -------------------------------------------------------------------------------- 1 | Date,Feature 0,Feature 1 2 | 1959-01-01,35.0,20.835501727036185 3 | 1959-01-02,32.0,19.059136975735985 4 | 1959-01-03,30.0,21.119310152135483 5 | 1959-01-04,31.0,12.945256185062945 6 | 1959-01-05,44.0,29.281085140461208 7 | 1959-01-06,29.0,17.45321366346135 8 | 1959-01-07,45.0,20.531653877371266 9 | 1959-01-08,43.0,20.680676080511795 10 | 1959-01-09,38.0,23.199382785214024 11 | 1959-01-10,27.0,17.644975468576767 12 | 1959-01-11,38.0,23.21922830859579 13 | 1959-01-12,33.0,32.33710493903455 14 | 1959-01-13,55.0,10.540954882560946 15 | 1959-01-14,47.0,16.754320964276936 16 | 1959-01-15,45.0,10.785633247233 17 | 1959-01-16,37.0,23.306189673382484 18 | 1959-01-17,50.0,12.828844902407344 19 | 1959-01-18,43.0,25.924371564907016 20 | 1959-01-19,41.0,16.944716500564997 21 | 1959-01-20,52.0,27.89036170504706 22 | 1959-01-21,34.0,25.75014348678772 23 | 1959-01-22,53.0,20.160255969403345 24 | 1959-01-23,39.0,17.12033110901343 25 | 1959-01-24,32.0,23.155316793608748 26 | 1959-01-25,37.0,20.209383632301144 27 | 1959-01-26,43.0,20.336227089807615 28 | 1959-01-27,39.0,12.332383871324874 29 | 1959-01-28,35.0,25.70012657734548 30 | 1959-01-29,44.0,8.930512194248983 31 | 1959-01-30,38.0,12.465519082807978 32 | 1959-01-31,24.0,12.54873293669382 33 | 1959-02-01,23.0,28.318253662479417 34 | 1959-02-02,31.0,17.477078859603985 35 | 1959-02-03,44.0,20.963917416519827 36 | 1959-02-04,38.0,19.91128131545577 37 | 1959-02-05,50.0,24.60664471317338 38 | 1959-02-06,38.0,16.77881754855514 39 | 1959-02-07,51.0,20.76869507720173 40 | 1959-02-08,31.0,22.1517447156965 41 | 1959-02-09,31.0,19.954139894137477 42 | 1959-02-10,51.0,25.018204085460923 43 | 1959-02-11,36.0,22.761924452091606 44 | 1959-02-12,45.0,19.76605503682941 45 | 1959-02-13,51.0,18.884957013328403 46 | 1959-02-14,34.0,16.855419046638975 47 | 1959-02-15,52.0,20.393931582271232 48 | 1959-02-16,47.0,12.583328194773145 49 | 1959-02-17,45.0,18.070677898164284 50 | 1959-02-18,46.0,18.86192200621991 51 | 1959-02-19,39.0,22.42671442179852 52 | 1959-02-20,48.0,21.193964522054483 53 | 1959-02-21,37.0,15.749335941405633 54 | 1959-02-22,35.0,28.296971860230848 55 | 1959-02-23,52.0,26.553632096086847 56 | 1959-02-24,42.0,17.886071075757698 57 | 1959-02-25,45.0,17.74320869870218 58 | 1959-02-26,39.0,9.270687972211181 59 | 1959-02-27,37.0,21.747178359576512 60 | 1959-02-28,30.0,13.698969492803844 61 | 1959-03-01,35.0,14.982288426683816 62 | 1959-03-02,28.0,18.13515671822819 63 | 1959-03-03,45.0,24.43433607497198 64 | 1959-03-04,34.0,23.328586638771526 65 | 1959-03-05,36.0,20.009666235093356 66 | 1959-03-06,50.0,12.200942503176329 67 | 1959-03-07,44.0,16.4855493989434 68 | 1959-03-08,39.0,13.119075789975575 69 | 1959-03-09,32.0,18.49135541316485 70 | 1959-03-10,39.0,14.761030428660765 71 | 1959-03-11,45.0,22.288310825393527 72 | 1959-03-12,43.0,24.110116948403345 73 | 1959-03-13,39.0,17.18622890088645 74 | 1959-03-14,31.0,21.026839206538753 75 | 1959-03-15,27.0,20.63103142578357 76 | 1959-03-16,30.0,16.970560206542846 77 | 1959-03-17,42.0,24.05463961973403 78 | 1959-03-18,46.0,24.005952394548533 79 | 1959-03-19,41.0,5.803449971630881 80 | 1959-03-20,36.0,18.334146210843738 81 | 1959-03-21,45.0,21.074652442785265 82 | 1959-03-22,46.0,16.15547134459422 83 | 1959-03-23,43.0,19.233431761824257 84 | 1959-03-24,38.0,21.398979774623562 85 | 1959-03-25,34.0,17.096428813827185 86 | 1959-03-26,35.0,16.21138079080529 87 | 1959-03-27,56.0,22.756598760203683 88 | 1959-03-28,36.0,15.819946631966022 89 | 1959-03-29,32.0,21.58372381657187 90 | 1959-03-30,50.0,26.361827940367146 91 | 1959-03-31,41.0,18.325917018202865 92 | 1959-04-01,39.0,13.393620804720085 93 | 1959-04-02,41.0,20.00489242620598 94 | 1959-04-03,47.0,26.22118359631925 95 | 1959-04-04,34.0,8.078725065326097 96 | 1959-04-05,36.0,12.77280295937107 97 | 1959-04-06,33.0,18.148873411090694 98 | 1959-04-07,35.0,18.897360245168393 99 | 1959-04-08,38.0,23.517445905732593 100 | 1959-04-09,38.0,23.24625309593858 101 | 1959-04-10,34.0,24.94499788185282 102 | 1959-04-11,90.0,0.52941455890677 103 | 1959-04-12,34.0,29.79729886645327 104 | 1959-04-13,68.0,-5.989635514077555 105 | 1959-04-14,38.0,17.01048178667468 106 | 1959-04-15,35.0,18.12420157457012 107 | 1959-04-16,64.0,32.949216834476 108 | 1959-04-17,42.0,19.250785938847635 109 | 1959-04-18,34.0,15.893859921242274 110 | 1959-04-19,46.0,27.471111735671677 111 | 1959-04-20,30.0,24.418568845273136 112 | 1959-04-21,46.0,18.169713783767246 113 | 1959-04-22,45.0,15.176284820356162 114 | 1959-04-23,54.0,22.70978135043641 115 | 1959-04-24,34.0,15.874547201783466 116 | 1959-04-25,37.0,22.253724443414804 117 | 1959-04-26,35.0,26.417087134553476 118 | 1959-04-27,40.0,21.471787875919414 119 | 1959-04-28,42.0,20.116557779993922 120 | 1959-04-29,58.0,24.078008302743985 121 | 1959-04-30,51.0,17.16499190185516 122 | 1959-05-01,32.0,17.366599139080897 123 | 1959-05-02,35.0,23.848095300266024 124 | 1959-05-03,38.0,15.086086958742762 125 | 1959-05-04,33.0,23.918523244262808 126 | 1959-05-05,39.0,24.10223020169712 127 | 1959-05-06,47.0,20.460155096979765 128 | 1959-05-07,38.0,16.6065218909107 129 | 1959-05-08,52.0,22.78449082322308 130 | 1959-05-09,30.0,14.890075073324379 131 | 1959-05-10,34.0,15.866188209898723 132 | 1959-05-11,40.0,30.17387210585521 133 | 1959-05-12,35.0,15.883832919706652 134 | 1959-05-13,42.0,25.275406696876402 135 | 1959-05-14,41.0,21.561501247314858 136 | 1959-05-15,42.0,22.613726218818318 137 | 1959-05-16,38.0,19.30409682906272 138 | 1959-05-17,24.0,14.784491960655984 139 | 1959-05-18,34.0,21.419481420734897 140 | 1959-05-19,43.0,14.885349055849467 141 | 1959-05-20,36.0,14.835018404500868 142 | 1959-05-21,55.0,21.01666479983712 143 | 1959-05-22,41.0,13.441062295204329 144 | 1959-05-23,45.0,17.786513932673103 145 | 1959-05-24,41.0,24.500433322436415 146 | 1959-05-25,37.0,21.061510596284087 147 | 1959-05-26,43.0,18.379120869326307 148 | 1959-05-27,39.0,14.38762950498131 149 | 1959-05-28,33.0,16.727794888500767 150 | 1959-05-29,43.0,13.316976546663858 151 | 1959-05-30,40.0,24.555224079476798 152 | 1959-05-31,38.0,22.454251641249765 153 | 1959-06-01,45.0,7.586989891564864 154 | 1959-06-02,46.0,26.110820107918386 155 | 1959-06-03,34.0,14.977369459161345 156 | 1959-06-04,35.0,17.757486247988894 157 | 1959-06-05,48.0,24.103740286404207 158 | 1959-06-06,51.0,22.448223586976994 159 | 1959-06-07,36.0,25.272571300099088 160 | 1959-06-08,33.0,24.398244953683932 161 | 1959-06-09,46.0,23.650274990975912 162 | 1959-06-10,42.0,19.795524589133464 163 | 1959-06-11,48.0,10.731441559419684 164 | 1959-06-12,34.0,15.115657077033264 165 | 1959-06-13,41.0,17.220402972549536 166 | 1959-06-14,35.0,14.44593185316925 167 | 1959-06-15,40.0,20.69223679238351 168 | 1959-06-16,34.0,14.998869461823674 169 | 1959-06-17,30.0,25.009850553952635 170 | 1959-06-18,36.0,18.815867048588665 171 | 1959-06-19,40.0,19.792248234882646 172 | 1959-06-20,39.0,14.747612172429674 173 | 1959-06-21,45.0,22.094170796178773 174 | 1959-06-22,38.0,24.080753729339975 175 | 1959-06-23,47.0,18.352701249187476 176 | 1959-06-24,33.0,11.312967701602478 177 | 1959-06-25,30.0,23.302149570815672 178 | 1959-06-26,42.0,20.894940196192664 179 | 1959-06-27,43.0,14.12207319273545 180 | 1959-06-28,41.0,23.42097068006357 181 | 1959-06-29,41.0,23.59368618305812 182 | 1959-06-30,59.0,26.19484474335951 183 | 1959-07-01,43.0,22.303512041340607 184 | 1959-07-02,45.0,22.270575021516173 185 | 1959-07-03,38.0,13.379290806114724 186 | 1959-07-04,37.0,22.20815697171935 187 | 1959-07-05,45.0,17.66129702665004 188 | 1959-07-06,42.0,13.607186156272842 189 | 1959-07-07,57.0,23.72236889495042 190 | 1959-07-08,46.0,27.215737433767167 191 | 1959-07-09,51.0,17.13694339078769 192 | 1959-07-10,41.0,15.80185710762399 193 | 1959-07-11,47.0,25.186891803273824 194 | 1959-07-12,26.0,16.08932510026946 195 | 1959-07-13,35.0,20.051179484625095 196 | 1959-07-14,44.0,12.747366290910367 197 | 1959-07-15,41.0,22.85577073654874 198 | 1959-07-16,42.0,32.63558677186806 199 | 1959-07-17,36.0,29.240971560607555 200 | 1959-07-18,45.0,24.319359951168313 201 | 1959-07-19,45.0,24.36952414949859 202 | 1959-07-20,45.0,26.426693696092805 203 | 1959-07-21,47.0,22.35104885688846 204 | 1959-07-22,38.0,16.47235454478513 205 | 1959-07-23,42.0,14.573109359811255 206 | 1959-07-24,35.0,22.822475466606836 207 | 1959-07-25,36.0,16.724372935329026 208 | 1959-07-26,39.0,21.02160015519355 209 | 1959-07-27,45.0,14.801562114707956 210 | 1959-07-28,43.0,25.838414533837703 211 | 1959-07-29,47.0,10.452152527622271 212 | 1959-07-30,36.0,19.34299657748936 213 | 1959-07-31,41.0,18.754720324817352 214 | 1959-08-01,50.0,12.929518540414941 215 | 1959-08-02,39.0,29.624848496652845 216 | 1959-08-03,41.0,19.50707238272979 217 | 1959-08-04,46.0,18.282926497013456 218 | 1959-08-05,64.0,16.150602725563463 219 | 1959-08-06,45.0,22.98384676349622 220 | 1959-08-07,34.0,21.636350914354423 221 | 1959-08-08,38.0,8.206120602686317 222 | 1959-08-09,44.0,18.477694840511674 223 | 1959-08-10,48.0,15.841656404674694 224 | 1959-08-11,46.0,15.401510709372294 225 | 1959-08-12,44.0,8.362083168573982 226 | 1959-08-13,37.0,9.451395269850476 227 | 1959-08-14,39.0,19.185551786389862 228 | 1959-08-15,44.0,18.15685475089071 229 | 1959-08-16,45.0,9.978769793034878 230 | 1959-08-17,33.0,8.594527677755437 231 | 1959-08-18,44.0,15.135013497254398 232 | 1959-08-19,38.0,6.65426929999982 233 | 1959-08-20,46.0,15.345275579777205 234 | 1959-08-21,46.0,11.689680173772413 235 | 1959-08-22,40.0,13.160442579909557 236 | 1959-08-23,39.0,23.422853186308146 237 | 1959-08-24,44.0,2.457149976562076 238 | 1959-08-25,48.0,6.438791430160158 239 | 1959-08-26,50.0,13.548008372008063 240 | 1959-08-27,41.0,13.353094048526094 241 | 1959-08-28,42.0,22.337239459361534 242 | 1959-08-29,51.0,11.380884375132595 243 | 1959-08-30,41.0,18.52435283032382 244 | 1959-08-31,44.0,1.7728169670059408 245 | 1959-09-01,38.0,9.324982954106897 246 | 1959-09-02,68.0,4.411868987212607 247 | 1959-09-03,40.0,9.204214476552007 248 | 1959-09-04,42.0,7.547235361156281 249 | 1959-09-05,51.0,13.154035339369248 250 | 1959-09-06,44.0,21.35085718613378 251 | 1959-09-07,45.0,4.3186740636421055 252 | 1959-09-08,36.0,9.439539787320497 253 | 1959-09-09,57.0,0.1371299536188788 254 | 1959-09-10,44.0,10.68138861226554 255 | 1959-09-11,42.0,13.069854982078233 256 | 1959-09-12,53.0,7.188361121801117 257 | 1959-09-13,42.0,4.313989062805451 258 | 1959-09-14,34.0,0.2313644328278368 259 | 1959-09-15,40.0,9.039993512095311 260 | 1959-09-16,56.0,2.6611002268439545 261 | 1959-09-17,44.0,3.358913384278374 262 | 1959-09-18,53.0,10.110185450881193 263 | 1959-09-19,55.0,9.246644823425747 264 | 1959-09-20,39.0,-1.9094228650826537 265 | 1959-09-21,59.0,6.825724261181598 266 | 1959-09-22,55.0,2.7010522508634587 267 | 1959-09-23,73.0,4.113849411321802 268 | 1959-09-24,55.0,10.400983430521405 269 | 1959-09-25,44.0,4.547351600849156 270 | 1959-09-26,43.0,11.013092596255913 271 | 1959-09-27,40.0,5.959441557785284 272 | 1959-09-28,47.0,10.965799090159527 273 | 1959-09-29,51.0,10.729927517469218 274 | 1959-09-30,56.0,5.033922347244724 275 | 1959-10-01,49.0,11.067383854565126 276 | 1959-10-02,54.0,7.991942955263889 277 | 1959-10-03,56.0,3.731181054383444 278 | 1959-10-04,47.0,9.60849204948153 279 | 1959-10-05,44.0,5.436376615746947 280 | 1959-10-06,43.0,10.403980076356627 281 | 1959-10-07,42.0,8.836794933266088 282 | 1959-10-08,45.0,7.940394946568858 283 | 1959-10-09,50.0,23.567661642445497 284 | 1959-10-10,48.0,14.81649308474506 285 | 1959-10-11,43.0,8.687688025095138 286 | 1959-10-12,40.0,3.2882923916551423 287 | 1959-10-13,59.0,11.423203849179803 288 | 1959-10-14,41.0,18.409464328260796 289 | 1959-10-15,42.0,6.410814721879816 290 | 1959-10-16,51.0,15.373182383063028 291 | 1959-10-17,49.0,19.670907062071112 292 | 1959-10-18,45.0,18.3370995037562 293 | 1959-10-19,43.0,17.89103172455656 294 | 1959-10-20,42.0,24.21485164425647 295 | 1959-10-21,38.0,13.522628096252465 296 | 1959-10-22,47.0,14.95654145487521 297 | 1959-10-23,38.0,6.489404554597201 298 | 1959-10-24,36.0,22.296867216858825 299 | 1959-10-25,42.0,13.332329969459654 300 | 1959-10-26,35.0,18.92324692746712 301 | 1959-10-27,28.0,17.330560302285207 302 | 1959-10-28,44.0,27.44072675278098 303 | 1959-10-29,36.0,26.0151823780754 304 | 1959-10-30,45.0,28.795546314342438 305 | 1959-10-31,46.0,17.812249784621585 306 | 1959-11-01,48.0,15.033542025232439 307 | 1959-11-02,49.0,22.267337471447867 308 | 1959-11-03,43.0,15.357449494914375 309 | 1959-11-04,42.0,9.643615197290227 310 | 1959-11-05,59.0,23.167328249047852 311 | 1959-11-06,45.0,8.150711943827837 312 | 1959-11-07,52.0,19.56682188423375 313 | 1959-11-08,46.0,18.85283597805902 314 | 1959-11-09,42.0,21.47908410276248 315 | 1959-11-10,40.0,29.832367759209653 316 | 1959-11-11,40.0,10.945042257184081 317 | 1959-11-12,45.0,21.52961001918512 318 | 1959-11-13,35.0,22.901294946745253 319 | 1959-11-14,35.0,24.80910754087445 320 | 1959-11-15,40.0,18.110657626535087 321 | 1959-11-16,39.0,20.63667418706687 322 | 1959-11-17,33.0,19.28194918569956 323 | 1959-11-18,42.0,13.439096842005121 324 | 1959-11-19,47.0,20.733219587347286 325 | 1959-11-20,51.0,22.03982666851866 326 | 1959-11-21,44.0,24.436059277141005 327 | 1959-11-22,40.0,21.161869157797412 328 | 1959-11-23,57.0,6.065335222735346 329 | 1959-11-24,49.0,23.33703409664802 330 | 1959-11-25,45.0,13.093323926256645 331 | 1959-11-26,49.0,23.246490799816865 332 | 1959-11-27,51.0,9.245937065251436 333 | 1959-11-28,46.0,24.89841530595614 334 | 1959-11-29,44.0,15.699361440585887 335 | 1959-11-30,52.0,23.32960056489824 336 | 1959-12-01,45.0,26.112262290194145 337 | 1959-12-02,32.0,22.602370029034383 338 | 1959-12-03,46.0,18.690399516936125 339 | 1959-12-04,41.0,20.296506776192782 340 | 1959-12-05,34.0,21.41441735242775 341 | 1959-12-06,33.0,22.808001690397656 342 | 1959-12-07,36.0,19.870001775963726 343 | 1959-12-08,49.0,16.681689282962463 344 | 1959-12-09,43.0,23.3577428841644 345 | 1959-12-10,43.0,21.809747379508966 346 | 1959-12-11,34.0,23.364904340708787 347 | 1959-12-12,39.0,13.86468086136473 348 | 1959-12-13,35.0,22.653689381503753 349 | 1959-12-14,52.0,22.264954470444273 350 | 1959-12-15,47.0,16.205839097009335 351 | 1959-12-16,52.0,16.57805401880027 352 | 1959-12-17,39.0,14.163965261080396 353 | 1959-12-18,40.0,17.10101117992792 354 | 1959-12-19,42.0,17.955041475896067 355 | 1959-12-20,42.0,9.9620479209517 356 | 1959-12-21,53.0,15.94374880960628 357 | 1959-12-22,39.0,31.53343285693175 358 | 1959-12-23,40.0,20.58164057317812 359 | 1959-12-24,38.0,15.967818084255073 360 | 1959-12-25,44.0,24.954509056234098 361 | 1959-12-26,34.0,14.055442399138535 362 | 1959-12-27,37.0,14.147027262903713 363 | 1959-12-28,52.0,27.04020048372552 364 | 1959-12-29,48.0,23.62485931531552 365 | 1959-12-30,55.0,18.22520036207125 366 | 1959-12-31,50.0,22.33373484768547 367 | -------------------------------------------------------------------------------- /grand/individual_anomaly/individual_anomaly_transductive.py: -------------------------------------------------------------------------------- 1 | """A transductive anomaly detection model for an individual system. 2 | To detect anomalies, the IndividualAnomalyTransductive model compares the data from 3 | a system against its own past historical data from the stream. 4 | """ 5 | 6 | __author__ = "Mohamed-Rafik Bouguelia" 7 | __license__ = "MIT" 8 | __email__ = "mohamed-rafik.bouguelia@hh.se" 9 | 10 | from grand.conformal import get_strangeness 11 | from grand.utils import DeviationContext, InputValidationError, append_to_df, dt2num 12 | from grand import utils 13 | import matplotlib.pylab as plt, pandas as pd, numpy as np 14 | from pandas.plotting import register_matplotlib_converters 15 | 16 | 17 | class IndividualAnomalyTransductive: 18 | '''Deviation detection for a single/individual unit 19 | 20 | Parameters: 21 | ---------- 22 | w_martingale : int 23 | Window used to compute the deviation level based on the last w_martingale samples. 24 | 25 | non_conformity : string 26 | Strangeness (or non-conformity) measure used to compute the deviation level. 27 | It must be either "median" or "knn" 28 | 29 | k : int 30 | Parameter used for k-nearest neighbours, when non_conformity is set to "knn" 31 | 32 | dev_threshold : float 33 | Threshold in [0,1] on the deviation level 34 | ''' 35 | 36 | def __init__(self, w_martingale=15, non_conformity="median", k=20, dev_threshold=0.6, ref_group=["season-of-year"], 37 | external_percentage=0.3, columns=None): 38 | utils.validate_individual_deviation_params(w_martingale, non_conformity, k, dev_threshold, ref_group) 39 | 40 | self.w_martingale = w_martingale 41 | self.non_conformity = non_conformity 42 | self.k = k 43 | self.dev_threshold = dev_threshold 44 | self.ref_group = ref_group 45 | self.external_percentage = external_percentage 46 | self.columns = columns 47 | 48 | self.strg = get_strangeness(non_conformity, k) 49 | self.T, self.S, self.P, self.M = [], [], [], [] 50 | self.representatives, self.diffs = [], [] 51 | 52 | self.mart = 0 53 | self.marts = [0, 0, 0] 54 | 55 | self.df = pd.DataFrame(index=[], data=[]) 56 | self.externals = [] 57 | 58 | self.df_init = pd.DataFrame(index=[], data=[]) 59 | self.externals_init = [] 60 | 61 | # =========================================== 62 | def predict(self, dtime, x, external=None): 63 | '''Update the deviation level based on the new test sample x 64 | 65 | Parameters: 66 | ----------- 67 | dtime : datetime 68 | datetime corresponding to the sample x 69 | 70 | x : array-like, shape (n_features,) 71 | Sample for which the strangeness, p-value and deviation level are computed 72 | 73 | external: float (default None) 74 | Used in case self.ref_group == "external" to construct the reference dataset from historical data 75 | 76 | Returns: 77 | -------- 78 | strangeness : float 79 | Strangeness of x with respect to samples in Xref 80 | 81 | pval : float, in [0, 1] 82 | p-value that represents the proportion of samples in Xref that are stranger than x. 83 | 84 | deviation : float, in [0, 1] 85 | Normalized deviation level updated based on the last w_martingale steps 86 | ''' 87 | 88 | self.T.append(dtime) 89 | self._fit(dtime, x, external) 90 | 91 | strangeness, diff, representative = self.strg.predict(x) 92 | self.S.append(strangeness) 93 | self.diffs.append(diff) 94 | self.representatives.append(representative) 95 | 96 | pval = self.strg.pvalue(strangeness) 97 | self.P.append(pval) 98 | 99 | deviation = self._update_martingale(pval) 100 | self.M.append(deviation) 101 | 102 | is_deviating = deviation > self.dev_threshold 103 | return DeviationContext(strangeness, pval, deviation, is_deviating) 104 | 105 | # =========================================== 106 | def init(self, data): 107 | # TODO: check if data is a list of elements i with (t_i, x_i, [external_i]) 108 | # TODO: and that if ref_group="external" then external_i should be specified (i.e. len(data[0]) == 3) 109 | if len(data[0]) == 2: 110 | times, X = list(zip(*data)) 111 | externals = [] 112 | 113 | elif len(data[0]) == 3: 114 | times, X, externals = list(zip(*data)) 115 | 116 | self.df_init = pd.DataFrame(index=times, data=X) 117 | self.externals_init = externals 118 | 119 | return self 120 | 121 | # =========================================== 122 | def _fit(self, dtime, x, external=None): 123 | ''' Private method for internal use only. 124 | Constructs a reference dataset based on historical data and the specified ref_group criteria 125 | and fits a model to this reference data. 126 | ''' 127 | 128 | if self.ref_group == "external": 129 | if external is None: 130 | raise InputValidationError("When ref_group is set to 'external', the parameter external must be specified.") 131 | 132 | all_externals = np.array( list(self.externals_init) + list(self.externals) ) 133 | all_X = np.array( list(self.df_init.values) + list(self.df.values) ) 134 | 135 | k = int( len(all_externals) * self.external_percentage ) 136 | ids = np.argsort( np.abs(all_externals - external) )[:k] 137 | X = all_X[ids] 138 | elif callable(self.ref_group): 139 | df = self.df_init.append(self.df) 140 | if len(df) == 0: X = [] 141 | else: 142 | history_times, history_data = df.index.to_pydatetime(), df.values 143 | current_time, current_data = dtime, x 144 | X = self.ref_group(history_times, history_data, current_time, current_data) 145 | else: 146 | df_sub = self.df.append(self.df_init) 147 | for criterion in self.ref_group: 148 | current = dt2num(dtime, criterion) 149 | historical = np.array([dt2num(dt, criterion) for dt in df_sub.index]) 150 | df_sub = df_sub.loc[(current == historical)] 151 | X = df_sub.values 152 | 153 | if len(X) == 0: 154 | X = [x] 155 | 156 | self.strg.fit(X) 157 | 158 | self.df = append_to_df(self.df, dtime, x) 159 | self.externals.append(external) 160 | 161 | # =========================================== 162 | def _update_martingale(self, pval): 163 | ''' Private method for internal use only. 164 | Incremental additive martingale over the last w_martingale steps. 165 | 166 | Parameters: 167 | ----------- 168 | pval : int, in [0, 1] 169 | The most recent p-value 170 | 171 | Returns: 172 | -------- 173 | normalized_one_sided_mart : float, in [0, 1] 174 | Deviation level. A normalized version of the current martingale value. 175 | ''' 176 | 177 | betting = lambda p: -p + .5 178 | 179 | self.mart += betting(pval) 180 | self.marts.append(self.mart) 181 | 182 | w = min(self.w_martingale, len(self.marts)) 183 | mat_in_window = self.mart - self.marts[-w] 184 | 185 | normalized_mart = (mat_in_window) / (.5 * w) 186 | normalized_one_sided_mart = max(normalized_mart, 0) 187 | return normalized_one_sided_mart 188 | 189 | # =========================================== 190 | def get_stats(self): 191 | stats = np.array([self.S, self.M, self.P]).T 192 | return pd.DataFrame(index=self.T, data=stats, columns=["strangeness", "deviation", "pvalue"]) 193 | 194 | # =========================================== 195 | def get_all_deviations(self, min_len=5, dev_threshold=None): 196 | if dev_threshold is None: dev_threshold = self.dev_threshold 197 | 198 | arr = np.arange(len(self.M)) 199 | boo = np.array(self.M) > dev_threshold 200 | indices = np.nonzero(boo[1:] != boo[:-1])[0] + 1 201 | groups_ids = np.split(arr, indices) 202 | groups_ids = groups_ids[0::2] if boo[0] else groups_ids[1::2] 203 | 204 | diffs_df = pd.DataFrame(index=self.T, data=self.diffs) 205 | sub_diffs_dfs = [diffs_df.iloc[ids, :] for ids in groups_ids if len(ids) >= min_len] 206 | 207 | dev_signatures = [np.mean(sub_diffs_df.values, axis=0) for sub_diffs_df in sub_diffs_dfs] 208 | periods = [(sub_diffs_df.index[0], sub_diffs_df.index[-1]) for sub_diffs_df in sub_diffs_dfs] 209 | 210 | deviations = [(devsig, p_from, p_to) for (devsig, (p_from, p_to)) in zip(dev_signatures, periods)] 211 | return deviations 212 | 213 | # =========================================== 214 | def get_deviation_signature(self, from_time, to_time): 215 | sub_diffs_df = pd.DataFrame(index=self.T, data=self.diffs)[from_time: to_time] 216 | deviation_signature = np.mean(sub_diffs_df.values, axis=0) 217 | return deviation_signature 218 | 219 | # =========================================== 220 | def get_similar_deviations(self, from_time, to_time, k_devs=2, min_len=5, dev_threshold=None): 221 | target_devsig = self.get_deviation_signature(from_time, to_time) 222 | deviations = self.get_all_deviations(min_len, dev_threshold) 223 | dists = [np.linalg.norm(target_devsig - devsig) for (devsig, *_) in deviations] 224 | ids = np.argsort(dists)[:k_devs] 225 | return [deviations[id] for id in ids] 226 | 227 | # =========================================== 228 | def plot_deviations(self, figsize=None, savefig=None, plots=["data", "strangeness", "pvalue", "deviation", "threshold"], debug=False): 229 | '''Plots the anomaly score, deviation level and p-value, over time.''' 230 | 231 | register_matplotlib_converters() 232 | 233 | plots, nb_axs, i = list(set(plots)), 0, 0 234 | if "data" in plots: 235 | nb_axs += 1 236 | if "strangeness" in plots: 237 | nb_axs += 1 238 | if any(s in ["pvalue", "deviation", "threshold"] for s in plots): 239 | nb_axs += 1 240 | 241 | fig, axes = plt.subplots(nb_axs, sharex="row", figsize=figsize) 242 | if not isinstance(axes, (np.ndarray) ): 243 | axes = np.array([axes]) 244 | 245 | if "data" in plots: 246 | axes[i].set_xlabel("Time") 247 | axes[i].set_ylabel("Feature 0") 248 | axes[i].plot(self.df.index, self.df.values[:, 0], label="Data") 249 | if debug: 250 | axes[i].plot(self.T, np.array(self.representatives)[:, 0], label="Representative") 251 | axes[i].legend() 252 | i += 1 253 | 254 | if "strangeness" in plots: 255 | axes[i].set_xlabel("Time") 256 | axes[i].set_ylabel("Strangeness") 257 | axes[i].plot(self.T, self.S, label="Strangeness") 258 | if debug: 259 | axes[i].plot(self.T, np.array(self.diffs)[:, 0], label="Difference") 260 | axes[i].legend() 261 | i += 1 262 | 263 | if any(s in ["pvalue", "deviation", "threshold"] for s in plots): 264 | axes[i].set_xlabel("Time") 265 | axes[i].set_ylabel("Deviation") 266 | axes[i].set_ylim(0, 1) 267 | if "pvalue" in plots: 268 | axes[i].scatter(self.T, self.P, alpha=0.25, marker=".", color="green", label="p-value") 269 | if "deviation" in plots: 270 | axes[i].plot(self.T, self.M, label="Deviation") 271 | if "threshold" in plots: 272 | axes[i].axhline(y=self.dev_threshold, color='r', linestyle='--', label="Threshold") 273 | axes[i].legend() 274 | 275 | fig.autofmt_xdate() 276 | 277 | if savefig is None: 278 | plt.draw() 279 | plt.show() 280 | else: 281 | figpathname = utils.create_directory_from_path(savefig) 282 | plt.savefig(figpathname) 283 | 284 | # =========================================== 285 | def plot_explanations(self, from_time, to_time, figsize=None, savefig=None, k_features=4): 286 | # TODO: validate if the period (from_time, to_time) has data before plotting 287 | 288 | from_time_pad = from_time - (to_time - from_time) 289 | to_time_pad = to_time + (to_time - from_time) 290 | 291 | sub_df = self.df[from_time: to_time] 292 | sub_df_before = self.df[from_time_pad: from_time] 293 | sub_df_after = self.df[to_time: to_time_pad] 294 | 295 | sub_representatives_df_pad = pd.DataFrame(index=self.T, data=self.representatives)[from_time_pad: to_time_pad] 296 | sub_diffs_df = pd.DataFrame(index=self.T, data=self.diffs)[from_time: to_time] 297 | 298 | nb_features = sub_diffs_df.values.shape[1] 299 | if (self.columns is None) or (len(self.columns) != nb_features): 300 | self.columns = ["Feature {}".format(j) for j in range(nb_features)] 301 | self.columns = np.array(self.columns) 302 | 303 | features_scores = np.array([np.abs(col).mean() for col in sub_diffs_df.values.T]) 304 | features_scores = 100 * features_scores / features_scores.sum() 305 | k_features = min(k_features, nb_features) 306 | selected_features_ids = np.argsort(features_scores)[-k_features:][::-1] 307 | selected_features_names = self.columns[selected_features_ids] 308 | selected_features_scores = features_scores[selected_features_ids] 309 | 310 | fig, axs = plt.subplots(k_features, figsize=figsize) 311 | fig.autofmt_xdate() 312 | fig.suptitle("Ranked features\nFrom {} to {}".format(from_time, to_time)) 313 | if k_features == 1 or not isinstance(axs, (np.ndarray) ): 314 | axs = np.array([axs]) 315 | 316 | for i, (j, name, score) in enumerate(zip(selected_features_ids, selected_features_names, selected_features_scores)): 317 | axs[i].set_xlabel("Time") 318 | axs[i].set_ylabel("{0}\n(Score: {1:.1f})".format(name, score)) 319 | axs[i].plot(sub_representatives_df_pad.index, sub_representatives_df_pad.values[:, j], color="grey", linestyle='--') 320 | axs[i].plot(sub_df_before.index, sub_df_before.values[:, j], color="green") 321 | axs[i].plot(sub_df_after.index, sub_df_after.values[:, j], color="lime") 322 | axs[i].plot(sub_df.index, sub_df.values[:, j], color="red") 323 | 324 | figg = None 325 | if k_features > 1: 326 | figg, ax1 = plt.subplots(figsize=figsize) 327 | figg.suptitle("Top 2 ranked features\nFrom {} to {}".format(from_time, to_time)) 328 | (j1, j2) , (nm1, nm2), (s1, s2) = selected_features_ids[:2], selected_features_names[:2], selected_features_scores[:2] 329 | 330 | ax1.set_xlabel("{0}\n(Score: {1:.1f})".format(nm1, s1)) 331 | ax1.set_ylabel("{0}\n(Score: {1:.1f})".format(nm2, s2)) 332 | 333 | self.strg.X = np.array(self.strg.X) 334 | ax1.scatter(self.df.values[:, j1], self.df.values[:, j2], color="silver", marker=".") 335 | ax1.scatter(sub_df_before.values[:, j1], sub_df_before.values[:, j2], color="green", marker=".") 336 | ax1.scatter(sub_df_after.values[:, j1], sub_df_after.values[:, j2], color="lime", marker=".") 337 | ax1.scatter(sub_df.values[:, j1], sub_df.values[:, j2], color="red", marker=".") 338 | 339 | if savefig is None: 340 | plt.show() 341 | else: 342 | figpathname = utils.create_directory_from_path(savefig) 343 | fig.savefig(figpathname) 344 | if figg is not None: figg.savefig(figpathname + "_2.png") 345 | -------------------------------------------------------------------------------- /grand/datasets/data/toy6/unit3.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,0.572419339 3 | 2019-06-20,-0.07402633 4 | 2019-06-21,1.214241011 5 | 2019-06-22,0.391901048 6 | 2019-06-23,0.75646037 7 | 2019-06-24,-0.097642057 8 | 2019-06-25,-0.55885533 9 | 2019-06-26,2.110378742 10 | 2019-06-27,1.480643687 11 | 2019-06-28,1.804886044 12 | 2019-06-29,1.022272592 13 | 2019-06-30,1.141110914 14 | 2019-07-01,1.44640888 15 | 2019-07-02,2.033816182 16 | 2019-07-03,1.920725801 17 | 2019-07-04,2.072819569 18 | 2019-07-05,0.612412697 19 | 2019-07-06,1.874435235 20 | 2019-07-07,1.366130814 21 | 2019-07-08,2.209540767 22 | 2019-07-09,2.148371204 23 | 2019-07-10,2.32954707 24 | 2019-07-11,1.202203913 25 | 2019-07-12,0.193973587 26 | 2019-07-13,1.63079806 27 | 2019-07-14,0.574668226 28 | 2019-07-15,2.180925767 29 | 2019-07-16,2.200914567 30 | 2019-07-17,3.300527672 31 | 2019-07-18,1.099136199 32 | 2019-07-19,2.206270389 33 | 2019-07-20,1.274483399 34 | 2019-07-21,2.373019745 35 | 2019-07-22,2.288040681 36 | 2019-07-23,1.309060814 37 | 2019-07-24,1.975467609 38 | 2019-07-25,2.50475587 39 | 2019-07-26,2.286162545 40 | 2019-07-27,2.234681495 41 | 2019-07-28,0.920226957 42 | 2019-07-29,2.810404754 43 | 2019-07-30,3.067713772 44 | 2019-07-31,2.997189444 45 | 2019-08-01,2.428766491 46 | 2019-08-02,2.578113201 47 | 2019-08-03,2.603653354 48 | 2019-08-04,2.738868328 49 | 2019-08-05,2.436033616 50 | 2019-08-06,2.55177681 51 | 2019-08-07,1.639045258 52 | 2019-08-08,1.955858447 53 | 2019-08-09,2.764577932 54 | 2019-08-10,2.005846619 55 | 2019-08-11,1.880081866 56 | 2019-08-12,3.11519561 57 | 2019-08-13,3.10120805 58 | 2019-08-14,3.400891308 59 | 2019-08-15,2.557761678 60 | 2019-08-16,1.884113154 61 | 2019-08-17,1.850098132 62 | 2019-08-18,2.557653836 63 | 2019-08-19,1.77741858 64 | 2019-08-20,3.992968941 65 | 2019-08-21,3.435226067 66 | 2019-08-22,2.473489934 67 | 2019-08-23,2.677542606 68 | 2019-08-24,3.748528051 69 | 2019-08-25,3.53769202 70 | 2019-08-26,2.02770726 71 | 2019-08-27,2.970203765 72 | 2019-08-28,3.270680584 73 | 2019-08-29,3.120810544 74 | 2019-08-30,2.498501648 75 | 2019-08-31,3.45812054 76 | 2019-09-01,3.560609667 77 | 2019-09-02,2.287678965 78 | 2019-09-03,2.526866627 79 | 2019-09-04,3.03008709 80 | 2019-09-05,3.838391208 81 | 2019-09-06,3.262589587 82 | 2019-09-07,3.696167102 83 | 2019-09-08,3.690037054 84 | 2019-09-09,2.777754035 85 | 2019-09-10,2.939654659 86 | 2019-09-11,4.003852325 87 | 2019-09-12,3.411270218 88 | 2019-09-13,3.607649996 89 | 2019-09-14,4.495973571 90 | 2019-09-15,3.026560305 91 | 2019-09-16,3.977025379 92 | 2019-09-17,4.259463499 93 | 2019-09-18,3.892556695 94 | 2019-09-19,4.287024912 95 | 2019-09-20,4.086322908 96 | 2019-09-21,3.497258793 97 | 2019-09-22,3.515979854 98 | 2019-09-23,4.759740456 99 | 2019-09-24,3.583268854 100 | 2019-09-25,4.155044803 101 | 2019-09-26,4.06758142 102 | 2019-09-27,2.722273796 103 | 2019-09-28,4.323268206 104 | 2019-09-29,4.16665607 105 | 2019-09-30,4.149942684 106 | 2019-10-01,3.19643941 107 | 2019-10-02,3.927253962 108 | 2019-10-03,3.664425401 109 | 2019-10-04,3.451423754 110 | 2019-10-05,4.074038552 111 | 2019-10-06,2.60369932 112 | 2019-10-07,4.189048556 113 | 2019-10-08,3.276761636 114 | 2019-10-09,4.036061894 115 | 2019-10-10,3.125071527 116 | 2019-10-11,3.025076926 117 | 2019-10-12,3.75329682 118 | 2019-10-13,3.351816469 119 | 2019-10-14,3.384997935 120 | 2019-10-15,4.68339452 121 | 2019-10-16,2.774395763 122 | 2019-10-17,3.138649284 123 | 2019-10-18,3.17324516 124 | 2019-10-19,3.601379798 125 | 2019-10-20,4.548765457 126 | 2019-10-21,2.740079632 127 | 2019-10-22,4.032457257 128 | 2019-10-23,3.227661496 129 | 2019-10-24,2.995058709 130 | 2019-10-25,2.765815184 131 | 2019-10-26,3.281331793 132 | 2019-10-27,2.570239884 133 | 2019-10-28,2.494859718 134 | 2019-10-29,3.005889808 135 | 2019-10-30,3.10401616 136 | 2019-10-31,1.264893497 137 | 2019-11-01,3.408069261 138 | 2019-11-02,2.999534667 139 | 2019-11-03,2.270205835 140 | 2019-11-04,3.130795643 141 | 2019-11-05,2.552489037 142 | 2019-11-06,2.899242946 143 | 2019-11-07,2.182387613 144 | 2019-11-08,3.105456353 145 | 2019-11-09,2.633375862 146 | 2019-11-10,2.02821952 147 | 2019-11-11,2.389727864 148 | 2019-11-12,2.148200535 149 | 2019-11-13,1.885694315 150 | 2019-11-14,2.209838939 151 | 2019-11-15,2.957160444 152 | 2019-11-16,2.296137907 153 | 2019-11-17,2.684734294 154 | 2019-11-18,2.141806271 155 | 2019-11-19,1.393217937 156 | 2019-11-20,1.723003291 157 | 2019-11-21,2.558868694 158 | 2019-11-22,2.082147966 159 | 2019-11-23,1.942956533 160 | 2019-11-24,3.275566332 161 | 2019-11-25,2.047241552 162 | 2019-11-26,2.221237596 163 | 2019-11-27,1.341120655 164 | 2019-11-28,1.577872522 165 | 2019-11-29,2.778512083 166 | 2019-11-30,2.339952804 167 | 2019-12-01,2.613266044 168 | 2019-12-02,0.847136089 169 | 2019-12-03,2.105685069 170 | 2019-12-04,2.751661598 171 | 2019-12-05,1.324248097 172 | 2019-12-06,1.72403258 173 | 2019-12-07,1.212116067 174 | 2019-12-08,2.243227033 175 | 2019-12-09,1.961730225 176 | 2019-12-10,0.761587185 177 | 2019-12-11,1.729227264 178 | 2019-12-12,2.036867121 179 | 2019-12-13,1.890505487 180 | 2019-12-14,1.546458479 181 | 2019-12-15,0.554300885 182 | 2019-12-16,1.902297834 183 | 2019-12-17,1.857634558 184 | 2019-12-18,1.36475966 185 | 2019-12-19,2.351964576 186 | 2019-12-20,1.510739609 187 | 2019-12-21,1.168572427 188 | 2019-12-22,0.802247289 189 | 2019-12-23,2.80028835 190 | 2019-12-24,1.949306124 191 | 2019-12-25,1.0576713 192 | 2019-12-26,1.395967786 193 | 2019-12-27,1.807046178 194 | 2019-12-28,1.165364028 195 | 2019-12-29,0.834320928 196 | 2019-12-30,1.797230841 197 | 2019-12-31,2.229194476 198 | 2020-01-01,1.933786897 199 | 2020-01-02,1.098529365 200 | 2020-01-03,0.776611357 201 | 2020-01-04,2.00630586 202 | 2020-01-05,0.34538053 203 | 2020-01-06,0.931498362 204 | 2020-01-07,2.235574628 205 | 2020-01-08,1.34490249 206 | 2020-01-09,1.024250388 207 | 2020-01-10,1.413644986 208 | 2020-01-11,1.222172363 209 | 2020-01-12,0.780399082 210 | 2020-01-13,1.004191528 211 | 2020-01-14,0.789278308 212 | 2020-01-15,1.623339798 213 | 2020-01-16,3.051059549 214 | 2020-01-17,1.747114979 215 | 2020-01-18,0.767850895 216 | 2020-01-19,1.689123825 217 | 2020-01-20,0.492408279 218 | 2020-01-21,1.230615266 219 | 2020-01-22,1.050751304 220 | 2020-01-23,0.757051888 221 | 2020-01-24,2.330166561 222 | 2020-01-25,1.406919831 223 | 2020-01-26,2.226182069 224 | 2020-01-27,1.516779464 225 | 2020-01-28,2.798950432 226 | 2020-01-29,2.776490391 227 | 2020-01-30,1.886234756 228 | 2020-01-31,1.651415334 229 | 2020-02-01,2.528301361 230 | 2020-02-02,1.742764543 231 | 2020-02-03,2.712272478 232 | 2020-02-04,0.557608556 233 | 2020-02-05,2.424493188 234 | 2020-02-06,2.385402452 235 | 2020-02-07,2.675242471 236 | 2020-02-08,0.78273426 237 | 2020-02-09,2.603984005 238 | 2020-02-10,1.993924108 239 | 2020-02-11,2.414863749 240 | 2020-02-12,2.959083728 241 | 2020-02-13,1.33278614 242 | 2020-02-14,2.001007765 243 | 2020-02-15,1.946860365 244 | 2020-02-16,3.058689832 245 | 2020-02-17,2.206112397 246 | 2020-02-18,3.185160019 247 | 2020-02-19,1.180359243 248 | 2020-02-20,2.424075696 249 | 2020-02-21,1.926570646 250 | 2020-02-22,3.267245904 251 | 2020-02-23,2.398164613 252 | 2020-02-24,2.956007273 253 | 2020-02-25,2.162209721 254 | 2020-02-26,3.444514366 255 | 2020-02-27,2.265804275 256 | 2020-02-28,2.981247971 257 | 2020-02-29,1.974080753 258 | 2020-03-01,2.80164589 259 | 2020-03-02,2.521210416 260 | 2020-03-03,2.409984887 261 | 2020-03-04,2.760979 262 | 2020-03-05,3.026222395 263 | 2020-03-06,1.982610458 264 | 2020-03-07,3.06147982 265 | 2020-03-08,2.843071395 266 | 2020-03-09,2.256898308 267 | 2020-03-10,2.73692354 268 | 2020-03-11,2.549984851 269 | 2020-03-12,2.73355586 270 | 2020-03-13,3.172135565 271 | 2020-03-14,2.020774393 272 | 2020-03-15,2.974204767 273 | 2020-03-16,3.732319096 274 | 2020-03-17,3.058969339 275 | 2020-03-18,3.736651845 276 | 2020-03-19,2.853142081 277 | 2020-03-20,2.460395602 278 | 2020-03-21,2.329847155 279 | 2020-03-22,4.212835335 280 | 2020-03-23,3.925675286 281 | 2020-03-24,2.859446347 282 | 2020-03-25,3.113349024 283 | 2020-03-26,3.596025155 284 | 2020-03-27,4.035081727 285 | 2020-03-28,2.989447157 286 | 2020-03-29,4.57231764 287 | 2020-03-30,3.054410834 288 | 2020-03-31,3.270807179 289 | 2020-04-01,3.972889077 290 | 2020-04-02,3.755367453 291 | 2020-04-03,3.456755608 292 | 2020-04-04,3.165705455 293 | 2020-04-05,3.671043743 294 | 2020-04-06,2.968157517 295 | 2020-04-07,3.73676137 296 | 2020-04-08,3.356568858 297 | 2020-04-09,3.343624532 298 | 2020-04-10,4.475069598 299 | 2020-04-11,3.386573549 300 | 2020-04-12,3.240361984 301 | 2020-04-13,4.838630545 302 | 2020-04-14,4.001465556 303 | 2020-04-15,4.306986035 304 | 2020-04-16,3.405868364 305 | 2020-04-17,4.062119627 306 | 2020-04-18,3.603474888 307 | 2020-04-19,4.35368172 308 | 2020-04-20,3.656368977 309 | 2020-04-21,4.163864562 310 | 2020-04-22,3.67759044 311 | 2020-04-23,3.75979413 312 | 2020-04-24,3.183083201 313 | 2020-04-25,3.192808071 314 | 2020-04-26,3.011671353 315 | 2020-04-27,3.599344872 316 | 2020-04-28,4.599840572 317 | 2020-04-29,4.522095647 318 | 2020-04-30,4.503332886 319 | 2020-05-01,2.532477298 320 | 2020-05-02,3.987528107 321 | 2020-05-03,2.947582322 322 | 2020-05-04,3.685759124 323 | 2020-05-05,3.915132 324 | 2020-05-06,3.767760189 325 | 2020-05-07,4.040987269 326 | 2020-05-08,2.849767502 327 | 2020-05-09,4.000488161 328 | 2020-05-10,3.110930103 329 | 2020-05-11,3.512864881 330 | 2020-05-12,3.409223227 331 | 2020-05-13,3.793047526 332 | 2020-05-14,2.841968185 333 | 2020-05-15,3.208315053 334 | 2020-05-16,3.015543584 335 | 2020-05-17,4.879983907 336 | 2020-05-18,4.38313003 337 | 2020-05-19,2.445720113 338 | 2020-05-20,3.054862306 339 | 2020-05-21,3.249373866 340 | 2020-05-22,2.528891619 341 | 2020-05-23,3.223685857 342 | 2020-05-24,2.723319476 343 | 2020-05-25,3.334357724 344 | 2020-05-26,2.437260732 345 | 2020-05-27,3.698347269 346 | 2020-05-28,3.013787263 347 | 2020-05-29,2.454892352 348 | 2020-05-30,3.536872823 349 | 2020-05-31,2.327731696 350 | 2020-06-01,2.743873416 351 | 2020-06-02,2.863011351 352 | 2020-06-03,0.557253133 353 | 2020-06-04,2.244987608 354 | 2020-06-05,1.594438204 355 | 2020-06-06,1.70859957 356 | 2020-06-07,2.133874401 357 | 2020-06-08,2.570331572 358 | 2020-06-09,2.553930447 359 | 2020-06-10,1.710986291 360 | 2020-06-11,1.82871094 361 | 2020-06-12,1.903149291 362 | 2020-06-13,2.169573504 363 | 2020-06-14,2.741206003 364 | 2020-06-15,2.22671447 365 | 2020-06-16,2.828395547 366 | 2020-06-17,2.086898604 367 | 2020-06-18,2.563667945 368 | 2020-06-19,2.03198872 369 | 2020-06-20,2.040717997 370 | 2020-06-21,2.477842669 371 | 2020-06-22,2.174920285 372 | 2020-06-23,2.532429772 373 | 2020-06-24,2.211082736 374 | 2020-06-25,2.900457944 375 | 2020-06-26,1.449883646 376 | 2020-06-27,1.609409401 377 | 2020-06-28,1.392331718 378 | 2020-06-29,2.045065446 379 | 2020-06-30,2.268778116 380 | 2020-07-01,2.365563461 381 | 2020-07-02,0.794225795 382 | 2020-07-03,1.293051769 383 | 2020-07-04,0.687308099 384 | 2020-07-05,1.719054404 385 | 2020-07-06,1.888500032 386 | 2020-07-07,1.169997967 387 | 2020-07-08,1.404000702 388 | 2020-07-09,1.928908962 389 | 2020-07-10,1.587535377 390 | 2020-07-11,1.861500377 391 | 2020-07-12,1.143006341 392 | 2020-07-13,1.72774291 393 | 2020-07-14,1.511302435 394 | 2020-07-15,1.256879809 395 | 2020-07-16,1.724725459 396 | 2020-07-17,1.751181938 397 | 2020-07-18,0.407203829 398 | 2020-07-19,2.953307971 399 | 2020-07-20,0.886416391 400 | 2020-07-21,0.9548301 401 | 2020-07-22,0.690275178 402 | 2020-07-23,1.682394923 403 | 2020-07-24,1.113502014 404 | 2020-07-25,1.07602874 405 | 2020-07-26,1.446779953 406 | 2020-07-27,1.042170239 407 | 2020-07-28,1.121712137 408 | 2020-07-29,1.39821144 409 | 2020-07-30,0.923701407 410 | 2020-07-31,0.912547152 411 | 2020-08-01,1.639623281 412 | 2020-08-02,1.384320353 413 | 2020-08-03,2.173690928 414 | 2020-08-04,2.590705289 415 | 2020-08-05,1.733717126 416 | 2020-08-06,1.398225363 417 | 2020-08-07,1.473927938 418 | 2020-08-08,1.296444856 419 | 2020-08-09,1.919584433 420 | 2020-08-10,2.473525306 421 | 2020-08-11,0.268249926 422 | 2020-08-12,1.171694337 423 | 2020-08-13,1.302695185 424 | 2020-08-14,0.767409642 425 | 2020-08-15,0.702405908 426 | 2020-08-16,1.014703599 427 | 2020-08-17,3.126761157 428 | 2020-08-18,1.783935352 429 | 2020-08-19,2.341146011 430 | 2020-08-20,1.789607293 431 | 2020-08-21,0.825459658 432 | 2020-08-22,1.820018385 433 | 2020-08-23,1.904205394 434 | 2020-08-24,1.654085942 435 | 2020-08-25,2.105896009 436 | 2020-08-26,2.67172227 437 | 2020-08-27,1.531346434 438 | 2020-08-28,1.614618739 439 | 2020-08-29,2.416007941 440 | 2020-08-30,2.04793783 441 | 2020-08-31,2.238030004 442 | 2020-09-01,1.37157611 443 | 2020-09-02,2.161732473 444 | 2020-09-03,2.982273096 445 | 2020-09-04,2.258145735 446 | 2020-09-05,2.462965231 447 | 2020-09-06,2.2888197 448 | 2020-09-07,2.295479206 449 | 2020-09-08,2.761022956 450 | 2020-09-09,1.534319765 451 | 2020-09-10,2.485287872 452 | 2020-09-11,3.078998224 453 | 2020-09-12,1.796086285 454 | 2020-09-13,2.579660439 455 | 2020-09-14,3.373945268 456 | 2020-09-15,1.925454453 457 | 2020-09-16,2.974020437 458 | 2020-09-17,3.7280924 459 | 2020-09-18,4.023064506 460 | 2020-09-19,2.542362009 461 | 2020-09-20,3.389559231 462 | 2020-09-21,2.209748317 463 | 2020-09-22,2.395119006 464 | 2020-09-23,1.945736961 465 | 2020-09-24,3.3532429 466 | 2020-09-25,1.834877062 467 | 2020-09-26,2.410345852 468 | 2020-09-27,2.825422007 469 | 2020-09-28,3.388572881 470 | 2020-09-29,3.080185755 471 | 2020-09-30,3.477386023 472 | 2020-10-01,3.436798126 473 | 2020-10-02,3.666825957 474 | 2020-10-03,3.636194902 475 | 2020-10-04,2.854957313 476 | 2020-10-05,3.5326253 477 | 2020-10-06,3.182375813 478 | 2020-10-07,3.367834895 479 | 2020-10-08,2.837631102 480 | 2020-10-09,3.558563838 481 | 2020-10-10,4.126666825 482 | 2020-10-11,2.945184276 483 | 2020-10-12,3.60306096 484 | 2020-10-13,3.284618213 485 | 2020-10-14,2.956621803 486 | 2020-10-15,3.365252502 487 | 2020-10-16,3.696803763 488 | 2020-10-17,3.283791597 489 | 2020-10-18,3.556576155 490 | 2020-10-19,2.904721513 491 | 2020-10-20,4.695498173 492 | 2020-10-21,3.840458491 493 | 2020-10-22,3.562206974 494 | 2020-10-23,3.340357794 495 | 2020-10-24,4.560285801 496 | 2020-10-25,4.283943819 497 | 2020-10-26,4.182909938 498 | 2020-10-27,3.09212895 499 | 2020-10-28,5.192341886 500 | 2020-10-29,4.105928996 501 | 2020-10-30,4.23842055 502 | 2020-10-31,3.595933613 503 | 2020-11-01,4.384280934 504 | 2020-11-02,4.126475659 505 | 2020-11-03,2.810323936 506 | 2020-11-04,5.381424449 507 | 2020-11-05,4.10817018 508 | 2020-11-06,4.26108205 509 | 2020-11-07,4.231846194 510 | 2020-11-08,3.861001148 511 | 2020-11-09,4.404827208 512 | 2020-11-10,3.98104032 513 | 2020-11-11,3.967434647 514 | 2020-11-12,3.64224687 515 | 2020-11-13,4.578838767 516 | 2020-11-14,3.151817283 517 | 2020-11-15,2.510159802 518 | 2020-11-16,2.70181088 519 | 2020-11-17,3.132132005 520 | 2020-11-18,3.676346873 521 | 2020-11-19,3.797571653 522 | 2020-11-20,3.757464151 523 | 2020-11-21,3.283488708 524 | 2020-11-22,3.038153408 525 | 2020-11-23,4.104885916 526 | 2020-11-24,2.588059269 527 | 2020-11-25,3.360663942 528 | 2020-11-26,2.343102896 529 | 2020-11-27,3.025598607 530 | 2020-11-28,3.405308917 531 | 2020-11-29,2.873581495 532 | 2020-11-30,3.422480047 533 | 2020-12-01,2.518147237 534 | 2020-12-02,3.876792077 535 | 2020-12-03,2.825281374 536 | 2020-12-04,1.790740184 537 | 2020-12-05,1.850230178 538 | 2020-12-06,2.736077203 539 | 2020-12-07,2.218769671 540 | 2020-12-08,3.694650779 541 | 2020-12-09,2.47308669 542 | 2020-12-10,3.26230714 543 | 2020-12-11,2.201240337 544 | 2020-12-12,1.45982279 545 | 2020-12-13,2.268678116 546 | 2020-12-14,1.887269068 547 | 2020-12-15,1.89673641 548 | 2020-12-16,3.496960316 549 | 2020-12-17,2.515968637 550 | 2020-12-18,1.567374226 551 | 2020-12-19,3.36264044 552 | 2020-12-20,2.446110071 553 | 2020-12-21,2.630088693 554 | 2020-12-22,2.220374867 555 | 2020-12-23,2.267032745 556 | 2020-12-24,3.430875211 557 | 2020-12-25,1.936552454 558 | 2020-12-26,1.625415449 559 | 2020-12-27,1.537096503 560 | 2020-12-28,2.208799205 561 | 2020-12-29,2.698810309 562 | 2020-12-30,3.022046179 563 | 2020-12-31,1.503296633 564 | 2021-01-01,2.643780867 565 | 2021-01-02,2.480421814 566 | 2021-01-03,1.601674612 567 | 2021-01-04,1.906210693 568 | 2021-01-05,2.056920135 569 | 2021-01-06,2.067205451 570 | 2021-01-07,2.429714029 571 | 2021-01-08,1.51858857 572 | 2021-01-09,1.604228178 573 | 2021-01-10,1.616441139 574 | 2021-01-11,1.893604696 575 | 2021-01-12,1.823638281 576 | 2021-01-13,1.414801878 577 | 2021-01-14,2.499181083 578 | 2021-01-15,0.46961702 579 | 2021-01-16,1.944686315 580 | 2021-01-17,2.080794319 581 | 2021-01-18,2.309941129 582 | 2021-01-19,0.417192088 583 | 2021-01-20,0.610224096 584 | 2021-01-21,0.787674759 585 | 2021-01-22,0.902298441 586 | 2021-01-23,1.330160392 587 | 2021-01-24,0.703937075 588 | 2021-01-25,0.966760603 589 | 2021-01-26,0.996035706 590 | 2021-01-27,0.529368366 591 | 2021-01-28,1.040342422 592 | 2021-01-29,1.300921618 593 | 2021-01-30,0.567043274 594 | 2021-01-31,0.746513276 595 | 2021-02-01,-0.05220789 596 | 2021-02-02,1.76413023 597 | 2021-02-03,0.967991436 598 | 2021-02-04,1.668257618 599 | 2021-02-05,0.537259116 600 | 2021-02-06,0.397511579 601 | 2021-02-07,1.198622771 602 | -------------------------------------------------------------------------------- /grand/datasets/data/toy7/unit1.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,5.810200621 3 | 2019-06-20,4.496821365 4 | 2019-06-21,5.02118818 5 | 2019-06-22,5.201168681 6 | 2019-06-23,4.998686627 7 | 2019-06-24,4.357416041 8 | 2019-06-25,3.878968685 9 | 2019-06-26,5.493801 10 | 2019-06-27,5.635157894 11 | 2019-06-28,6.944901454 12 | 2019-06-29,4.170542168 13 | 2019-06-30,7.041337657 14 | 2019-07-01,6.366444271 15 | 2019-07-02,5.263871088 16 | 2019-07-03,6.885420159 17 | 2019-07-04,5.269539882 18 | 2019-07-05,6.494167689 19 | 2019-07-06,6.613847388 20 | 2019-07-07,7.113929552 21 | 2019-07-08,6.498599768 22 | 2019-07-09,6.940991409 23 | 2019-07-10,5.696413354 24 | 2019-07-11,7.069722339 25 | 2019-07-12,5.75423481 26 | 2019-07-13,5.168230074 27 | 2019-07-14,6.994830432 28 | 2019-07-15,5.898610316 29 | 2019-07-16,4.827713606 30 | 2019-07-17,6.116762045 31 | 2019-07-18,5.328621538 32 | 2019-07-19,4.47634386 33 | 2019-07-20,4.805225422 34 | 2019-07-21,5.300444884 35 | 2019-07-22,6.982673763 36 | 2019-07-23,7.726997799 37 | 2019-07-24,6.776775437 38 | 2019-07-25,6.459480355 39 | 2019-07-26,4.348547118 40 | 2019-07-27,6.796226394 41 | 2019-07-28,9.02837105 42 | 2019-07-29,5.394297865 43 | 2019-07-30,7.348888054 44 | 2019-07-31,6.08580594 45 | 2019-08-01,5.400504747 46 | 2019-08-02,4.400305878 47 | 2019-08-03,6.443586003 48 | 2019-08-04,5.621476347 49 | 2019-08-05,7.491405533 50 | 2019-08-06,6.302383958 51 | 2019-08-07,5.460450593 52 | 2019-08-08,6.20290934 53 | 2019-08-09,4.646999565 54 | 2019-08-10,6.351936228 55 | 2019-08-11,7.394975407 56 | 2019-08-12,8.097664871 57 | 2019-08-13,7.5070621 58 | 2019-08-14,6.506361377 59 | 2019-08-15,7.035364336 60 | 2019-08-16,6.072787896 61 | 2019-08-17,7.9758737 62 | 2019-08-18,7.043890206 63 | 2019-08-19,7.717113429 64 | 2019-08-20,7.415793282 65 | 2019-08-21,6.612518311 66 | 2019-08-22,6.735553396 67 | 2019-08-23,6.813790559 68 | 2019-08-24,6.123892707 69 | 2019-08-25,5.853920468 70 | 2019-08-26,7.065721422 71 | 2019-08-27,8.114974656 72 | 2019-08-28,8.704018286 73 | 2019-08-29,6.959527633 74 | 2019-08-30,7.217031109 75 | 2019-08-31,7.803904622 76 | 2019-09-01,8.913551446 77 | 2019-09-02,8.797724469 78 | 2019-09-03,7.825605731 79 | 2019-09-04,7.469784059 80 | 2019-09-05,5.899613174 81 | 2019-09-06,7.836377987 82 | 2019-09-07,8.678278447 83 | 2019-09-08,7.357044479 84 | 2019-09-09,8.94566077 85 | 2019-09-10,7.272848743 86 | 2019-09-11,6.690595763 87 | 2019-09-12,6.890348329 88 | 2019-09-13,7.212789923 89 | 2019-09-14,7.789320473 90 | 2019-09-15,7.544504421 91 | 2019-09-16,7.044165036 92 | 2019-09-17,7.516311168 93 | 2019-09-18,7.45673776 94 | 2019-09-19,7.64279076 95 | 2019-09-20,7.826871766 96 | 2019-09-21,8.97695107 97 | 2019-09-22,6.562434315 98 | 2019-09-23,8.522026129 99 | 2019-09-24,6.976183068 100 | 2019-09-25,9.407585782 101 | 2019-09-26,8.52639921 102 | 2019-09-27,8.71028105 103 | 2019-09-28,7.513418279 104 | 2019-09-29,8.22748513 105 | 2019-09-30,8.537897301 106 | 2019-10-01,8.493206988 107 | 2019-10-02,7.661527644 108 | 2019-10-03,10.12896337 109 | 2019-10-04,8.13924964 110 | 2019-10-05,8.249599422 111 | 2019-10-06,9.645120715 112 | 2019-10-07,8.820567764 113 | 2019-10-08,7.802268623 114 | 2019-10-09,7.77556733 115 | 2019-10-10,7.779864543 116 | 2019-10-11,6.619094599 117 | 2019-10-12,7.83065512 118 | 2019-10-13,5.800465194 119 | 2019-10-14,8.693170342 120 | 2019-10-15,6.634704638 121 | 2019-10-16,6.097866192 122 | 2019-10-17,7.028334409 123 | 2019-10-18,9.223475083 124 | 2019-10-19,7.024052192 125 | 2019-10-20,6.325932993 126 | 2019-10-21,7.048142555 127 | 2019-10-22,6.984493396 128 | 2019-10-23,7.281819453 129 | 2019-10-24,6.945456398 130 | 2019-10-25,7.804718218 131 | 2019-10-26,7.605289534 132 | 2019-10-27,5.219959191 133 | 2019-10-28,5.098701639 134 | 2019-10-29,5.825737179 135 | 2019-10-30,7.864710118 136 | 2019-10-31,7.690001837 137 | 2019-11-01,4.532923886 138 | 2019-11-02,6.700603924 139 | 2019-11-03,5.977581858 140 | 2019-11-04,7.199776734 141 | 2019-11-05,6.190602218 142 | 2019-11-06,5.916392724 143 | 2019-11-07,6.868265559 144 | 2019-11-08,7.649668924 145 | 2019-11-09,6.935774757 146 | 2019-11-10,8.516579236 147 | 2019-11-11,8.375414306 148 | 2019-11-12,6.450758501 149 | 2019-11-13,6.833969444 150 | 2019-11-14,5.492474567 151 | 2019-11-15,5.311769725 152 | 2019-11-16,8.63759988 153 | 2019-11-17,9.107624046 154 | 2019-11-18,6.260181675 155 | 2019-11-19,5.857764547 156 | 2019-11-20,6.229382784 157 | 2019-11-21,4.756416247 158 | 2019-11-22,6.515885288 159 | 2019-11-23,6.933164392 160 | 2019-11-24,5.828452822 161 | 2019-11-25,6.51138943 162 | 2019-11-26,7.371616327 163 | 2019-11-27,5.454501842 164 | 2019-11-28,5.003680164 165 | 2019-11-29,5.599912332 166 | 2019-11-30,5.38643382 167 | 2019-12-01,8.280701284 168 | 2019-12-02,4.731549968 169 | 2019-12-03,4.404604195 170 | 2019-12-04,5.695825134 171 | 2019-12-05,5.809795141 172 | 2019-12-06,5.847279459 173 | 2019-12-07,6.336426002 174 | 2019-12-08,6.073477748 175 | 2019-12-09,5.596966648 176 | 2019-12-10,5.709993868 177 | 2019-12-11,5.036033601 178 | 2019-12-12,6.012297452 179 | 2019-12-13,3.835482655 180 | 2019-12-14,3.507013782 181 | 2019-12-15,6.798312636 182 | 2019-12-16,4.835537983 183 | 2019-12-17,5.463735477 184 | 2019-12-18,4.998348355 185 | 2019-12-19,5.655515701 186 | 2019-12-20,5.961907083 187 | 2019-12-21,8.105590693 188 | 2019-12-22,4.675983624 189 | 2019-12-23,4.77692849 190 | 2019-12-24,6.225902772 191 | 2019-12-25,5.467518468 192 | 2019-12-26,6.545891817 193 | 2019-12-27,5.236886655 194 | 2019-12-28,6.605226352 195 | 2019-12-29,4.204941204 196 | 2019-12-30,4.752922763 197 | 2019-12-31,4.90792522 198 | 2020-01-01,6.746328244 199 | 2020-01-02,5.142402505 200 | 2020-01-03,3.670489826 201 | 2020-01-04,6.10801483 202 | 2020-01-05,3.491574027 203 | 2020-01-06,4.249342555 204 | 2020-01-07,5.982944788 205 | 2020-01-08,5.34894576 206 | 2020-01-09,3.62222816 207 | 2020-01-10,5.559303816 208 | 2020-01-11,4.653861781 209 | 2020-01-12,5.901556393 210 | 2020-01-13,5.387439338 211 | 2020-01-14,5.067203422 212 | 2020-01-15,6.206548596 213 | 2020-01-16,5.052299963 214 | 2020-01-17,3.871998147 215 | 2020-01-18,6.697000348 216 | 2020-01-19,5.343977883 217 | 2020-01-20,6.338333465 218 | 2020-01-21,4.73989208 219 | 2020-01-22,5.205866979 220 | 2020-01-23,4.215055907 221 | 2020-01-24,6.774786371 222 | 2020-01-25,4.539684138 223 | 2020-01-26,6.930316304 224 | 2020-01-27,5.823016497 225 | 2020-01-28,6.561847999 226 | 2020-01-29,5.601438799 227 | 2020-01-30,5.449740774 228 | 2020-01-31,5.339954132 229 | 2020-02-01,5.518084599 230 | 2020-02-02,6.99284257 231 | 2020-02-03,6.657193324 232 | 2020-02-04,7.094195763 233 | 2020-02-05,4.969404871 234 | 2020-02-06,5.795178657 235 | 2020-02-07,5.9294909 236 | 2020-02-08,6.200046893 237 | 2020-02-09,6.429544216 238 | 2020-02-10,7.229406776 239 | 2020-02-11,6.200828366 240 | 2020-02-12,6.00648389 241 | 2020-02-13,7.19596346 242 | 2020-02-14,7.060956765 243 | 2020-02-15,6.403637935 244 | 2020-02-16,5.762743921 245 | 2020-02-17,7.912068449 246 | 2020-02-18,6.498841788 247 | 2020-02-19,6.353473051 248 | 2020-02-20,6.986884263 249 | 2020-02-21,4.686251325 250 | 2020-02-22,5.199663046 251 | 2020-02-23,7.152074477 252 | 2020-02-24,5.280848787 253 | 2020-02-25,6.02175895 254 | 2020-02-26,6.347637328 255 | 2020-02-27,4.771950935 256 | 2020-02-28,5.347637327 257 | 2020-02-29,6.329472395 258 | 2020-03-01,5.97475997 259 | 2020-03-02,4.677881046 260 | 2020-03-03,7.535689995 261 | 2020-03-04,7.399520418 262 | 2020-03-05,7.699861047 263 | 2020-03-06,7.158081969 264 | 2020-03-07,6.453776609 265 | 2020-03-08,7.702649503 266 | 2020-03-09,5.839191158 267 | 2020-03-10,6.210363058 268 | 2020-03-11,6.859415588 269 | 2020-03-12,6.233994684 270 | 2020-03-13,7.908783966 271 | 2020-03-14,5.390538864 272 | 2020-03-15,6.512488583 273 | 2020-03-16,7.692110797 274 | 2020-03-17,6.343388276 275 | 2020-03-18,7.402301365 276 | 2020-03-19,6.68361437 277 | 2020-03-20,7.631528348 278 | 2020-03-21,6.634360964 279 | 2020-03-22,7.413685718 280 | 2020-03-23,7.330862555 281 | 2020-03-24,7.102248631 282 | 2020-03-25,8.65287753 283 | 2020-03-26,7.902969096 284 | 2020-03-27,6.236123001 285 | 2020-03-28,6.543631328 286 | 2020-03-29,7.691807587 287 | 2020-03-30,7.304254358 288 | 2020-03-31,6.182466798 289 | 2020-04-01,4.926384429 290 | 2020-04-02,7.140069533 291 | 2020-04-03,7.637690931 292 | 2020-04-04,7.340317965 293 | 2020-04-05,9.044369177 294 | 2020-04-06,5.203484651 295 | 2020-04-07,8.814590011 296 | 2020-04-08,8.707728703 297 | 2020-04-09,8.259887523 298 | 2020-04-10,7.581052767 299 | 2020-04-11,7.764846609 300 | 2020-04-12,8.215977905 301 | 2020-04-13,8.41941532 302 | 2020-04-14,7.958465535 303 | 2020-04-15,6.955486188 304 | 2020-04-16,7.616892928 305 | 2020-04-17,6.846936703 306 | 2020-04-18,6.973645611 307 | 2020-04-19,6.799138497 308 | 2020-04-20,7.814652663 309 | 2020-04-21,9.128310495 310 | 2020-04-22,8.655001817 311 | 2020-04-23,7.135330608 312 | 2020-04-24,7.416147433 313 | 2020-04-25,7.155477174 314 | 2020-04-26,8.868725283 315 | 2020-04-27,8.452253072 316 | 2020-04-28,7.6509602 317 | 2020-04-29,8.4187934 318 | 2020-04-30,8.591690115 319 | 2020-05-01,7.997773309 320 | 2020-05-02,8.324215452 321 | 2020-05-03,6.739377478 322 | 2020-05-04,5.56791819 323 | 2020-05-05,7.524270375 324 | 2020-05-06,8.355791765 325 | 2020-05-07,9.368318648 326 | 2020-05-08,7.096695375 327 | 2020-05-09,6.93021486 328 | 2020-05-10,6.957382922 329 | 2020-05-11,6.682085003 330 | 2020-05-12,7.400761596 331 | 2020-05-13,9.131352034 332 | 2020-05-14,6.665778718 333 | 2020-05-15,7.634828969 334 | 2020-05-16,8.223148449 335 | 2020-05-17,7.180571258 336 | 2020-05-18,5.330566678 337 | 2020-05-19,5.991809018 338 | 2020-05-20,5.795394608 339 | 2020-05-21,6.914789563 340 | 2020-05-22,6.159505848 341 | 2020-05-23,9.351095483 342 | 2020-05-24,7.520406562 343 | 2020-05-25,6.747258713 344 | 2020-05-26,5.452779986 345 | 2020-05-27,6.710791838 346 | 2020-05-28,6.8755513 347 | 2020-05-29,5.834631879 348 | 2020-05-30,6.281901529 349 | 2020-05-31,8.172285639 350 | 2020-06-01,5.490637246 351 | 2020-06-02,4.805200273 352 | 2020-06-03,5.414610194 353 | 2020-06-04,5.761046291 354 | 2020-06-05,6.349758825 355 | 2020-06-06,5.580914038 356 | 2020-06-07,6.937160844 357 | 2020-06-08,5.711508718 358 | 2020-06-09,7.2091156 359 | 2020-06-10,4.801473023 360 | 2020-06-11,4.948858633 361 | 2020-06-12,4.392960718 362 | 2020-06-13,7.83247334 363 | 2020-06-14,7.079618108 364 | 2020-06-15,6.894826916 365 | 2020-06-16,5.329262888 366 | 2020-06-17,6.775318145 367 | 2020-06-18,5.620498456 368 | 2020-06-19,6.61076962 369 | 2020-06-20,6.169543293 370 | 2020-06-21,7.017275718 371 | 2020-06-22,5.518996132 372 | 2020-06-23,5.812008788 373 | 2020-06-24,6.424382211 374 | 2020-06-25,5.17357383 375 | 2020-06-26,4.247104998 376 | 2020-06-27,6.864405633 377 | 2020-06-28,4.738015537 378 | 2020-06-29,6.991804222 379 | 2020-06-30,4.1849968 380 | 2020-07-01,5.477216637 381 | 2020-07-02,5.191869997 382 | 2020-07-03,6.775071813 383 | 2020-07-04,4.629320187 384 | 2020-07-05,5.590209207 385 | 2020-07-06,6.261540289 386 | 2020-07-07,5.988576474 387 | 2020-07-08,4.671378261 388 | 2020-07-09,5.790571743 389 | 2020-07-10,6.0240433 390 | 2020-07-11,6.814617198 391 | 2020-07-12,5.514354394 392 | 2020-07-13,6.438797234 393 | 2020-07-14,5.009967907 394 | 2020-07-15,4.542461033 395 | 2020-07-16,5.12308827 396 | 2020-07-17,5.145283922 397 | 2020-07-18,3.172932757 398 | 2020-07-19,5.607960561 399 | 2020-07-20,4.479587333 400 | 2020-07-21,5.438447417 401 | 2020-07-22,4.716984647 402 | 2020-07-23,4.943480156 403 | 2020-07-24,6.417920809 404 | 2020-07-25,5.146704022 405 | 2020-07-26,4.339786812 406 | 2020-07-27,3.645013461 407 | 2020-07-28,6.438465629 408 | 2020-07-29,5.695634231 409 | 2020-07-30,5.808476935 410 | 2020-07-31,5.627004519 411 | 2020-08-01,5.685496515 412 | 2020-08-02,3.652855804 413 | 2020-08-03,4.947785402 414 | 2020-08-04,5.032877435 415 | 2020-08-05,6.256362766 416 | 2020-08-06,6.588640456 417 | 2020-08-07,4.581337154 418 | 2020-08-08,5.988732836 419 | 2020-08-09,7.095342737 420 | 2020-08-10,6.16737645 421 | 2020-08-11,7.069872921 422 | 2020-08-12,5.602568949 423 | 2020-08-13,4.753841089 424 | 2020-08-14,4.244942033 425 | 2020-08-15,7.585987641 426 | 2020-08-16,3.91808627 427 | 2020-08-17,6.5624723 428 | 2020-08-18,4.40320289 429 | 2020-08-19,7.068673134 430 | 2020-08-20,3.685261416 431 | 2020-08-21,4.558313099 432 | 2020-08-22,5.020730464 433 | 2020-08-23,6.372851323 434 | 2020-08-24,5.046787243 435 | 2020-08-25,6.815984577 436 | 2020-08-26,7.867101839 437 | 2020-08-27,5.674560687 438 | 2020-08-28,5.687990032 439 | 2020-08-29,4.507225353 440 | 2020-08-30,8.34072659 441 | 2020-08-31,6.467072984 442 | 2020-09-01,6.275955079 443 | 2020-09-02,7.012095761 444 | 2020-09-03,5.863326756 445 | 2020-09-04,6.312549876 446 | 2020-09-05,5.585285451 447 | 2020-09-06,6.721358383 448 | 2020-09-07,4.715221616 449 | 2020-09-08,8.345586991 450 | 2020-09-09,6.595136091 451 | 2020-09-10,7.467961229 452 | 2020-09-11,6.475952035 453 | 2020-09-12,7.048595035 454 | 2020-09-13,7.404990287 455 | 2020-09-14,7.493880879 456 | 2020-09-15,5.609821835 457 | 2020-09-16,5.325083534 458 | 2020-09-17,7.977158654 459 | 2020-09-18,7.321744664 460 | 2020-09-19,5.873550799 461 | 2020-09-20,8.018364959 462 | 2020-09-21,8.330943758 463 | 2020-09-22,7.739787559 464 | 2020-09-23,6.88844857 465 | 2020-09-24,5.66875187 466 | 2020-09-25,7.156891798 467 | 2020-09-26,6.094963261 468 | 2020-09-27,5.424675599 469 | 2020-09-28,7.090517626 470 | 2020-09-29,7.765448321 471 | 2020-09-30,7.504754865 472 | 2020-10-01,6.568757885 473 | 2020-10-02,7.897945247 474 | 2020-10-03,7.392942261 475 | 2020-10-04,6.488276104 476 | 2020-10-05,5.595626689 477 | 2020-10-06,7.222422666 478 | 2020-10-07,8.837708856 479 | 2020-10-08,8.209039081 480 | 2020-10-09,8.098150419 481 | 2020-10-10,8.511992841 482 | 2020-10-11,7.106227208 483 | 2020-10-12,8.594523148 484 | 2020-10-13,7.852009757 485 | 2020-10-14,7.634934521 486 | 2020-10-15,8.970117286 487 | 2020-10-16,7.715816727 488 | 2020-10-17,8.313497971 489 | 2020-10-18,8.163935872 490 | 2020-10-19,7.757978845 491 | 2020-10-20,6.923574963 492 | 2020-10-21,8.644213315 493 | 2020-10-22,9.009116389 494 | 2020-10-23,7.538066821 495 | 2020-10-24,7.054386813 496 | 2020-10-25,7.391268035 497 | 2020-10-26,7.921808682 498 | 2020-10-27,7.329354184 499 | 2020-10-28,8.115742201 500 | 2020-10-29,7.622661622 501 | 2020-10-30,6.693723706 502 | 2020-10-31,8.668343876 503 | 2020-11-01,6.504374872 504 | 2020-11-02,7.026697296 505 | 2020-11-03,6.75528149 506 | 2020-11-04,6.621509088 507 | 2020-11-05,8.870731688 508 | 2020-11-06,7.551216398 509 | 2020-11-07,8.216223662 510 | 2020-11-08,8.099570232 511 | 2020-11-09,5.770689427 512 | 2020-11-10,6.585808913 513 | 2020-11-11,6.819262 514 | 2020-11-12,8.310598402 515 | 2020-11-13,7.688834402 516 | 2020-11-14,7.781761587 517 | 2020-11-15,8.579298367 518 | 2020-11-16,7.97635573 519 | 2020-11-17,7.363452832 520 | 2020-11-18,8.184944532 521 | 2020-11-19,9.115312495 522 | 2020-11-20,7.757931541 523 | 2020-11-21,5.773573392 524 | 2020-11-22,7.197975289 525 | 2020-11-23,7.462410267 526 | 2020-11-24,7.330617192 527 | 2020-11-25,7.002674754 528 | 2020-11-26,7.50526475 529 | 2020-11-27,8.283895986 530 | 2020-11-28,6.902233129 531 | 2020-11-29,8.051613724 532 | 2020-11-30,7.801718098 533 | 2020-12-01,7.241095595 534 | 2020-12-02,9.057528156 535 | 2020-12-03,4.584028793 536 | 2020-12-04,7.170405719 537 | 2020-12-05,5.534427215 538 | 2020-12-06,7.5059893 539 | 2020-12-07,6.532795446 540 | 2020-12-08,9.596372109 541 | 2020-12-09,6.990002731 542 | 2020-12-10,7.660761649 543 | 2020-12-11,5.533619518 544 | 2020-12-12,5.578268745 545 | 2020-12-13,8.175349135 546 | 2020-12-14,7.504035144 547 | 2020-12-15,6.036030749 548 | 2020-12-16,6.400464695 549 | 2020-12-17,6.015007002 550 | 2020-12-18,7.300555334 551 | 2020-12-19,4.347697692 552 | 2020-12-20,6.757277905 553 | 2020-12-21,5.903916195 554 | 2020-12-22,6.145198528 555 | 2020-12-23,6.41393505 556 | 2020-12-24,7.72627223 557 | 2020-12-25,5.760975859 558 | 2020-12-26,7.134883082 559 | 2020-12-27,5.105692304 560 | 2020-12-28,4.742114042 561 | 2020-12-29,6.050476444 562 | 2020-12-30,6.542144007 563 | 2020-12-31,5.922688963 564 | 2021-01-01,7.133560621 565 | 2021-01-02,6.942579233 566 | 2021-01-03,5.303283932 567 | 2021-01-04,5.845120543 568 | 2021-01-05,4.578134448 569 | 2021-01-06,3.990362778 570 | 2021-01-07,4.660835104 571 | 2021-01-08,5.667502184 572 | 2021-01-09,4.681495709 573 | 2021-01-10,6.642660078 574 | 2021-01-11,6.005259218 575 | 2021-01-12,4.219726293 576 | 2021-01-13,5.529119158 577 | 2021-01-14,4.002277459 578 | 2021-01-15,6.409214964 579 | 2021-01-16,5.679738989 580 | 2021-01-17,6.254809747 581 | 2021-01-18,7.667121948 582 | 2021-01-19,6.211903247 583 | 2021-01-20,5.173744766 584 | 2021-01-21,3.717757598 585 | 2021-01-22,6.581682714 586 | 2021-01-23,3.818607461 587 | 2021-01-24,5.924897228 588 | 2021-01-25,5.685830587 589 | 2021-01-26,5.431249778 590 | 2021-01-27,4.703459423 591 | 2021-01-28,5.030981236 592 | 2021-01-29,2.936374064 593 | 2021-01-30,5.238944683 594 | 2021-01-31,7.743764818 595 | 2021-02-01,5.813291175 596 | 2021-02-02,4.90300873 597 | 2021-02-03,5.841015243 598 | 2021-02-04,5.945625438 599 | 2021-02-05,3.703585447 600 | 2021-02-06,4.113113631 601 | 2021-02-07,3.997047996 602 | -------------------------------------------------------------------------------- /grand/datasets/data/toy2/unit1.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,6.801000426 3 | 2019-06-20,4.12627831 4 | 2019-06-21,4.512519353 5 | 2019-06-22,5.149094455 6 | 2019-06-23,6.422086165 7 | 2019-06-24,4.34883118 8 | 2019-06-25,3.262734127 9 | 2019-06-26,5.473498917 10 | 2019-06-27,4.217333985 11 | 2019-06-28,5.222905782 12 | 2019-06-29,8.588149052 13 | 2019-06-30,5.95450349 14 | 2019-07-01,7.283542031 15 | 2019-07-02,4.712840306 16 | 2019-07-03,4.629393915 17 | 2019-07-04,6.086227219 18 | 2019-07-05,5.050108155 19 | 2019-07-06,5.311463913 20 | 2019-07-07,6.042587901 21 | 2019-07-08,8.226400339 22 | 2019-07-09,7.138740263 23 | 2019-07-10,5.653723921 24 | 2019-07-11,4.992296651 25 | 2019-07-12,5.794500801 26 | 2019-07-13,5.611679002 27 | 2019-07-14,6.404353469 28 | 2019-07-15,6.393720671 29 | 2019-07-16,6.261197166 30 | 2019-07-17,4.182088619 31 | 2019-07-18,5.106933569 32 | 2019-07-19,6.783914613 33 | 2019-07-20,6.155337889 34 | 2019-07-21,7.261446731 35 | 2019-07-22,6.402594832 36 | 2019-07-23,5.47322715 37 | 2019-07-24,7.01263765 38 | 2019-07-25,4.957814304 39 | 2019-07-26,6.499049268 40 | 2019-07-27,6.834280539 41 | 2019-07-28,6.947015847 42 | 2019-07-29,4.940727409 43 | 2019-07-30,4.797547658 44 | 2019-07-31,6.361480065 45 | 2019-08-01,7.765038326 46 | 2019-08-02,7.134000728 47 | 2019-08-03,7.111208925 48 | 2019-08-04,7.864515743 49 | 2019-08-05,8.225278232 50 | 2019-08-06,5.925464397 51 | 2019-08-07,6.704224139 52 | 2019-08-08,5.806929471 53 | 2019-08-09,5.585109578 54 | 2019-08-10,7.060274258 55 | 2019-08-11,7.128396185 56 | 2019-08-12,6.093820789 57 | 2019-08-13,7.821485121 58 | 2019-08-14,5.563775245 59 | 2019-08-15,5.807184947 60 | 2019-08-16,7.619449031 61 | 2019-08-17,5.953051795 62 | 2019-08-18,6.224418924 63 | 2019-08-19,5.87277742 64 | 2019-08-20,6.442403838 65 | 2019-08-21,8.846782684 66 | 2019-08-22,8.003635638 67 | 2019-08-23,6.598624318 68 | 2019-08-24,4.767169051 69 | 2019-08-25,7.778649478 70 | 2019-08-26,8.024429693 71 | 2019-08-27,7.707245709 72 | 2019-08-28,7.733125238 73 | 2019-08-29,7.458159897 74 | 2019-08-30,6.82946536 75 | 2019-08-31,7.135386114 76 | 2019-09-01,6.274789066 77 | 2019-09-02,6.727158806 78 | 2019-09-03,7.159832545 79 | 2019-09-04,5.095191372 80 | 2019-09-05,7.792144238 81 | 2019-09-06,8.501877625 82 | 2019-09-07,7.220702609 83 | 2019-09-08,6.671980899 84 | 2019-09-09,7.209643092 85 | 2019-09-10,7.310393784 86 | 2019-09-11,6.032285824 87 | 2019-09-12,9.203311349 88 | 2019-09-13,7.44903286 89 | 2019-09-14,5.941360009 90 | 2019-09-15,8.397092988 91 | 2019-09-16,6.885116 92 | 2019-09-17,7.865462386 93 | 2019-09-18,6.996435233 94 | 2019-09-19,7.435547586 95 | 2019-09-20,7.680501472 96 | 2019-09-21,7.532037031 97 | 2019-09-22,7.650897159 98 | 2019-09-23,7.47607631 99 | 2019-09-24,8.640717205 100 | 2019-09-25,8.899377158 101 | 2019-09-26,7.276108348 102 | 2019-09-27,6.44243893 103 | 2019-09-28,9.033410684 104 | 2019-09-29,6.958111297 105 | 2019-09-30,9.034487319 106 | 2019-10-01,8.994464527 107 | 2019-10-02,7.699872645 108 | 2019-10-03,6.727888819 109 | 2019-10-04,7.920492089 110 | 2019-10-05,8.027636668 111 | 2019-10-06,6.936375146 112 | 2019-10-07,8.786631798 113 | 2019-10-08,5.848587959 114 | 2019-10-09,6.468690754 115 | 2019-10-10,6.891716335 116 | 2019-10-11,7.212787124 117 | 2019-10-12,7.309385376 118 | 2019-10-13,7.632443748 119 | 2019-10-14,5.855978 120 | 2019-10-15,6.84981165 121 | 2019-10-16,7.522365972 122 | 2019-10-17,7.919035929 123 | 2019-10-18,8.604152028 124 | 2019-10-19,6.383136681 125 | 2019-10-20,7.701588022 126 | 2019-10-21,7.288913103 127 | 2019-10-22,7.645630229 128 | 2019-10-23,6.877446888 129 | 2019-10-24,6.862438975 130 | 2019-10-25,7.122998195 131 | 2019-10-26,6.292911538 132 | 2019-10-27,6.279769222 133 | 2019-10-28,5.932236303 134 | 2019-10-29,8.19664726 135 | 2019-10-30,4.98203686 136 | 2019-10-31,5.145364189 137 | 2019-11-01,7.131212351 138 | 2019-11-02,7.566831528 139 | 2019-11-03,7.719843001 140 | 2019-11-04,7.788296257 141 | 2019-11-05,5.698930973 142 | 2019-11-06,5.223972662 143 | 2019-11-07,7.536222117 144 | 2019-11-08,7.098360386 145 | 2019-11-09,6.544501667 146 | 2019-11-10,7.890824127 147 | 2019-11-11,5.373928215 148 | 2019-11-12,7.725680558 149 | 2019-11-13,8.837724186 150 | 2019-11-14,8.103753281 151 | 2019-11-15,7.231805096 152 | 2019-11-16,8.340134199 153 | 2019-11-17,7.123265627 154 | 2019-11-18,7.716038756 155 | 2019-11-19,5.522708414 156 | 2019-11-20,5.230724677 157 | 2019-11-21,7.325591227 158 | 2019-11-22,7.035407654 159 | 2019-11-23,6.997977802 160 | 2019-11-24,5.973829612 161 | 2019-11-25,6.599560749 162 | 2019-11-26,7.546684034 163 | 2019-11-27,5.448145118 164 | 2019-11-28,7.412011619 165 | 2019-11-29,7.153506694 166 | 2019-11-30,6.994533619 167 | 2019-12-01,6.850725919 168 | 2019-12-02,5.325951954 169 | 2019-12-03,5.265921717 170 | 2019-12-04,6.044905162 171 | 2019-12-05,6.554545861 172 | 2019-12-06,7.860026118 173 | 2019-12-07,5.116858936 174 | 2019-12-08,4.819106028 175 | 2019-12-09,5.419939967 176 | 2019-12-10,6.4886008 177 | 2019-12-11,6.624135648 178 | 2019-12-12,6.835527826 179 | 2019-12-13,4.403933832 180 | 2019-12-14,6.387268094 181 | 2019-12-15,6.060825434 182 | 2019-12-16,6.323409019 183 | 2019-12-17,5.625422892 184 | 2019-12-18,5.999223264 185 | 2019-12-19,5.450975277 186 | 2019-12-20,4.584372394 187 | 2019-12-21,4.73597206 188 | 2019-12-22,4.508640145 189 | 2019-12-23,4.13338066 190 | 2019-12-24,4.960154457 191 | 2019-12-25,7.68354618 192 | 2019-12-26,4.806795983 193 | 2019-12-27,5.824400683 194 | 2019-12-28,4.985225935 195 | 2019-12-29,5.267790347 196 | 2019-12-30,3.340819705 197 | 2019-12-31,3.486672217 198 | 2020-01-01,5.514189577 199 | 2020-01-02,3.623651523 200 | 2020-01-03,7.196377436 201 | 2020-01-04,4.807899114 202 | 2020-01-05,5.882236104 203 | 2020-01-06,5.313186787 204 | 2020-01-07,6.484901372 205 | 2020-01-08,5.024811629 206 | 2020-01-09,6.500468152 207 | 2020-01-10,6.763850184 208 | 2020-01-11,6.80446365 209 | 2020-01-12,4.327907214 210 | 2020-01-13,3.979042072 211 | 2020-01-14,4.596327926 212 | 2020-01-15,4.277563562 213 | 2020-01-16,3.618883373 214 | 2020-01-17,5.825612748 215 | 2020-01-18,4.421483439 216 | 2020-01-19,4.132141834 217 | 2020-01-20,4.579564302 218 | 2020-01-21,6.800233056 219 | 2020-01-22,4.52092565 220 | 2020-01-23,5.088574659 221 | 2020-01-24,3.088080261 222 | 2020-01-25,5.964800613 223 | 2020-01-26,5.418085431 224 | 2020-01-27,6.182175628 225 | 2020-01-28,4.630516037 226 | 2020-01-29,5.453508076 227 | 2020-01-30,5.791344232 228 | 2020-01-31,4.584504945 229 | 2020-02-01,6.940234131 230 | 2020-02-02,5.371077739 231 | 2020-02-03,6.082065586 232 | 2020-02-04,7.300249954 233 | 2020-02-05,5.68013929 234 | 2020-02-06,6.788705509 235 | 2020-02-07,4.776894548 236 | 2020-02-08,4.392446725 237 | 2020-02-09,7.733584303 238 | 2020-02-10,6.297655466 239 | 2020-02-11,5.731980195 240 | 2020-02-12,4.302739383 241 | 2020-02-13,5.875592475 242 | 2020-02-14,7.108410897 243 | 2020-02-15,7.248930976 244 | 2020-02-16,6.04004035 245 | 2020-02-17,6.918705294 246 | 2020-02-18,6.485166478 247 | 2020-02-19,3.736891387 248 | 2020-02-20,5.592603795 249 | 2020-02-21,3.843018298 250 | 2020-02-22,5.923222463 251 | 2020-02-23,4.929606755 252 | 2020-02-24,7.423059547 253 | 2020-02-25,7.366979772 254 | 2020-02-26,7.407878841 255 | 2020-02-27,6.861370241 256 | 2020-02-28,7.368365886 257 | 2020-02-29,6.217670892 258 | 2020-03-01,7.578772517 259 | 2020-03-02,4.941475478 260 | 2020-03-03,8.136018717 261 | 2020-03-04,7.740133413 262 | 2020-03-05,4.157579047 263 | 2020-03-06,6.340458949 264 | 2020-03-07,7.062463325 265 | 2020-03-08,5.985296856 266 | 2020-03-09,6.807497893 267 | 2020-03-10,6.085248457 268 | 2020-03-11,5.680942381 269 | 2020-03-12,8.256580305 270 | 2020-03-13,8.571442105 271 | 2020-03-14,6.916998317 272 | 2020-03-15,8.636359349 273 | 2020-03-16,6.50275914 274 | 2020-03-17,6.903023735 275 | 2020-03-18,6.61264282 276 | 2020-03-19,7.246139531 277 | 2020-03-20,6.762080015 278 | 2020-03-21,8.550853887 279 | 2020-03-22,6.597529736 280 | 2020-03-23,6.60705261 281 | 2020-03-24,7.501595458 282 | 2020-03-25,7.854611925 283 | 2020-03-26,6.972289199 284 | 2020-03-27,9.01228227 285 | 2020-03-28,6.17741809 286 | 2020-03-29,8.90869019 287 | 2020-03-30,9.077956256 288 | 2020-03-31,7.378767837 289 | 2020-04-01,8.969517467 290 | 2020-04-02,7.780359019 291 | 2020-04-03,5.452590163 292 | 2020-04-04,8.094790673 293 | 2020-04-05,7.533315154 294 | 2020-04-06,7.253114659 295 | 2020-04-07,7.927503833 296 | 2020-04-08,8.050336331 297 | 2020-04-09,7.812540816 298 | 2020-04-10,8.04673555 299 | 2020-04-11,8.080215894 300 | 2020-04-12,7.71124181 301 | 2020-04-13,9.327950565 302 | 2020-04-14,9.594370431 303 | 2020-04-15,7.630074097 304 | 2020-04-16,8.771662796 305 | 2020-04-17,9.840396079 306 | 2020-04-18,7.37479644 307 | 2020-04-19,8.556920491 308 | 2020-04-20,7.00233798 309 | 2020-04-21,7.387821246 310 | 2020-04-22,7.565891684 311 | 2020-04-23,7.599751738 312 | 2020-04-24,7.628032819 313 | 2020-04-25,7.916223837 314 | 2020-04-26,6.981658607 315 | 2020-04-27,9.241450825 316 | 2020-04-28,7.015143899 317 | 2020-04-29,6.155261491 318 | 2020-04-30,8.692948802 319 | 2020-05-01,7.981831698 320 | 2020-05-02,7.591662477 321 | 2020-05-03,5.781303805 322 | 2020-05-04,6.183378116 323 | 2020-05-05,7.054882435 324 | 2020-05-06,6.484413594 325 | 2020-05-07,8.919854524 326 | 2020-05-08,6.639008845 327 | 2020-05-09,8.072166186 328 | 2020-05-10,8.112390684 329 | 2020-05-11,8.173731857 330 | 2020-05-12,7.849082536 331 | 2020-05-13,6.102152092 332 | 2020-05-14,8.142248194 333 | 2020-05-15,6.410583855 334 | 2020-05-16,6.501748004 335 | 2020-05-17,6.957231482 336 | 2020-05-18,4.92548692 337 | 2020-05-19,6.526300432 338 | 2020-05-20,6.265868988 339 | 2020-05-21,7.360398044 340 | 2020-05-22,8.148957957 341 | 2020-05-23,8.089303328 342 | 2020-05-24,4.944849324 343 | 2020-05-25,5.394691357 344 | 2020-05-26,7.327622874 345 | 2020-05-27,6.549003959 346 | 2020-05-28,6.865470843 347 | 2020-05-29,6.96433392 348 | 2020-05-30,7.850595037 349 | 2020-05-31,5.914362351 350 | 2020-06-01,4.921465926 351 | 2020-06-02,8.014486671 352 | 2020-06-03,6.723640997 353 | 2020-06-04,6.725715381 354 | 2020-06-05,7.144826282 355 | 2020-06-06,6.328091463 356 | 2020-06-07,5.649099676 357 | 2020-06-08,5.880629287 358 | 2020-06-09,6.73581471 359 | 2020-06-10,5.270217775 360 | 2020-06-11,6.708347715 361 | 2020-06-12,6.308745404 362 | 2020-06-13,5.800815447 363 | 2020-06-14,5.792747809 364 | 2020-06-15,6.444735524 365 | 2020-06-16,5.465359511 366 | 2020-06-17,6.954823219 367 | 2020-06-18,6.252518156 368 | 2020-06-19,6.903312209 369 | 2020-06-20,5.63603097 370 | 2020-06-21,4.671788811 371 | 2020-06-22,6.452596414 372 | 2020-06-23,5.020564585 373 | 2020-06-24,5.814058808 374 | 2020-06-25,6.397810048 375 | 2020-06-26,6.632648968 376 | 2020-06-27,5.301923777 377 | 2020-06-28,5.654234957 378 | 2020-06-29,6.524530882 379 | 2020-06-30,6.771304971 380 | 2020-07-01,5.770132341 381 | 2020-07-02,5.091303382 382 | 2020-07-03,6.494641062 383 | 2020-07-04,6.167516918 384 | 2020-07-05,7.27478428 385 | 2020-07-06,5.995495551 386 | 2020-07-07,5.680389539 387 | 2020-07-08,5.592720363 388 | 2020-07-09,3.300222045 389 | 2020-07-10,4.162387656 390 | 2020-07-11,4.920089365 391 | 2020-07-12,6.490106967 392 | 2020-07-13,6.20165285 393 | 2020-07-14,4.773439067 394 | 2020-07-15,5.759674078 395 | 2020-07-16,4.174200762 396 | 2020-07-17,5.661150055 397 | 2020-07-18,4.440668893 398 | 2020-07-19,5.972358364 399 | 2020-07-20,4.311963831 400 | 2020-07-21,4.110128349 401 | 2020-07-22,3.944786081 402 | 2020-07-23,3.662258172 403 | 2020-07-24,5.783431138 404 | 2020-07-25,6.682230181 405 | 2020-07-26,5.259527644 406 | 2020-07-27,4.152629525 407 | 2020-07-28,5.53575636 408 | 2020-07-29,4.63245985 409 | 2020-07-30,5.926711164 410 | 2020-07-31,5.068239597 411 | 2020-08-01,6.027517078 412 | 2020-08-02,6.297644886 413 | 2020-08-03,3.200766058 414 | 2020-08-04,7.596996987 415 | 2020-08-05,3.601123854 416 | 2020-08-06,3.727469206 417 | 2020-08-07,6.138463342 418 | 2020-08-08,5.846858121 419 | 2020-08-09,5.548369507 420 | 2020-08-10,6.085187027 421 | 2020-08-11,6.694758767 422 | 2020-08-12,4.823905158 423 | 2020-08-13,4.982086793 424 | 2020-08-14,5.348426349 425 | 2020-08-15,6.381233659 426 | 2020-08-16,5.041998623 427 | 2020-08-17,5.406793697 428 | 2020-08-18,5.871285475 429 | 2020-08-19,5.632640367 430 | 2020-08-20,5.999235925 431 | 2020-08-21,5.549763446 432 | 2020-08-22,5.134016173 433 | 2020-08-23,8.069090869 434 | 2020-08-24,5.7887976 435 | 2020-08-25,8.167601976 436 | 2020-08-26,5.301082509 437 | 2020-08-27,8.773676119 438 | 2020-08-28,6.228320884 439 | 2020-08-29,4.72510062 440 | 2020-08-30,6.614451394 441 | 2020-08-31,5.69829728 442 | 2020-09-01,6.022641508 443 | 2020-09-02,6.201720165 444 | 2020-09-03,6.4630501 445 | 2020-09-04,5.643129343 446 | 2020-09-05,7.794363077 447 | 2020-09-06,5.856114083 448 | 2020-09-07,5.548519238 449 | 2020-09-08,7.087190418 450 | 2020-09-09,4.646326651 451 | 2020-09-10,6.649023705 452 | 2020-09-11,7.43542817 453 | 2020-09-12,7.409483823 454 | 2020-09-13,7.80381964 455 | 2020-09-14,6.699062812 456 | 2020-09-15,7.627037132 457 | 2020-09-16,6.154309636 458 | 2020-09-17,5.9394269 459 | 2020-09-18,6.085954111 460 | 2020-09-19,5.400516595 461 | 2020-09-20,6.978790212 462 | 2020-09-21,6.68719259 463 | 2020-09-22,6.623159602 464 | 2020-09-23,7.707462325 465 | 2020-09-24,6.885920281 466 | 2020-09-25,5.426230392 467 | 2020-09-26,5.794228292 468 | 2020-09-27,7.387649417 469 | 2020-09-28,8.444547499 470 | 2020-09-29,6.88068833 471 | 2020-09-30,7.474507237 472 | 2020-10-01,7.59576055 473 | 2020-10-02,5.95588458 474 | 2020-10-03,7.451724603 475 | 2020-10-04,6.342956146 476 | 2020-10-05,7.341283841 477 | 2020-10-06,7.372382884 478 | 2020-10-07,6.594609958 479 | 2020-10-08,6.288543782 480 | 2020-10-09,6.362380466 481 | 2020-10-10,8.69395681 482 | 2020-10-11,8.781118438 483 | 2020-10-12,7.828689644 484 | 2020-10-13,6.69455163 485 | 2020-10-14,8.704406116 486 | 2020-10-15,7.366794596 487 | 2020-10-16,6.953567389 488 | 2020-10-17,8.469999201 489 | 2020-10-18,6.126611551 490 | 2020-10-19,8.786050814 491 | 2020-10-20,7.225069306 492 | 2020-10-21,8.600608369 493 | 2020-10-22,8.694293238 494 | 2020-10-23,9.533130238 495 | 2020-10-24,9.247233946 496 | 2020-10-25,7.384322508 497 | 2020-10-26,7.679897943 498 | 2020-10-27,10.27149149 499 | 2020-10-28,9.446319799 500 | 2020-10-29,8.99552813 501 | 2020-10-30,7.781195532 502 | 2020-10-31,7.805033766 503 | 2020-11-01,7.97073532 504 | 2020-11-02,9.193383728 505 | 2020-11-03,8.724095479 506 | 2020-11-04,8.397557888 507 | 2020-11-05,5.176747018 508 | 2020-11-06,6.997792 509 | 2020-11-07,8.081766928 510 | 2020-11-08,5.254487306 511 | 2020-11-09,5.887755702 512 | 2020-11-10,8.745563998 513 | 2020-11-11,5.580149426 514 | 2020-11-12,8.072966941 515 | 2020-11-13,6.669866513 516 | 2020-11-14,8.056187428 517 | 2020-11-15,8.360565295 518 | 2020-11-16,7.422619274 519 | 2020-11-17,8.4126671 520 | 2020-11-18,8.405213916 521 | 2020-11-19,7.824455151 522 | 2020-11-20,6.531437605 523 | 2020-11-21,7.534963325 524 | 2020-11-22,9.185369504 525 | 2020-11-23,7.239913765 526 | 2020-11-24,6.818007499 527 | 2020-11-25,7.48735741 528 | 2020-11-26,8.235863968 529 | 2020-11-27,6.926099725 530 | 2020-11-28,7.456187422 531 | 2020-11-29,6.539859612 532 | 2020-11-30,7.770349129 533 | 2020-12-01,6.101864714 534 | 2020-12-02,8.249239226 535 | 2020-12-03,6.571801232 536 | 2020-12-04,5.993513728 537 | 2020-12-05,8.234944614 538 | 2020-12-06,7.567456453 539 | 2020-12-07,7.292635919 540 | 2020-12-08,6.101154608 541 | 2020-12-09,6.134329288 542 | 2020-12-10,4.949646507 543 | 2020-12-11,6.819345875 544 | 2020-12-12,6.717808367 545 | 2020-12-13,6.510173266 546 | 2020-12-14,3.716329575 547 | 2020-12-15,6.783632712 548 | 2020-12-16,5.718592981 549 | 2020-12-17,6.743894226 550 | 2020-12-18,6.165734954 551 | 2020-12-19,7.773811883 552 | 2020-12-20,7.408157371 553 | 2020-12-21,5.412551803 554 | 2020-12-22,6.537681621 555 | 2020-12-23,7.301725999 556 | 2020-12-24,5.601778779 557 | 2020-12-25,6.905486998 558 | 2020-12-26,5.729634187 559 | 2020-12-27,6.178610951 560 | 2020-12-28,8.313562378 561 | 2020-12-29,5.18259643 562 | 2020-12-30,5.922270359 563 | 2020-12-31,5.426568245 564 | 2021-01-01,6.912317158 565 | 2021-01-02,8.20772819 566 | 2021-01-03,4.364715959 567 | 2021-01-04,4.95305758 568 | 2021-01-05,6.31995345 569 | 2021-01-06,4.80590538 570 | 2021-01-07,6.283247035 571 | 2021-01-08,6.355063853 572 | 2021-01-09,5.149871247 573 | 2021-01-10,4.232211102 574 | 2021-01-11,6.562064529 575 | 2021-01-12,3.631671816 576 | 2021-01-13,4.669260699 577 | 2021-01-14,6.264747309 578 | 2021-01-15,5.403730946 579 | 2021-01-16,5.17941076 580 | 2021-01-17,5.321944471 581 | 2021-01-18,4.762160014 582 | 2021-01-19,3.846028902 583 | 2021-01-20,6.435617724 584 | 2021-01-21,5.354904849 585 | 2021-01-22,5.821345593 586 | 2021-01-23,6.662760185 587 | 2021-01-24,5.952532831 588 | 2021-01-25,4.686081819 589 | 2021-01-26,6.005702619 590 | 2021-01-27,5.855751465 591 | 2021-01-28,5.449302445 592 | 2021-01-29,6.021873427 593 | 2021-01-30,5.401863838 594 | 2021-01-31,5.021358094 595 | 2021-02-01,5.345568967 596 | 2021-02-02,4.949329807 597 | 2021-02-03,3.444512497 598 | 2021-02-04,4.079194369 599 | 2021-02-05,5.842238906 600 | 2021-02-06,5.738696853 601 | 2021-02-07,4.429304421 602 | -------------------------------------------------------------------------------- /grand/datasets/data/toy5/unit4.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,2.50204455 3 | 2019-06-20,2.458011483 4 | 2019-06-21,2.02044123 5 | 2019-06-22,1.862995209 6 | 2019-06-23,0.792017379 7 | 2019-06-24,2.250149185 8 | 2019-06-25,1.966164711 9 | 2019-06-26,3.117795105 10 | 2019-06-27,2.937739077 11 | 2019-06-28,2.410146366 12 | 2019-06-29,2.978830956 13 | 2019-06-30,1.763158194 14 | 2019-07-01,1.396769281 15 | 2019-07-02,2.427938171 16 | 2019-07-03,2.638596806 17 | 2019-07-04,2.604444982 18 | 2019-07-05,1.587404728 19 | 2019-07-06,3.55028029 20 | 2019-07-07,4.011101395 21 | 2019-07-08,2.447232653 22 | 2019-07-09,2.298333296 23 | 2019-07-10,3.15921327 24 | 2019-07-11,3.068289625 25 | 2019-07-12,3.170505999 26 | 2019-07-13,2.242341103 27 | 2019-07-14,2.522503399 28 | 2019-07-15,1.598707046 29 | 2019-07-16,2.550105415 30 | 2019-07-17,3.42980664 31 | 2019-07-18,3.924506307 32 | 2019-07-19,3.01242117 33 | 2019-07-20,2.642590833 34 | 2019-07-21,2.213069302 35 | 2019-07-22,2.791658344 36 | 2019-07-23,2.883674253 37 | 2019-07-24,2.64412112 38 | 2019-07-25,3.876139924 39 | 2019-07-26,3.382223177 40 | 2019-07-27,4.663324436 41 | 2019-07-28,2.848981622 42 | 2019-07-29,3.708507582 43 | 2019-07-30,4.077301932 44 | 2019-07-31,3.403682693 45 | 2019-08-01,2.767784712 46 | 2019-08-02,3.843709934 47 | 2019-08-03,3.238416016 48 | 2019-08-04,3.909956762 49 | 2019-08-05,2.85528104 50 | 2019-08-06,2.808103033 51 | 2019-08-07,3.41363626 52 | 2019-08-08,4.26583143 53 | 2019-08-09,4.877153811 54 | 2019-08-10,2.733587866 55 | 2019-08-11,3.884475263 56 | 2019-08-12,3.836566375 57 | 2019-08-13,3.456819174 58 | 2019-08-14,3.993491864 59 | 2019-08-15,3.819523831 60 | 2019-08-16,3.745122836 61 | 2019-08-17,2.957337071 62 | 2019-08-18,4.524189505 63 | 2019-08-19,3.913838063 64 | 2019-08-20,3.591359441 65 | 2019-08-21,3.331269623 66 | 2019-08-22,4.704830173 67 | 2019-08-23,3.323599499 68 | 2019-08-24,4.424049929 69 | 2019-08-25,4.159649102 70 | 2019-08-26,3.89412992 71 | 2019-08-27,4.490887007 72 | 2019-08-28,4.228512412 73 | 2019-08-29,5.042198513 74 | 2019-08-30,4.794955713 75 | 2019-08-31,3.706041341 76 | 2019-09-01,4.006918438 77 | 2019-09-02,4.451050083 78 | 2019-09-03,5.043710397 79 | 2019-09-04,4.651390185 80 | 2019-09-05,3.639705989 81 | 2019-09-06,4.499256172 82 | 2019-09-07,4.017179576 83 | 2019-09-08,4.071061828 84 | 2019-09-09,4.710971081 85 | 2019-09-10,3.915466285 86 | 2019-09-11,5.017207852 87 | 2019-09-12,4.965880222 88 | 2019-09-13,4.283957777 89 | 2019-09-14,5.43690929 90 | 2019-09-15,5.498080682 91 | 2019-09-16,4.108804481 92 | 2019-09-17,5.031614463 93 | 2019-09-18,4.564500773 94 | 2019-09-19,3.51536076 95 | 2019-09-20,4.466921621 96 | 2019-09-21,4.472514954 97 | 2019-09-22,5.322036259 98 | 2019-09-23,4.898184956 99 | 2019-09-24,5.549719986 100 | 2019-09-25,5.149397857 101 | 2019-09-26,3.540582597 102 | 2019-09-27,5.434332695 103 | 2019-09-28,5.749476429 104 | 2019-09-29,4.032369332 105 | 2019-09-30,5.209443911 106 | 2019-10-01,4.558256907 107 | 2019-10-02,6.551425778 108 | 2019-10-03,4.312585377 109 | 2019-10-04,4.177972114 110 | 2019-10-05,5.867661359 111 | 2019-10-06,4.431453296 112 | 2019-10-07,5.794740824 113 | 2019-10-08,5.502572891 114 | 2019-10-09,5.064833283 115 | 2019-10-10,4.784724469 116 | 2019-10-11,4.878959232 117 | 2019-10-12,5.18689519 118 | 2019-10-13,4.394352553 119 | 2019-10-14,4.890041594 120 | 2019-10-15,4.130308876 121 | 2019-10-16,4.665222645 122 | 2019-10-17,4.377564812 123 | 2019-10-18,5.099456487 124 | 2019-10-19,3.854879941 125 | 2019-10-20,4.465973254 126 | 2019-10-21,4.833192401 127 | 2019-10-22,5.042773291 128 | 2019-10-23,4.315362874 129 | 2019-10-24,2.682668693 130 | 2019-10-25,4.40333088 131 | 2019-10-26,4.255863772 132 | 2019-10-27,5.286087164 133 | 2019-10-28,4.108998898 134 | 2019-10-29,3.496232734 135 | 2019-10-30,3.600693071 136 | 2019-10-31,4.253496246 137 | 2019-11-01,4.36787015 138 | 2019-11-02,4.97190889 139 | 2019-11-03,3.991238953 140 | 2019-11-04,4.504467513 141 | 2019-11-05,3.741239898 142 | 2019-11-06,4.268469098 143 | 2019-11-07,3.581383836 144 | 2019-11-08,3.980880358 145 | 2019-11-09,4.183407958 146 | 2019-11-10,2.065893985 147 | 2019-11-11,4.058215421 148 | 2019-11-12,4.37589399 149 | 2019-11-13,3.755322073 150 | 2019-11-14,3.170798413 151 | 2019-11-15,4.357596552 152 | 2019-11-16,3.127786324 153 | 2019-11-17,3.948112413 154 | 2019-11-18,3.501071304 155 | 2019-11-19,2.955017194 156 | 2019-11-20,4.002024783 157 | 2019-11-21,3.138675957 158 | 2019-11-22,3.299723718 159 | 2019-11-23,3.021571774 160 | 2019-11-24,3.130502376 161 | 2019-11-25,3.688759 162 | 2019-11-26,4.111543285 163 | 2019-11-27,3.554811707 164 | 2019-11-28,3.417136991 165 | 2019-11-29,3.740834978 166 | 2019-11-30,3.816507379 167 | 2019-12-01,2.806941096 168 | 2019-12-02,3.298233652 169 | 2019-12-03,3.564958377 170 | 2019-12-04,2.911067527 171 | 2019-12-05,3.439314067 172 | 2019-12-06,0.916010744 173 | 2019-12-07,2.109362299 174 | 2019-12-08,3.896425261 175 | 2019-12-09,1.717940536 176 | 2019-12-10,3.54270857 177 | 2019-12-11,1.514056287 178 | 2019-12-12,2.22156836 179 | 2019-12-13,1.930026768 180 | 2019-12-14,2.269913633 181 | 2019-12-15,2.121643158 182 | 2019-12-16,2.039968957 183 | 2019-12-17,2.324181626 184 | 2019-12-18,2.135949743 185 | 2019-12-19,2.903186475 186 | 2019-12-20,2.384575373 187 | 2019-12-21,2.454728648 188 | 2019-12-22,1.751309756 189 | 2019-12-23,2.281191685 190 | 2019-12-24,2.49418161 191 | 2019-12-25,2.294157606 192 | 2019-12-26,2.590026785 193 | 2019-12-27,2.293214441 194 | 2019-12-28,2.315626236 195 | 2019-12-29,2.038401057 196 | 2019-12-30,2.017972276 197 | 2019-12-31,2.68913663 198 | 2020-01-01,3.187054784 199 | 2020-01-02,1.843076782 200 | 2020-01-03,1.798239464 201 | 2020-01-04,2.013760803 202 | 2020-01-05,2.286942372 203 | 2020-01-06,1.512636634 204 | 2020-01-07,1.642038565 205 | 2020-01-08,2.06053709 206 | 2020-01-09,2.025240974 207 | 2020-01-10,1.931030251 208 | 2020-01-11,1.531762802 209 | 2020-01-12,2.918687776 210 | 2020-01-13,1.769650075 211 | 2020-01-14,2.714186399 212 | 2020-01-15,2.168593156 213 | 2020-01-16,0.556439937 214 | 2020-01-17,1.351164636 215 | 2020-01-18,1.65021001 216 | 2020-01-19,2.448905437 217 | 2020-01-20,2.121929652 218 | 2020-01-21,2.150673931 219 | 2020-01-22,2.356071017 220 | 2020-01-23,2.152258017 221 | 2020-01-24,2.785087811 222 | 2020-01-25,2.413797882 223 | 2020-01-26,2.549029252 224 | 2020-01-27,1.345319283 225 | 2020-01-28,1.266270146 226 | 2020-01-29,1.526244014 227 | 2020-01-30,1.524070097 228 | 2020-01-31,2.70406231 229 | 2020-02-01,2.394123559 230 | 2020-02-02,2.116733534 231 | 2020-02-03,1.693919955 232 | 2020-02-04,2.503053727 233 | 2020-02-05,1.744609245 234 | 2020-02-06,1.731691973 235 | 2020-02-07,1.259798482 236 | 2020-02-08,1.926061283 237 | 2020-02-09,2.669840333 238 | 2020-02-10,1.770411299 239 | 2020-02-11,1.961328256 240 | 2020-02-12,1.523143896 241 | 2020-02-13,2.396178545 242 | 2020-02-14,2.270241864 243 | 2020-02-15,2.614868599 244 | 2020-02-16,2.241836512 245 | 2020-02-17,1.828568244 246 | 2020-02-18,0.334590052 247 | 2020-02-19,2.755586874 248 | 2020-02-20,2.212390971 249 | 2020-02-21,2.324055219 250 | 2020-02-22,1.957851458 251 | 2020-02-23,2.819702483 252 | 2020-02-24,1.974822804 253 | 2020-02-25,2.509024533 254 | 2020-02-26,3.254170988 255 | 2020-02-27,2.398868178 256 | 2020-02-28,2.511925529 257 | 2020-02-29,2.266233284 258 | 2020-03-01,1.61133956 259 | 2020-03-02,2.409082202 260 | 2020-03-03,1.827509824 261 | 2020-03-04,1.96878551 262 | 2020-03-05,3.118272829 263 | 2020-03-06,1.92325875 264 | 2020-03-07,2.130121688 265 | 2020-03-08,2.214829571 266 | 2020-03-09,1.956572891 267 | 2020-03-10,0.947753883 268 | 2020-03-11,2.139300149 269 | 2020-03-12,1.168097078 270 | 2020-03-13,1.831708387 271 | 2020-03-14,2.069717051 272 | 2020-03-15,2.973210733 273 | 2020-03-16,0.6593205 274 | 2020-03-17,3.926108638 275 | 2020-03-18,2.342251873 276 | 2020-03-19,1.734037261 277 | 2020-03-20,2.300337119 278 | 2020-03-21,1.547318028 279 | 2020-03-22,2.043517069 280 | 2020-03-23,2.550081449 281 | 2020-03-24,0.740969843 282 | 2020-03-25,1.131062836 283 | 2020-03-26,0.823307297 284 | 2020-03-27,1.192554462 285 | 2020-03-28,1.396675931 286 | 2020-03-29,1.792226061 287 | 2020-03-30,2.135340117 288 | 2020-03-31,1.529869112 289 | 2020-04-01,2.257101464 290 | 2020-04-02,2.012146843 291 | 2020-04-03,1.59492825 292 | 2020-04-04,2.056981336 293 | 2020-04-05,2.188284824 294 | 2020-04-06,2.634013384 295 | 2020-04-07,2.076020536 296 | 2020-04-08,2.212496285 297 | 2020-04-09,1.91886303 298 | 2020-04-10,3.315086626 299 | 2020-04-11,3.224397988 300 | 2020-04-12,2.512812857 301 | 2020-04-13,1.747512888 302 | 2020-04-14,4.608007924 303 | 2020-04-15,4.931171294 304 | 2020-04-16,5.212987921 305 | 2020-04-17,6.019761315 306 | 2020-04-18,4.142415049 307 | 2020-04-19,4.497918589 308 | 2020-04-20,3.810882957 309 | 2020-04-21,5.248776177 310 | 2020-04-22,4.645169972 311 | 2020-04-23,5.146961485 312 | 2020-04-24,5.213210929 313 | 2020-04-25,4.91228692 314 | 2020-04-26,4.522281308 315 | 2020-04-27,5.382718641 316 | 2020-04-28,4.62337519 317 | 2020-04-29,4.881781051 318 | 2020-04-30,5.833972138 319 | 2020-05-01,4.777829763 320 | 2020-05-02,4.347626328 321 | 2020-05-03,4.93554502 322 | 2020-05-04,4.104264774 323 | 2020-05-05,4.798900269 324 | 2020-05-06,4.561624607 325 | 2020-05-07,5.085932352 326 | 2020-05-08,4.160224914 327 | 2020-05-09,4.517998685 328 | 2020-05-10,5.683362327 329 | 2020-05-11,4.962360543 330 | 2020-05-12,3.814432007 331 | 2020-05-13,5.456318156 332 | 2020-05-14,4.042057183 333 | 2020-05-15,4.574661876 334 | 2020-05-16,4.624772133 335 | 2020-05-17,5.309219751 336 | 2020-05-18,5.580737214 337 | 2020-05-19,5.400915397 338 | 2020-05-20,5.962747913 339 | 2020-05-21,4.643389445 340 | 2020-05-22,6.276852 341 | 2020-05-23,4.682296362 342 | 2020-05-24,4.457994767 343 | 2020-05-25,4.707597494 344 | 2020-05-26,5.172646431 345 | 2020-05-27,5.453237349 346 | 2020-05-28,5.392444976 347 | 2020-05-29,3.821337624 348 | 2020-05-30,3.748328615 349 | 2020-05-31,5.539649627 350 | 2020-06-01,4.827265704 351 | 2020-06-02,4.685384788 352 | 2020-06-03,4.767678635 353 | 2020-06-04,5.515684075 354 | 2020-06-05,5.234681004 355 | 2020-06-06,6.270278853 356 | 2020-06-07,5.039652254 357 | 2020-06-08,4.617237134 358 | 2020-06-09,3.89792929 359 | 2020-06-10,3.906911323 360 | 2020-06-11,4.520844736 361 | 2020-06-12,5.825972798 362 | 2020-06-13,5.620101458 363 | 2020-06-14,6.051711682 364 | 2020-06-15,4.843937968 365 | 2020-06-16,5.291690555 366 | 2020-06-17,4.49699846 367 | 2020-06-18,5.246676085 368 | 2020-06-19,4.934654741 369 | 2020-06-20,5.706580409 370 | 2020-06-21,4.089760187 371 | 2020-06-22,5.670938121 372 | 2020-06-23,6.03819157 373 | 2020-06-24,4.531909295 374 | 2020-06-25,3.863011871 375 | 2020-06-26,4.786600426 376 | 2020-06-27,4.781919543 377 | 2020-06-28,4.693524635 378 | 2020-06-29,4.4448487 379 | 2020-06-30,4.247049562 380 | 2020-07-01,4.660943458 381 | 2020-07-02,5.327707707 382 | 2020-07-03,4.996674724 383 | 2020-07-04,4.574584129 384 | 2020-07-05,5.996837398 385 | 2020-07-06,4.450211922 386 | 2020-07-07,3.970317792 387 | 2020-07-08,5.277355103 388 | 2020-07-09,4.69223405 389 | 2020-07-10,5.95072232 390 | 2020-07-11,5.30666026 391 | 2020-07-12,5.52663308 392 | 2020-07-13,5.201689523 393 | 2020-07-14,4.580367777 394 | 2020-07-15,4.639381099 395 | 2020-07-16,5.547511958 396 | 2020-07-17,3.388157992 397 | 2020-07-18,4.975266124 398 | 2020-07-19,4.058554207 399 | 2020-07-20,4.461333889 400 | 2020-07-21,5.307499147 401 | 2020-07-22,5.451653839 402 | 2020-07-23,2.713112255 403 | 2020-07-24,2.500719048 404 | 2020-07-25,2.204376252 405 | 2020-07-26,1.902922801 406 | 2020-07-27,1.7784473 407 | 2020-07-28,2.027124308 408 | 2020-07-29,0.874425126 409 | 2020-07-30,2.235531404 410 | 2020-07-31,1.729735214 411 | 2020-08-01,2.760083448 412 | 2020-08-02,2.867116535 413 | 2020-08-03,1.699429628 414 | 2020-08-04,1.808893914 415 | 2020-08-05,3.077788372 416 | 2020-08-06,2.664977587 417 | 2020-08-07,2.743028455 418 | 2020-08-08,1.764375585 419 | 2020-08-09,2.636259522 420 | 2020-08-10,3.156428884 421 | 2020-08-11,2.274790915 422 | 2020-08-12,1.882274912 423 | 2020-08-13,2.695068024 424 | 2020-08-14,3.113032763 425 | 2020-08-15,3.216281534 426 | 2020-08-16,2.51290165 427 | 2020-08-17,2.675979654 428 | 2020-08-18,2.84647448 429 | 2020-08-19,3.443286975 430 | 2020-08-20,3.478688886 431 | 2020-08-21,3.824003926 432 | 2020-08-22,2.673758781 433 | 2020-08-23,3.794627087 434 | 2020-08-24,3.530661605 435 | 2020-08-25,2.390077541 436 | 2020-08-26,2.654445423 437 | 2020-08-27,3.462316059 438 | 2020-08-28,1.677360688 439 | 2020-08-29,3.196338076 440 | 2020-08-30,2.865444515 441 | 2020-08-31,3.949906235 442 | 2020-09-01,2.583010099 443 | 2020-09-02,4.584846669 444 | 2020-09-03,2.152203955 445 | 2020-09-04,2.716942816 446 | 2020-09-05,2.777914448 447 | 2020-09-06,3.132200371 448 | 2020-09-07,3.4244985 449 | 2020-09-08,2.970413026 450 | 2020-09-09,3.566658415 451 | 2020-09-10,3.456908707 452 | 2020-09-11,4.226681687 453 | 2020-09-12,2.402780101 454 | 2020-09-13,2.964135408 455 | 2020-09-14,2.929334451 456 | 2020-09-15,4.827783798 457 | 2020-09-16,4.448551534 458 | 2020-09-17,3.522782243 459 | 2020-09-18,3.85236041 460 | 2020-09-19,3.360233075 461 | 2020-09-20,3.515914297 462 | 2020-09-21,4.131854869 463 | 2020-09-22,4.551563944 464 | 2020-09-23,3.594555811 465 | 2020-09-24,3.506452583 466 | 2020-09-25,3.673478874 467 | 2020-09-26,3.829547719 468 | 2020-09-27,4.095261662 469 | 2020-09-28,3.380768749 470 | 2020-09-29,3.351315551 471 | 2020-09-30,3.555831848 472 | 2020-10-01,4.322662922 473 | 2020-10-02,3.923090526 474 | 2020-10-03,3.971748389 475 | 2020-10-04,5.225680661 476 | 2020-10-05,3.120008777 477 | 2020-10-06,3.456148896 478 | 2020-10-07,4.009411605 479 | 2020-10-08,3.962476007 480 | 2020-10-09,4.282920223 481 | 2020-10-10,4.84833597 482 | 2020-10-11,4.530850883 483 | 2020-10-12,4.36376832 484 | 2020-10-13,4.382194826 485 | 2020-10-14,4.359466707 486 | 2020-10-15,3.029525303 487 | 2020-10-16,4.168130544 488 | 2020-10-17,4.641428629 489 | 2020-10-18,4.783268668 490 | 2020-10-19,5.121179269 491 | 2020-10-20,5.436215261 492 | 2020-10-21,4.404382755 493 | 2020-10-22,5.029132201 494 | 2020-10-23,5.163367103 495 | 2020-10-24,5.387310991 496 | 2020-10-25,4.105189309 497 | 2020-10-26,4.156616771 498 | 2020-10-27,4.41345663 499 | 2020-10-28,5.566016141 500 | 2020-10-29,4.731226869 501 | 2020-10-30,4.273029332 502 | 2020-10-31,4.166469363 503 | 2020-11-01,5.527218975 504 | 2020-11-02,5.729955648 505 | 2020-11-03,5.05407695 506 | 2020-11-04,4.592701335 507 | 2020-11-05,5.539889839 508 | 2020-11-06,4.576325942 509 | 2020-11-07,4.277060481 510 | 2020-11-08,5.398771298 511 | 2020-11-09,4.598255196 512 | 2020-11-10,4.145706454 513 | 2020-11-11,5.083708628 514 | 2020-11-12,4.54641289 515 | 2020-11-13,4.42267595 516 | 2020-11-14,4.414142191 517 | 2020-11-15,4.798646177 518 | 2020-11-16,4.998488101 519 | 2020-11-17,3.501058488 520 | 2020-11-18,4.045236117 521 | 2020-11-19,4.69477946 522 | 2020-11-20,3.680536527 523 | 2020-11-21,3.487111097 524 | 2020-11-22,4.08205802 525 | 2020-11-23,4.044994536 526 | 2020-11-24,4.487093386 527 | 2020-11-25,3.455554398 528 | 2020-11-26,4.031852088 529 | 2020-11-27,3.7436301 530 | 2020-11-28,4.120448488 531 | 2020-11-29,4.439436882 532 | 2020-11-30,4.453084252 533 | 2020-12-01,4.004415316 534 | 2020-12-02,4.127032466 535 | 2020-12-03,5.088420309 536 | 2020-12-04,4.360414661 537 | 2020-12-05,4.606991346 538 | 2020-12-06,4.051710733 539 | 2020-12-07,3.519650044 540 | 2020-12-08,4.863052162 541 | 2020-12-09,4.297037475 542 | 2020-12-10,3.750270698 543 | 2020-12-11,3.907133909 544 | 2020-12-12,2.784688694 545 | 2020-12-13,4.234759268 546 | 2020-12-14,3.803588189 547 | 2020-12-15,3.551806503 548 | 2020-12-16,4.737314714 549 | 2020-12-17,3.77868628 550 | 2020-12-18,3.54387622 551 | 2020-12-19,4.449407614 552 | 2020-12-20,2.912498494 553 | 2020-12-21,2.653694177 554 | 2020-12-22,1.668504463 555 | 2020-12-23,3.011597656 556 | 2020-12-24,3.942968169 557 | 2020-12-25,4.427590768 558 | 2020-12-26,3.218780981 559 | 2020-12-27,4.37710517 560 | 2020-12-28,2.131391306 561 | 2020-12-29,3.126375243 562 | 2020-12-30,3.220135322 563 | 2020-12-31,2.857276179 564 | 2021-01-01,2.371020969 565 | 2021-01-02,2.221648608 566 | 2021-01-03,2.916908175 567 | 2021-01-04,3.198938777 568 | 2021-01-05,2.433470816 569 | 2021-01-06,3.249663875 570 | 2021-01-07,2.776040571 571 | 2021-01-08,3.975853072 572 | 2021-01-09,4.076748179 573 | 2021-01-10,2.379220051 574 | 2021-01-11,2.701761599 575 | 2021-01-12,2.69395602 576 | 2021-01-13,2.691074665 577 | 2021-01-14,3.520978349 578 | 2021-01-15,2.304748887 579 | 2021-01-16,1.964875576 580 | 2021-01-17,3.040289644 581 | 2021-01-18,3.044684057 582 | 2021-01-19,2.00736429 583 | 2021-01-20,2.557580673 584 | 2021-01-21,2.791875672 585 | 2021-01-22,1.686659462 586 | 2021-01-23,2.683457188 587 | 2021-01-24,2.703183784 588 | 2021-01-25,2.057173909 589 | 2021-01-26,2.881703163 590 | 2021-01-27,3.070891952 591 | 2021-01-28,3.050640634 592 | 2021-01-29,2.324426118 593 | 2021-01-30,1.953999191 594 | 2021-01-31,1.776088639 595 | 2021-02-01,3.31474514 596 | 2021-02-02,1.029561332 597 | 2021-02-03,2.679316132 598 | 2021-02-04,2.906564794 599 | 2021-02-05,3.522097053 600 | 2021-02-06,2.297710439 601 | 2021-02-07,2.345155558 602 | -------------------------------------------------------------------------------- /grand/datasets/data/toy6/unit1.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,5.529110823 3 | 2019-06-20,4.575988989 4 | 2019-06-21,3.823556023 5 | 2019-06-22,4.151653736 6 | 2019-06-23,4.414083765 7 | 2019-06-24,4.970951075 8 | 2019-06-25,5.861702133 9 | 2019-06-26,5.2460529 10 | 2019-06-27,5.857924039 11 | 2019-06-28,5.708491664 12 | 2019-06-29,6.466739848 13 | 2019-06-30,7.117038415 14 | 2019-07-01,5.484730021 15 | 2019-07-02,3.948690346 16 | 2019-07-03,6.296743231 17 | 2019-07-04,5.08293804 18 | 2019-07-05,5.765958752 19 | 2019-07-06,7.457212237 20 | 2019-07-07,4.79855135 21 | 2019-07-08,5.386115079 22 | 2019-07-09,5.446738099 23 | 2019-07-10,3.659051711 24 | 2019-07-11,4.548167477 25 | 2019-07-12,6.079444079 26 | 2019-07-13,5.084003447 27 | 2019-07-14,7.083700809 28 | 2019-07-15,7.218016044 29 | 2019-07-16,4.427587626 30 | 2019-07-17,5.473120232 31 | 2019-07-18,3.906283523 32 | 2019-07-19,4.192255938 33 | 2019-07-20,4.755760085 34 | 2019-07-21,6.482585752 35 | 2019-07-22,6.851081908 36 | 2019-07-23,5.568919025 37 | 2019-07-24,7.952578929 38 | 2019-07-25,5.942388537 39 | 2019-07-26,6.211022163 40 | 2019-07-27,6.543569334 41 | 2019-07-28,4.313288239 42 | 2019-07-29,4.795883987 43 | 2019-07-30,5.038624199 44 | 2019-07-31,6.120370212 45 | 2019-08-01,6.47610197 46 | 2019-08-02,7.535418999 47 | 2019-08-03,6.660417267 48 | 2019-08-04,6.993838797 49 | 2019-08-05,6.104692174 50 | 2019-08-06,5.414536325 51 | 2019-08-07,6.21686699 52 | 2019-08-08,6.922853275 53 | 2019-08-09,6.60467627 54 | 2019-08-10,6.378778103 55 | 2019-08-11,7.122097963 56 | 2019-08-12,5.379137524 57 | 2019-08-13,4.759451245 58 | 2019-08-14,8.615094524 59 | 2019-08-15,8.405868716 60 | 2019-08-16,5.225837965 61 | 2019-08-17,7.934059443 62 | 2019-08-18,6.586807375 63 | 2019-08-19,6.598877227 64 | 2019-08-20,7.231100176 65 | 2019-08-21,5.625379029 66 | 2019-08-22,6.38283216 67 | 2019-08-23,6.843566861 68 | 2019-08-24,7.180884098 69 | 2019-08-25,7.065220485 70 | 2019-08-26,8.003487518 71 | 2019-08-27,7.904634225 72 | 2019-08-28,7.376347293 73 | 2019-08-29,7.116152115 74 | 2019-08-30,9.063030992 75 | 2019-08-31,7.430865581 76 | 2019-09-01,8.513614041 77 | 2019-09-02,7.447877924 78 | 2019-09-03,6.0141416 79 | 2019-09-04,9.517294653 80 | 2019-09-05,7.4440346 81 | 2019-09-06,7.248251578 82 | 2019-09-07,6.878508269 83 | 2019-09-08,8.159760151 84 | 2019-09-09,8.102369205 85 | 2019-09-10,7.092701502 86 | 2019-09-11,8.947831158 87 | 2019-09-12,8.16960647 88 | 2019-09-13,7.936558817 89 | 2019-09-14,7.767368426 90 | 2019-09-15,6.025908416 91 | 2019-09-16,6.927416111 92 | 2019-09-17,9.42846969 93 | 2019-09-18,8.988145393 94 | 2019-09-19,9.077065672 95 | 2019-09-20,7.426337908 96 | 2019-09-21,8.768360345 97 | 2019-09-22,6.846896668 98 | 2019-09-23,7.662078903 99 | 2019-09-24,6.987005678 100 | 2019-09-25,8.315120877 101 | 2019-09-26,8.436611052 102 | 2019-09-27,8.435565718 103 | 2019-09-28,6.898573093 104 | 2019-09-29,9.190230179 105 | 2019-09-30,9.335300926 106 | 2019-10-01,8.560682594 107 | 2019-10-02,6.442572759 108 | 2019-10-03,9.324024507 109 | 2019-10-04,6.221732374 110 | 2019-10-05,7.893132047 111 | 2019-10-06,8.384177088 112 | 2019-10-07,6.877741033 113 | 2019-10-08,7.952613739 114 | 2019-10-09,7.947916887 115 | 2019-10-10,7.748341197 116 | 2019-10-11,7.250757159 117 | 2019-10-12,6.949159118 118 | 2019-10-13,6.651756207 119 | 2019-10-14,7.277252549 120 | 2019-10-15,6.785194995 121 | 2019-10-16,7.185631679 122 | 2019-10-17,7.876482619 123 | 2019-10-18,8.218229672 124 | 2019-10-19,7.560358508 125 | 2019-10-20,6.406979853 126 | 2019-10-21,8.404753368 127 | 2019-10-22,8.720484524 128 | 2019-10-23,7.468440274 129 | 2019-10-24,9.147804448 130 | 2019-10-25,7.058748282 131 | 2019-10-26,6.822640315 132 | 2019-10-27,8.769163219 133 | 2019-10-28,7.839188197 134 | 2019-10-29,6.310783955 135 | 2019-10-30,7.248549969 136 | 2019-10-31,6.860460168 137 | 2019-11-01,7.443121072 138 | 2019-11-02,7.989166114 139 | 2019-11-03,8.676533753 140 | 2019-11-04,8.515803397 141 | 2019-11-05,6.225505833 142 | 2019-11-06,5.13788644 143 | 2019-11-07,7.420495772 144 | 2019-11-08,5.796739882 145 | 2019-11-09,8.312785718 146 | 2019-11-10,6.486410324 147 | 2019-11-11,6.596530577 148 | 2019-11-12,6.620908932 149 | 2019-11-13,7.058526941 150 | 2019-11-14,7.685300177 151 | 2019-11-15,7.102579407 152 | 2019-11-16,6.241049674 153 | 2019-11-17,6.892218216 154 | 2019-11-18,6.575869182 155 | 2019-11-19,6.578674558 156 | 2019-11-20,5.812510353 157 | 2019-11-21,5.566389388 158 | 2019-11-22,5.208596023 159 | 2019-11-23,6.901079646 160 | 2019-11-24,4.430401459 161 | 2019-11-25,7.363167495 162 | 2019-11-26,7.116884177 163 | 2019-11-27,8.511595767 164 | 2019-11-28,5.773149615 165 | 2019-11-29,4.787559108 166 | 2019-11-30,7.365609222 167 | 2019-12-01,4.714001651 168 | 2019-12-02,5.474835152 169 | 2019-12-03,5.42081188 170 | 2019-12-04,5.566273163 171 | 2019-12-05,4.599439722 172 | 2019-12-06,5.903253383 173 | 2019-12-07,4.54483976 174 | 2019-12-08,4.572344692 175 | 2019-12-09,6.939194263 176 | 2019-12-10,6.529878221 177 | 2019-12-11,3.393222521 178 | 2019-12-12,6.483243392 179 | 2019-12-13,5.976947415 180 | 2019-12-14,4.910362697 181 | 2019-12-15,6.605825995 182 | 2019-12-16,6.358503265 183 | 2019-12-17,7.574464006 184 | 2019-12-18,5.21538147 185 | 2019-12-19,6.199096426 186 | 2019-12-20,4.612876201 187 | 2019-12-21,5.522090943 188 | 2019-12-22,6.434696915 189 | 2019-12-23,4.649885413 190 | 2019-12-24,4.390045454 191 | 2019-12-25,6.063386787 192 | 2019-12-26,3.650362734 193 | 2019-12-27,6.377785299 194 | 2019-12-28,7.345132527 195 | 2019-12-29,3.867935849 196 | 2019-12-30,3.390782785 197 | 2019-12-31,5.569237126 198 | 2020-01-01,4.09304618 199 | 2020-01-02,4.543619495 200 | 2020-01-03,3.200192582 201 | 2020-01-04,3.482289901 202 | 2020-01-05,5.552421881 203 | 2020-01-06,4.141060632 204 | 2020-01-07,4.732642388 205 | 2020-01-08,3.892818706 206 | 2020-01-09,6.477032323 207 | 2020-01-10,3.815037532 208 | 2020-01-11,5.291417253 209 | 2020-01-12,5.698042662 210 | 2020-01-13,6.531855705 211 | 2020-01-14,4.128395101 212 | 2020-01-15,5.445510407 213 | 2020-01-16,4.819392963 214 | 2020-01-17,4.998083122 215 | 2020-01-18,5.383308011 216 | 2020-01-19,5.148087845 217 | 2020-01-20,7.485947521 218 | 2020-01-21,4.388397357 219 | 2020-01-22,4.737676261 220 | 2020-01-23,5.798024367 221 | 2020-01-24,6.022802799 222 | 2020-01-25,4.167033899 223 | 2020-01-26,5.459572874 224 | 2020-01-27,6.301355456 225 | 2020-01-28,3.956426841 226 | 2020-01-29,6.488042714 227 | 2020-01-30,7.184594145 228 | 2020-01-31,5.699450785 229 | 2020-02-01,6.326113439 230 | 2020-02-02,7.386008005 231 | 2020-02-03,6.317142758 232 | 2020-02-04,4.960017685 233 | 2020-02-05,6.550021307 234 | 2020-02-06,5.865520608 235 | 2020-02-07,5.405340347 236 | 2020-02-08,5.691081488 237 | 2020-02-09,5.716161819 238 | 2020-02-10,4.989387992 239 | 2020-02-11,6.737227094 240 | 2020-02-12,5.413020846 241 | 2020-02-13,5.551483457 242 | 2020-02-14,8.133026355 243 | 2020-02-15,6.77039799 244 | 2020-02-16,6.251969826 245 | 2020-02-17,6.522569911 246 | 2020-02-18,6.105113753 247 | 2020-02-19,6.759340673 248 | 2020-02-20,6.444369068 249 | 2020-02-21,8.371363907 250 | 2020-02-22,5.416119533 251 | 2020-02-23,7.047377338 252 | 2020-02-24,8.43382009 253 | 2020-02-25,7.312691935 254 | 2020-02-26,6.828001382 255 | 2020-02-27,7.303541631 256 | 2020-02-28,6.5508406 257 | 2020-02-29,6.312278382 258 | 2020-03-01,5.565039261 259 | 2020-03-02,7.934017452 260 | 2020-03-03,8.057681956 261 | 2020-03-04,7.242257749 262 | 2020-03-05,5.925390786 263 | 2020-03-06,7.675691156 264 | 2020-03-07,7.058593232 265 | 2020-03-08,7.721159149 266 | 2020-03-09,6.329388769 267 | 2020-03-10,6.85025533 268 | 2020-03-11,7.164534503 269 | 2020-03-12,5.80079753 270 | 2020-03-13,7.480214642 271 | 2020-03-14,7.850463294 272 | 2020-03-15,6.945526141 273 | 2020-03-16,6.565458741 274 | 2020-03-17,7.55166522 275 | 2020-03-18,6.585924883 276 | 2020-03-19,7.103430082 277 | 2020-03-20,7.068750482 278 | 2020-03-21,6.704626756 279 | 2020-03-22,8.407925106 280 | 2020-03-23,7.338096214 281 | 2020-03-24,7.535305854 282 | 2020-03-25,5.528049144 283 | 2020-03-26,6.111702033 284 | 2020-03-27,8.183746101 285 | 2020-03-28,9.517074462 286 | 2020-03-29,7.757831175 287 | 2020-03-30,8.852570129 288 | 2020-03-31,8.260937589 289 | 2020-04-01,8.908454579 290 | 2020-04-02,6.771124057 291 | 2020-04-03,8.69705856 292 | 2020-04-04,6.602316951 293 | 2020-04-05,8.147459768 294 | 2020-04-06,7.791533527 295 | 2020-04-07,8.383553167 296 | 2020-04-08,9.390667279 297 | 2020-04-09,7.374778875 298 | 2020-04-10,8.212667553 299 | 2020-04-11,7.00222421 300 | 2020-04-12,8.757347629 301 | 2020-04-13,6.749585049 302 | 2020-04-14,8.545179361 303 | 2020-04-15,6.717389997 304 | 2020-04-16,7.435811509 305 | 2020-04-17,8.086064446 306 | 2020-04-18,8.95620291 307 | 2020-04-19,7.862643186 308 | 2020-04-20,7.643608866 309 | 2020-04-21,7.606873753 310 | 2020-04-22,8.339997359 311 | 2020-04-23,8.45285267 312 | 2020-04-24,6.929286594 313 | 2020-04-25,6.637725641 314 | 2020-04-26,7.425683527 315 | 2020-04-27,7.880470064 316 | 2020-04-28,8.056011196 317 | 2020-04-29,8.533086363 318 | 2020-04-30,6.004737954 319 | 2020-05-01,7.754538643 320 | 2020-05-02,8.716726022 321 | 2020-05-03,7.419059406 322 | 2020-05-04,6.41909324 323 | 2020-05-05,6.668009899 324 | 2020-05-06,7.417116385 325 | 2020-05-07,7.905943044 326 | 2020-05-08,7.801289553 327 | 2020-05-09,5.233408357 328 | 2020-05-10,7.034859607 329 | 2020-05-11,7.523607303 330 | 2020-05-12,7.382991022 331 | 2020-05-13,5.060410044 332 | 2020-05-14,7.573687479 333 | 2020-05-15,5.515725878 334 | 2020-05-16,7.46503808 335 | 2020-05-17,6.756019182 336 | 2020-05-18,6.227463122 337 | 2020-05-19,8.418677229 338 | 2020-05-20,8.120219836 339 | 2020-05-21,8.046520188 340 | 2020-05-22,6.59199995 341 | 2020-05-23,6.394648851 342 | 2020-05-24,6.905905098 343 | 2020-05-25,7.043124429 344 | 2020-05-26,6.20544405 345 | 2020-05-27,7.090925344 346 | 2020-05-28,5.308792809 347 | 2020-05-29,7.200451666 348 | 2020-05-30,8.296827098 349 | 2020-05-31,6.337731052 350 | 2020-06-01,6.816562772 351 | 2020-06-02,4.766467286 352 | 2020-06-03,5.994138818 353 | 2020-06-04,4.65367938 354 | 2020-06-05,4.955267491 355 | 2020-06-06,6.753458694 356 | 2020-06-07,7.323115014 357 | 2020-06-08,6.250710646 358 | 2020-06-09,6.547400335 359 | 2020-06-10,6.256786249 360 | 2020-06-11,6.375941138 361 | 2020-06-12,6.749492593 362 | 2020-06-13,6.824095117 363 | 2020-06-14,4.405485365 364 | 2020-06-15,6.451059339 365 | 2020-06-16,8.183528418 366 | 2020-06-17,6.823024448 367 | 2020-06-18,5.937175709 368 | 2020-06-19,8.380037657 369 | 2020-06-20,4.570454272 370 | 2020-06-21,7.592434643 371 | 2020-06-22,4.852596687 372 | 2020-06-23,6.195530011 373 | 2020-06-24,6.190618598 374 | 2020-06-25,5.525785641 375 | 2020-06-26,7.4175525 376 | 2020-06-27,5.527535043 377 | 2020-06-28,5.671239163 378 | 2020-06-29,6.236299464 379 | 2020-06-30,5.518689483 380 | 2020-07-01,6.559085349 381 | 2020-07-02,4.552919348 382 | 2020-07-03,5.367119276 383 | 2020-07-04,2.723041317 384 | 2020-07-05,4.068058742 385 | 2020-07-06,4.619994217 386 | 2020-07-07,3.802916221 387 | 2020-07-08,4.417824737 388 | 2020-07-09,3.343969481 389 | 2020-07-10,7.57548019 390 | 2020-07-11,4.64455708 391 | 2020-07-12,4.87721616 392 | 2020-07-13,4.166836622 393 | 2020-07-14,5.661053856 394 | 2020-07-15,5.333470761 395 | 2020-07-16,7.37834325 396 | 2020-07-17,6.710417101 397 | 2020-07-18,5.592110626 398 | 2020-07-19,5.50647797 399 | 2020-07-20,6.957916589 400 | 2020-07-21,6.187983012 401 | 2020-07-22,4.723690562 402 | 2020-07-23,3.544173932 403 | 2020-07-24,6.917418543 404 | 2020-07-25,7.243634181 405 | 2020-07-26,4.90681677 406 | 2020-07-27,7.102097821 407 | 2020-07-28,4.500783529 408 | 2020-07-29,4.42180725 409 | 2020-07-30,5.169547229 410 | 2020-07-31,6.594260176 411 | 2020-08-01,5.58694822 412 | 2020-08-02,5.509434332 413 | 2020-08-03,5.90363862 414 | 2020-08-04,6.039864555 415 | 2020-08-05,7.528578463 416 | 2020-08-06,5.030232744 417 | 2020-08-07,6.121413308 418 | 2020-08-08,7.045389406 419 | 2020-08-09,5.822215755 420 | 2020-08-10,5.808711497 421 | 2020-08-11,3.857726825 422 | 2020-08-12,4.820646002 423 | 2020-08-13,5.488774372 424 | 2020-08-14,5.723085156 425 | 2020-08-15,4.475016789 426 | 2020-08-16,5.958120227 427 | 2020-08-17,5.880031361 428 | 2020-08-18,6.85041649 429 | 2020-08-19,4.473440802 430 | 2020-08-20,6.737608194 431 | 2020-08-21,5.959318144 432 | 2020-08-22,3.48983603 433 | 2020-08-23,5.891950821 434 | 2020-08-24,6.84675458 435 | 2020-08-25,6.490225904 436 | 2020-08-26,5.369316516 437 | 2020-08-27,5.913125446 438 | 2020-08-28,6.225703785 439 | 2020-08-29,5.68548133 440 | 2020-08-30,5.534986618 441 | 2020-08-31,5.709549026 442 | 2020-09-01,6.868805099 443 | 2020-09-02,7.416149072 444 | 2020-09-03,7.268413466 445 | 2020-09-04,6.186666734 446 | 2020-09-05,5.722263842 447 | 2020-09-06,5.344360108 448 | 2020-09-07,7.639625285 449 | 2020-09-08,6.457397779 450 | 2020-09-09,5.710385281 451 | 2020-09-10,6.362041449 452 | 2020-09-11,7.973894443 453 | 2020-09-12,8.811238398 454 | 2020-09-13,6.664137499 455 | 2020-09-14,6.05486666 456 | 2020-09-15,6.826590389 457 | 2020-09-16,7.07057861 458 | 2020-09-17,5.20962189 459 | 2020-09-18,7.302501503 460 | 2020-09-19,6.962506636 461 | 2020-09-20,7.827663879 462 | 2020-09-21,9.594007003 463 | 2020-09-22,6.796779013 464 | 2020-09-23,6.53052876 465 | 2020-09-24,6.00629214 466 | 2020-09-25,4.996432107 467 | 2020-09-26,6.613292807 468 | 2020-09-27,6.719747517 469 | 2020-09-28,8.122762797 470 | 2020-09-29,7.70483129 471 | 2020-09-30,5.215941272 472 | 2020-10-01,7.354436347 473 | 2020-10-02,6.952377234 474 | 2020-10-03,6.738439972 475 | 2020-10-04,7.87560896 476 | 2020-10-05,7.271306665 477 | 2020-10-06,6.484388986 478 | 2020-10-07,7.899231188 479 | 2020-10-08,7.594652898 480 | 2020-10-09,7.524472302 481 | 2020-10-10,7.337736987 482 | 2020-10-11,8.003353142 483 | 2020-10-12,5.3842443 484 | 2020-10-13,7.020003643 485 | 2020-10-14,7.963162956 486 | 2020-10-15,7.092755746 487 | 2020-10-16,6.518493624 488 | 2020-10-17,8.686854616 489 | 2020-10-18,8.26941415 490 | 2020-10-19,8.064931123 491 | 2020-10-20,6.721609922 492 | 2020-10-21,7.74503927 493 | 2020-10-22,5.887897212 494 | 2020-10-23,8.890944413 495 | 2020-10-24,7.301421684 496 | 2020-10-25,10.11897715 497 | 2020-10-26,7.952825588 498 | 2020-10-27,8.027612875 499 | 2020-10-28,7.945370639 500 | 2020-10-29,7.778149095 501 | 2020-10-30,9.04147371 502 | 2020-10-31,6.480386752 503 | 2020-11-01,7.427205416 504 | 2020-11-02,7.672077075 505 | 2020-11-03,7.773321553 506 | 2020-11-04,9.18750164 507 | 2020-11-05,8.650571083 508 | 2020-11-06,9.417749755 509 | 2020-11-07,6.330327481 510 | 2020-11-08,8.59008165 511 | 2020-11-09,7.305869705 512 | 2020-11-10,7.859326642 513 | 2020-11-11,5.640431645 514 | 2020-11-12,6.177152517 515 | 2020-11-13,7.498594835 516 | 2020-11-14,10.07369267 517 | 2020-11-15,5.285485409 518 | 2020-11-16,8.065175094 519 | 2020-11-17,6.98010121 520 | 2020-11-18,5.543756315 521 | 2020-11-19,8.158782592 522 | 2020-11-20,6.163495173 523 | 2020-11-21,7.982646841 524 | 2020-11-22,9.115146028 525 | 2020-11-23,6.405631323 526 | 2020-11-24,6.76730691 527 | 2020-11-25,6.755268697 528 | 2020-11-26,8.999770366 529 | 2020-11-27,5.182804407 530 | 2020-11-28,7.094965393 531 | 2020-11-29,7.075734707 532 | 2020-11-30,5.374194174 533 | 2020-12-01,7.737158658 534 | 2020-12-02,6.793124864 535 | 2020-12-03,6.453141909 536 | 2020-12-04,5.775282979 537 | 2020-12-05,8.936874441 538 | 2020-12-06,7.3759643 539 | 2020-12-07,8.228926814 540 | 2020-12-08,6.501551374 541 | 2020-12-09,7.936501292 542 | 2020-12-10,6.52890515 543 | 2020-12-11,8.743248647 544 | 2020-12-12,7.413241188 545 | 2020-12-13,6.410976417 546 | 2020-12-14,7.022103223 547 | 2020-12-15,5.370898103 548 | 2020-12-16,5.113824101 549 | 2020-12-17,6.299091055 550 | 2020-12-18,6.986755067 551 | 2020-12-19,6.263940969 552 | 2020-12-20,6.593635377 553 | 2020-12-21,5.245226405 554 | 2020-12-22,6.392585548 555 | 2020-12-23,6.194036693 556 | 2020-12-24,6.858007198 557 | 2020-12-25,5.77991719 558 | 2020-12-26,7.102949536 559 | 2020-12-27,6.80425642 560 | 2020-12-28,6.695818039 561 | 2020-12-29,6.308093972 562 | 2020-12-30,7.228200787 563 | 2020-12-31,3.658967841 564 | 2021-01-01,5.753141751 565 | 2021-01-02,5.715437311 566 | 2021-01-03,5.69076561 567 | 2021-01-04,3.847652677 568 | 2021-01-05,6.564874449 569 | 2021-01-06,4.973878257 570 | 2021-01-07,5.339017552 571 | 2021-01-08,5.806436374 572 | 2021-01-09,5.08269093 573 | 2021-01-10,5.573708102 574 | 2021-01-11,4.552371862 575 | 2021-01-12,5.714621504 576 | 2021-01-13,6.439027274 577 | 2021-01-14,6.602176318 578 | 2021-01-15,7.292456381 579 | 2021-01-16,5.678888241 580 | 2021-01-17,4.844452003 581 | 2021-01-18,5.710976701 582 | 2021-01-19,6.204953024 583 | 2021-01-20,5.344485612 584 | 2021-01-21,6.159871679 585 | 2021-01-22,4.328713099 586 | 2021-01-23,6.723714673 587 | 2021-01-24,6.35103142 588 | 2021-01-25,3.354886549 589 | 2021-01-26,5.712376966 590 | 2021-01-27,5.662906686 591 | 2021-01-28,4.941101953 592 | 2021-01-29,7.477237329 593 | 2021-01-30,5.588168784 594 | 2021-01-31,6.475091243 595 | 2021-02-01,4.679240737 596 | 2021-02-02,3.898453925 597 | 2021-02-03,5.417568909 598 | 2021-02-04,5.190839706 599 | 2021-02-05,3.301564687 600 | 2021-02-06,4.454579392 601 | 2021-02-07,4.564912819 602 | -------------------------------------------------------------------------------- /grand/datasets/data/toy1/unit3.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,0.431789259 3 | 2019-06-20,1.840848441 4 | 2019-06-21,1.277408791 5 | 2019-06-22,2.30207694 6 | 2019-06-23,1.072696118 7 | 2019-06-24,0.45844979 8 | 2019-06-25,1.36626418 9 | 2019-06-26,0.707405458 10 | 2019-06-27,1.885498139 11 | 2019-06-28,1.892079177 12 | 2019-06-29,1.644197823 13 | 2019-06-30,2.302628313 14 | 2019-07-01,1.704863223 15 | 2019-07-02,2.044774046 16 | 2019-07-03,2.212508613 17 | 2019-07-04,1.46765754 18 | 2019-07-05,0.970886942 19 | 2019-07-06,3.064437991 20 | 2019-07-07,2.335915239 21 | 2019-07-08,1.427801666 22 | 2019-07-09,1.381148043 23 | 2019-07-10,0.648850209 24 | 2019-07-11,1.274722951 25 | 2019-07-12,1.271353241 26 | 2019-07-13,1.47271645 27 | 2019-07-14,1.289313449 28 | 2019-07-15,1.996477615 29 | 2019-07-16,1.356054894 30 | 2019-07-17,2.101624684 31 | 2019-07-18,1.773018983 32 | 2019-07-19,1.519842967 33 | 2019-07-20,1.71253023 34 | 2019-07-21,2.951629512 35 | 2019-07-22,1.458626492 36 | 2019-07-23,3.589346542 37 | 2019-07-24,2.978437974 38 | 2019-07-25,1.851648392 39 | 2019-07-26,1.977928921 40 | 2019-07-27,2.042381811 41 | 2019-07-28,1.807907064 42 | 2019-07-29,2.238879168 43 | 2019-07-30,1.99504815 44 | 2019-07-31,1.669342231 45 | 2019-08-01,1.689204186 46 | 2019-08-02,2.19476844 47 | 2019-08-03,2.54684938 48 | 2019-08-04,2.977345616 49 | 2019-08-05,1.721361498 50 | 2019-08-06,2.372874398 51 | 2019-08-07,2.879270765 52 | 2019-08-08,2.592694411 53 | 2019-08-09,1.775228222 54 | 2019-08-10,2.300307359 55 | 2019-08-11,1.836166244 56 | 2019-08-12,2.922462829 57 | 2019-08-13,2.3783271 58 | 2019-08-14,2.076129461 59 | 2019-08-15,3.220628605 60 | 2019-08-16,3.167197011 61 | 2019-08-17,1.868792017 62 | 2019-08-18,2.487624023 63 | 2019-08-19,2.700919843 64 | 2019-08-20,2.481292523 65 | 2019-08-21,2.564690171 66 | 2019-08-22,3.501036162 67 | 2019-08-23,3.263695646 68 | 2019-08-24,3.600235026 69 | 2019-08-25,3.154581668 70 | 2019-08-26,4.141370831 71 | 2019-08-27,3.040937724 72 | 2019-08-28,2.077712382 73 | 2019-08-29,2.662998478 74 | 2019-08-30,2.623913381 75 | 2019-08-31,3.650124655 76 | 2019-09-01,2.473595862 77 | 2019-09-02,2.976856606 78 | 2019-09-03,3.161285744 79 | 2019-09-04,2.525104724 80 | 2019-09-05,3.472800633 81 | 2019-09-06,4.637258312 82 | 2019-09-07,3.863573973 83 | 2019-09-08,3.541289084 84 | 2019-09-09,4.249255818 85 | 2019-09-10,3.666954085 86 | 2019-09-11,2.916712022 87 | 2019-09-12,2.998792682 88 | 2019-09-13,3.794154388 89 | 2019-09-14,2.604717404 90 | 2019-09-15,3.174159031 91 | 2019-09-16,4.32993677 92 | 2019-09-17,4.580016815 93 | 2019-09-18,3.494016078 94 | 2019-09-19,3.356340075 95 | 2019-09-20,4.488038029 96 | 2019-09-21,3.029318245 97 | 2019-09-22,4.053691264 98 | 2019-09-23,4.618721077 99 | 2019-09-24,4.847263855 100 | 2019-09-25,3.197166564 101 | 2019-09-26,3.9535789 102 | 2019-09-27,4.466450941 103 | 2019-09-28,4.166152506 104 | 2019-09-29,4.367459341 105 | 2019-09-30,4.511754329 106 | 2019-10-01,2.962684523 107 | 2019-10-02,5.050727277 108 | 2019-10-03,4.172518778 109 | 2019-10-04,4.801938004 110 | 2019-10-05,3.467271383 111 | 2019-10-06,4.32916357 112 | 2019-10-07,3.360624647 113 | 2019-10-08,5.003791944 114 | 2019-10-09,4.450130788 115 | 2019-10-10,3.874250476 116 | 2019-10-11,3.903793972 117 | 2019-10-12,2.360213773 118 | 2019-10-13,3.756943358 119 | 2019-10-14,2.576538943 120 | 2019-10-15,2.591316459 121 | 2019-10-16,3.963352765 122 | 2019-10-17,3.091561742 123 | 2019-10-18,4.692197904 124 | 2019-10-19,3.60426946 125 | 2019-10-20,3.25258196 126 | 2019-10-21,3.444755683 127 | 2019-10-22,4.193818875 128 | 2019-10-23,4.243082644 129 | 2019-10-24,4.037155209 130 | 2019-10-25,3.954613354 131 | 2019-10-26,3.684861203 132 | 2019-10-27,3.795211062 133 | 2019-10-28,2.766014648 134 | 2019-10-29,3.709286903 135 | 2019-10-30,2.816775676 136 | 2019-10-31,3.676949332 137 | 2019-11-01,2.708127269 138 | 2019-11-02,2.668109752 139 | 2019-11-03,1.899239393 140 | 2019-11-04,2.978395381 141 | 2019-11-05,2.652607261 142 | 2019-11-06,3.444974266 143 | 2019-11-07,2.159283077 144 | 2019-11-08,2.662534606 145 | 2019-11-09,3.521751057 146 | 2019-11-10,2.613415852 147 | 2019-11-11,3.486306775 148 | 2019-11-12,2.193170924 149 | 2019-11-13,2.112625649 150 | 2019-11-14,2.895414411 151 | 2019-11-15,1.688630587 152 | 2019-11-16,2.011880684 153 | 2019-11-17,2.72078486 154 | 2019-11-18,2.972548124 155 | 2019-11-19,2.196141776 156 | 2019-11-20,2.647042616 157 | 2019-11-21,2.177056304 158 | 2019-11-22,1.181130852 159 | 2019-11-23,1.54578532 160 | 2019-11-24,1.957124403 161 | 2019-11-25,1.964380469 162 | 2019-11-26,2.63714417 163 | 2019-11-27,2.32848154 164 | 2019-11-28,1.716021771 165 | 2019-11-29,2.01233537 166 | 2019-11-30,1.339817304 167 | 2019-12-01,1.417201387 168 | 2019-12-02,2.238557771 169 | 2019-12-03,1.920604223 170 | 2019-12-04,2.489009787 171 | 2019-12-05,2.035171446 172 | 2019-12-06,1.974359473 173 | 2019-12-07,2.659759796 174 | 2019-12-08,1.80332331 175 | 2019-12-09,0.911310216 176 | 2019-12-10,0.855324805 177 | 2019-12-11,1.016447147 178 | 2019-12-12,0.894257125 179 | 2019-12-13,1.412707552 180 | 2019-12-14,2.498155953 181 | 2019-12-15,1.997148331 182 | 2019-12-16,0.771354024 183 | 2019-12-17,2.620874896 184 | 2019-12-18,1.473899522 185 | 2019-12-19,1.552097623 186 | 2019-12-20,1.516442516 187 | 2019-12-21,-0.098612931 188 | 2019-12-22,1.080175235 189 | 2019-12-23,1.566097416 190 | 2019-12-24,1.467769403 191 | 2019-12-25,1.621237329 192 | 2019-12-26,0.579078429 193 | 2019-12-27,0.471832169 194 | 2019-12-28,1.848431926 195 | 2019-12-29,1.531622969 196 | 2019-12-30,0.656679224 197 | 2019-12-31,0.718611773 198 | 2020-01-01,1.038149794 199 | 2020-01-02,0.743852167 200 | 2020-01-03,0.034852936 201 | 2020-01-04,1.289631624 202 | 2020-01-05,1.274372604 203 | 2020-01-06,1.434348842 204 | 2020-01-07,0.718462697 205 | 2020-01-08,2.03083965 206 | 2020-01-09,1.511616673 207 | 2020-01-10,1.160796735 208 | 2020-01-11,1.946868242 209 | 2020-01-12,1.774775521 210 | 2020-01-13,1.101465158 211 | 2020-01-14,1.519679859 212 | 2020-01-15,2.128307746 213 | 2020-01-16,2.359027665 214 | 2020-01-17,1.963616572 215 | 2020-01-18,2.507305726 216 | 2020-01-19,1.024234414 217 | 2020-01-20,1.793751305 218 | 2020-01-21,1.613334934 219 | 2020-01-22,1.629033722 220 | 2020-01-23,1.172574301 221 | 2020-01-24,2.069660849 222 | 2020-01-25,1.118998476 223 | 2020-01-26,0.850387225 224 | 2020-01-27,1.395355647 225 | 2020-01-28,2.203774265 226 | 2020-01-29,1.524666685 227 | 2020-01-30,1.59049457 228 | 2020-01-31,1.559067548 229 | 2020-02-01,2.063234195 230 | 2020-02-02,1.941546231 231 | 2020-02-03,2.624626292 232 | 2020-02-04,2.865584112 233 | 2020-02-05,0.742328513 234 | 2020-02-06,2.221796258 235 | 2020-02-07,2.6831757 236 | 2020-02-08,1.616364281 237 | 2020-02-09,1.998518114 238 | 2020-02-10,2.390704904 239 | 2020-02-11,1.774699915 240 | 2020-02-12,2.570187883 241 | 2020-02-13,2.814723203 242 | 2020-02-14,2.047682034 243 | 2020-02-15,2.669098191 244 | 2020-02-16,2.62019984 245 | 2020-02-17,2.142167945 246 | 2020-02-18,3.230320536 247 | 2020-02-19,2.770715189 248 | 2020-02-20,2.391898189 249 | 2020-02-21,2.196032753 250 | 2020-02-22,2.017907245 251 | 2020-02-23,2.336553965 252 | 2020-02-24,1.156075259 253 | 2020-02-25,3.909590994 254 | 2020-02-26,3.20232318 255 | 2020-02-27,2.302747434 256 | 2020-02-28,2.280064913 257 | 2020-02-29,2.584591896 258 | 2020-03-01,2.531415875 259 | 2020-03-02,2.234709813 260 | 2020-03-03,2.419827351 261 | 2020-03-04,1.867042562 262 | 2020-03-05,2.634952221 263 | 2020-03-06,3.659103793 264 | 2020-03-07,3.167991588 265 | 2020-03-08,2.527905906 266 | 2020-03-09,2.703972856 267 | 2020-03-10,3.767083139 268 | 2020-03-11,3.539999036 269 | 2020-03-12,3.217972849 270 | 2020-03-13,3.642396406 271 | 2020-03-14,3.784100654 272 | 2020-03-15,3.30584033 273 | 2020-03-16,2.981544039 274 | 2020-03-17,4.257413947 275 | 2020-03-18,3.320744469 276 | 2020-03-19,2.785791322 277 | 2020-03-20,2.813697058 278 | 2020-03-21,2.706247973 279 | 2020-03-22,3.069765206 280 | 2020-03-23,3.348678381 281 | 2020-03-24,2.995392828 282 | 2020-03-25,3.424690063 283 | 2020-03-26,2.839596563 284 | 2020-03-27,2.879081602 285 | 2020-03-28,3.680021803 286 | 2020-03-29,4.862955552 287 | 2020-03-30,3.178103745 288 | 2020-03-31,3.87338204 289 | 2020-04-01,4.463175939 290 | 2020-04-02,3.209895106 291 | 2020-04-03,4.734263781 292 | 2020-04-04,4.01409865 293 | 2020-04-05,4.260136377 294 | 2020-04-06,4.255554551 295 | 2020-04-07,3.222541379 296 | 2020-04-08,3.746183432 297 | 2020-04-09,3.77201315 298 | 2020-04-10,3.838167282 299 | 2020-04-11,4.552427119 300 | 2020-04-12,3.80141568 301 | 2020-04-13,4.377007888 302 | 2020-04-14,3.281007493 303 | 2020-04-15,3.526368138 304 | 2020-04-16,3.264106621 305 | 2020-04-17,4.668159713 306 | 2020-04-18,4.104343099 307 | 2020-04-19,3.958048311 308 | 2020-04-20,3.491676616 309 | 2020-04-21,3.868374196 310 | 2020-04-22,3.441406383 311 | 2020-04-23,4.40405641 312 | 2020-04-24,4.999831686 313 | 2020-04-25,4.48374139 314 | 2020-04-26,3.005357222 315 | 2020-04-27,3.460398012 316 | 2020-04-28,3.596833585 317 | 2020-04-29,3.312817462 318 | 2020-04-30,3.443662295 319 | 2020-05-01,3.452734926 320 | 2020-05-02,2.786326644 321 | 2020-05-03,2.866682033 322 | 2020-05-04,3.403779345 323 | 2020-05-05,3.900387369 324 | 2020-05-06,3.137666574 325 | 2020-05-07,3.523252822 326 | 2020-05-08,3.014856098 327 | 2020-05-09,3.702298776 328 | 2020-05-10,4.405360075 329 | 2020-05-11,4.124871604 330 | 2020-05-12,3.421240082 331 | 2020-05-13,3.441469369 332 | 2020-05-14,2.745921953 333 | 2020-05-15,2.688401482 334 | 2020-05-16,2.765058905 335 | 2020-05-17,3.820987074 336 | 2020-05-18,3.601418629 337 | 2020-05-19,2.892518711 338 | 2020-05-20,2.346173492 339 | 2020-05-21,3.711013862 340 | 2020-05-22,2.018806007 341 | 2020-05-23,2.538433849 342 | 2020-05-24,2.350466975 343 | 2020-05-25,1.522601493 344 | 2020-05-26,3.301474465 345 | 2020-05-27,3.344981383 346 | 2020-05-28,2.22012342 347 | 2020-05-29,2.355172284 348 | 2020-05-30,1.559118139 349 | 2020-05-31,2.419365182 350 | 2020-06-01,2.544201132 351 | 2020-06-02,2.6364636 352 | 2020-06-03,2.485070013 353 | 2020-06-04,1.806944587 354 | 2020-06-05,2.370865614 355 | 2020-06-06,2.245562876 356 | 2020-06-07,2.970635696 357 | 2020-06-08,1.547682986 358 | 2020-06-09,2.531347028 359 | 2020-06-10,2.040233679 360 | 2020-06-11,3.030967221 361 | 2020-06-12,2.848285303 362 | 2020-06-13,2.155222642 363 | 2020-06-14,2.008579498 364 | 2020-06-15,2.602813471 365 | 2020-06-16,2.132586975 366 | 2020-06-17,1.291929961 367 | 2020-06-18,1.762286744 368 | 2020-06-19,2.910107578 369 | 2020-06-20,1.708493169 370 | 2020-06-21,2.628382032 371 | 2020-06-22,1.227228853 372 | 2020-06-23,2.045563854 373 | 2020-06-24,1.400298006 374 | 2020-06-25,1.730628633 375 | 2020-06-26,2.348775708 376 | 2020-06-27,0.724391061 377 | 2020-06-28,1.47894097 378 | 2020-06-29,1.470052498 379 | 2020-06-30,2.289168615 380 | 2020-07-01,1.199612981 381 | 2020-07-02,1.756074351 382 | 2020-07-03,1.341103172 383 | 2020-07-04,1.381015629 384 | 2020-07-05,1.066644769 385 | 2020-07-06,0.903287475 386 | 2020-07-07,1.27259123 387 | 2020-07-08,2.000765683 388 | 2020-07-09,1.053831043 389 | 2020-07-10,1.785914783 390 | 2020-07-11,2.145998803 391 | 2020-07-12,0.856113067 392 | 2020-07-13,0.918074577 393 | 2020-07-14,0.706086781 394 | 2020-07-15,1.107775297 395 | 2020-07-16,1.775326356 396 | 2020-07-17,1.787219639 397 | 2020-07-18,1.841850753 398 | 2020-07-19,0.21713888 399 | 2020-07-20,1.66218487 400 | 2020-07-21,0.849524803 401 | 2020-07-22,0.221284251 402 | 2020-07-23,1.478233293 403 | 2020-07-24,0.800690134 404 | 2020-07-25,0.407191548 405 | 2020-07-26,0.110365201 406 | 2020-07-27,0.81194122 407 | 2020-07-28,0.989696642 408 | 2020-07-29,1.436159238 409 | 2020-07-30,1.672026397 410 | 2020-07-31,0.335155536 411 | 2020-08-01,1.1879364 412 | 2020-08-02,0.505369466 413 | 2020-08-03,0.236633201 414 | 2020-08-04,1.377036099 415 | 2020-08-05,1.787190043 416 | 2020-08-06,1.802315589 417 | 2020-08-07,1.767801026 418 | 2020-08-08,1.543453664 419 | 2020-08-09,2.341677686 420 | 2020-08-10,1.621949406 421 | 2020-08-11,0.995714509 422 | 2020-08-12,0.39574503 423 | 2020-08-13,2.408427305 424 | 2020-08-14,1.236166843 425 | 2020-08-15,1.46068765 426 | 2020-08-16,1.525561798 427 | 2020-08-17,0.84496718 428 | 2020-08-18,1.693788896 429 | 2020-08-19,1.785850457 430 | 2020-08-20,2.10208727 431 | 2020-08-21,0.504045371 432 | 2020-08-22,2.465662552 433 | 2020-08-23,1.971747104 434 | 2020-08-24,1.31037831 435 | 2020-08-25,2.144921339 436 | 2020-08-26,1.97153394 437 | 2020-08-27,0.974435596 438 | 2020-08-28,1.849541756 439 | 2020-08-29,1.793756755 440 | 2020-08-30,2.635148633 441 | 2020-08-31,3.028120427 442 | 2020-09-01,2.331296178 443 | 2020-09-02,2.391041101 444 | 2020-09-03,1.629385633 445 | 2020-09-04,1.981407544 446 | 2020-09-05,1.885040912 447 | 2020-09-06,2.103185451 448 | 2020-09-07,1.79165421 449 | 2020-09-08,2.278232877 450 | 2020-09-09,2.585908223 451 | 2020-09-10,2.300449214 452 | 2020-09-11,2.694276281 453 | 2020-09-12,2.233922368 454 | 2020-09-13,2.237194704 455 | 2020-09-14,3.35500593 456 | 2020-09-15,2.679045025 457 | 2020-09-16,2.27536184 458 | 2020-09-17,2.65440333 459 | 2020-09-18,2.949126242 460 | 2020-09-19,2.422858869 461 | 2020-09-20,3.92094278 462 | 2020-09-21,3.193235448 463 | 2020-09-22,2.306564966 464 | 2020-09-23,1.803281484 465 | 2020-09-24,3.138768533 466 | 2020-09-25,2.866150769 467 | 2020-09-26,2.513864953 468 | 2020-09-27,2.915974304 469 | 2020-09-28,3.099647836 470 | 2020-09-29,3.19085066 471 | 2020-09-30,2.780399035 472 | 2020-10-01,2.765066192 473 | 2020-10-02,3.319870605 474 | 2020-10-03,3.441386935 475 | 2020-10-04,3.781413902 476 | 2020-10-05,3.500140199 477 | 2020-10-06,3.252136888 478 | 2020-10-07,2.954958846 479 | 2020-10-08,2.154772353 480 | 2020-10-09,3.219896835 481 | 2020-10-10,4.404306451 482 | 2020-10-11,2.774581659 483 | 2020-10-12,3.418763719 484 | 2020-10-13,3.295044438 485 | 2020-10-14,2.784385092 486 | 2020-10-15,2.888616983 487 | 2020-10-16,3.920635762 488 | 2020-10-17,4.186048989 489 | 2020-10-18,3.456589914 490 | 2020-10-19,3.118266359 491 | 2020-10-20,2.956544158 492 | 2020-10-21,3.72697111 493 | 2020-10-22,2.787721931 494 | 2020-10-23,2.948440427 495 | 2020-10-24,3.406684641 496 | 2020-10-25,3.735054715 497 | 2020-10-26,3.625500051 498 | 2020-10-27,4.341158803 499 | 2020-10-28,4.016102967 500 | 2020-10-29,4.380119429 501 | 2020-10-30,3.750912103 502 | 2020-10-31,3.689324923 503 | 2020-11-01,3.798053469 504 | 2020-11-02,3.373733243 505 | 2020-11-03,3.704832624 506 | 2020-11-04,3.882732414 507 | 2020-11-05,4.268068201 508 | 2020-11-06,4.085365318 509 | 2020-11-07,4.610505274 510 | 2020-11-08,2.69133468 511 | 2020-11-09,4.182639284 512 | 2020-11-10,2.966265116 513 | 2020-11-11,4.903127786 514 | 2020-11-12,4.08330143 515 | 2020-11-13,3.478501703 516 | 2020-11-14,4.142181998 517 | 2020-11-15,3.992772936 518 | 2020-11-16,3.458749287 519 | 2020-11-17,4.073541158 520 | 2020-11-18,3.597767683 521 | 2020-11-19,3.421611149 522 | 2020-11-20,3.002064851 523 | 2020-11-21,3.071330787 524 | 2020-11-22,3.008140419 525 | 2020-11-23,3.895898159 526 | 2020-11-24,3.735830424 527 | 2020-11-25,3.383224916 528 | 2020-11-26,3.315992299 529 | 2020-11-27,2.974803835 530 | 2020-11-28,3.337258672 531 | 2020-11-29,3.385318858 532 | 2020-11-30,3.175084197 533 | 2020-12-01,3.75301504 534 | 2020-12-02,1.78962628 535 | 2020-12-03,2.536662165 536 | 2020-12-04,2.658989882 537 | 2020-12-05,3.318850284 538 | 2020-12-06,3.954161877 539 | 2020-12-07,3.195981364 540 | 2020-12-08,2.393112421 541 | 2020-12-09,2.701938038 542 | 2020-12-10,3.633494783 543 | 2020-12-11,4.029219469 544 | 2020-12-12,2.370720289 545 | 2020-12-13,2.119624877 546 | 2020-12-14,2.615212698 547 | 2020-12-15,2.522810844 548 | 2020-12-16,2.669317096 549 | 2020-12-17,3.574500938 550 | 2020-12-18,1.85231117 551 | 2020-12-19,2.712554533 552 | 2020-12-20,2.002874252 553 | 2020-12-21,2.144854528 554 | 2020-12-22,1.865692092 555 | 2020-12-23,2.151829583 556 | 2020-12-24,2.013011971 557 | 2020-12-25,2.853842703 558 | 2020-12-26,2.480395005 559 | 2020-12-27,1.89922531 560 | 2020-12-28,1.401252189 561 | 2020-12-29,2.257546252 562 | 2020-12-30,1.916896991 563 | 2020-12-31,1.753398719 564 | 2021-01-01,2.179726077 565 | 2021-01-02,2.380160795 566 | 2021-01-03,2.162824452 567 | 2021-01-04,1.791661374 568 | 2021-01-05,2.658044043 569 | 2021-01-06,2.58644114 570 | 2021-01-07,2.38183361 571 | 2021-01-08,2.348835931 572 | 2021-01-09,1.816767312 573 | 2021-01-10,2.265924896 574 | 2021-01-11,2.631927673 575 | 2021-01-12,1.041240502 576 | 2021-01-13,0.976223656 577 | 2021-01-14,1.332420723 578 | 2021-01-15,2.665234743 579 | 2021-01-16,2.156201906 580 | 2021-01-17,1.894553795 581 | 2021-01-18,1.547985122 582 | 2021-01-19,2.130703424 583 | 2021-01-20,2.025230726 584 | 2021-01-21,1.049540138 585 | 2021-01-22,1.571096543 586 | 2021-01-23,1.158153148 587 | 2021-01-24,0.66553072 588 | 2021-01-25,0.655254507 589 | 2021-01-26,2.489642372 590 | 2021-01-27,0.63145777 591 | 2021-01-28,1.425022996 592 | 2021-01-29,0.858717528 593 | 2021-01-30,1.580342827 594 | 2021-01-31,1.278922157 595 | 2021-02-01,1.695377999 596 | 2021-02-02,1.442361647 597 | 2021-02-03,0.35882126 598 | 2021-02-04,2.073242347 599 | 2021-02-05,0.521619788 600 | 2021-02-06,1.39550527 601 | 2021-02-07,0.39884028 602 | -------------------------------------------------------------------------------- /grand/datasets/data/toy4/unit4.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 2019-06-19,1.455939539 3 | 2019-06-20,2.845647873 4 | 2019-06-21,2.502122707 5 | 2019-06-22,2.940523304 6 | 2019-06-23,2.124963315 7 | 2019-06-24,1.4143519 8 | 2019-06-25,2.032106384 9 | 2019-06-26,2.661000162 10 | 2019-06-27,2.075896234 11 | 2019-06-28,2.764934929 12 | 2019-06-29,1.928091933 13 | 2019-06-30,2.488123164 14 | 2019-07-01,2.250926192 15 | 2019-07-02,2.89703874 16 | 2019-07-03,2.089446666 17 | 2019-07-04,2.574709955 18 | 2019-07-05,1.762607162 19 | 2019-07-06,2.157814422 20 | 2019-07-07,2.481478848 21 | 2019-07-08,2.285785481 22 | 2019-07-09,2.756666994 23 | 2019-07-10,2.371811458 24 | 2019-07-11,2.34116413 25 | 2019-07-12,3.572946671 26 | 2019-07-13,2.082268904 27 | 2019-07-14,2.024176178 28 | 2019-07-15,2.369938786 29 | 2019-07-16,2.29958515 30 | 2019-07-17,2.466806277 31 | 2019-07-18,3.425945233 32 | 2019-07-19,2.53592851 33 | 2019-07-20,2.663073649 34 | 2019-07-21,2.150167212 35 | 2019-07-22,3.480285297 36 | 2019-07-23,3.184761094 37 | 2019-07-24,3.052739479 38 | 2019-07-25,2.446513124 39 | 2019-07-26,2.927619743 40 | 2019-07-27,3.436253752 41 | 2019-07-28,3.751593065 42 | 2019-07-29,3.470595625 43 | 2019-07-30,3.273676349 44 | 2019-07-31,3.527890153 45 | 2019-08-01,2.926993152 46 | 2019-08-02,4.175024811 47 | 2019-08-03,3.770483471 48 | 2019-08-04,2.720404609 49 | 2019-08-05,4.052404261 50 | 2019-08-06,3.157846909 51 | 2019-08-07,4.005286529 52 | 2019-08-08,3.718816453 53 | 2019-08-09,3.522482462 54 | 2019-08-10,3.624314224 55 | 2019-08-11,3.118678638 56 | 2019-08-12,4.47485876 57 | 2019-08-13,3.844014412 58 | 2019-08-14,4.390082092 59 | 2019-08-15,3.140657899 60 | 2019-08-16,3.645417031 61 | 2019-08-17,4.122268435 62 | 2019-08-18,3.130470485 63 | 2019-08-19,4.167705871 64 | 2019-08-20,4.091065323 65 | 2019-08-21,4.642389259 66 | 2019-08-22,3.949858427 67 | 2019-08-23,4.51398461 68 | 2019-08-24,4.535439308 69 | 2019-08-25,4.212046901 70 | 2019-08-26,3.773093424 71 | 2019-08-27,3.006747997 72 | 2019-08-28,3.785740575 73 | 2019-08-29,3.49149473 74 | 2019-08-30,4.037060579 75 | 2019-08-31,4.311060058 76 | 2019-09-01,4.363095868 77 | 2019-09-02,3.557617214 78 | 2019-09-03,4.329424789 79 | 2019-09-04,4.461783519 80 | 2019-09-05,3.335842368 81 | 2019-09-06,4.534232391 82 | 2019-09-07,5.123200812 83 | 2019-09-08,4.873579655 84 | 2019-09-09,3.176329442 85 | 2019-09-10,3.898722817 86 | 2019-09-11,4.40121488 87 | 2019-09-12,3.628108951 88 | 2019-09-13,4.241081884 89 | 2019-09-14,4.518683905 90 | 2019-09-15,3.868360505 91 | 2019-09-16,5.447339225 92 | 2019-09-17,4.163429004 93 | 2019-09-18,4.138588494 94 | 2019-09-19,3.66144254 95 | 2019-09-20,3.914511903 96 | 2019-09-21,5.280255803 97 | 2019-09-22,5.39383122 98 | 2019-09-23,5.221031814 99 | 2019-09-24,5.548893109 100 | 2019-09-25,3.80596093 101 | 2019-09-26,5.150791819 102 | 2019-09-27,4.757696152 103 | 2019-09-28,5.295494609 104 | 2019-09-29,4.708334413 105 | 2019-09-30,4.840729021 106 | 2019-10-01,5.032110684 107 | 2019-10-02,5.589176762 108 | 2019-10-03,4.171807556 109 | 2019-10-04,4.597783097 110 | 2019-10-05,4.796054426 111 | 2019-10-06,4.871959347 112 | 2019-10-07,4.679066286 113 | 2019-10-08,5.501340766 114 | 2019-10-09,4.887820961 115 | 2019-10-10,4.428112687 116 | 2019-10-11,4.637436468 117 | 2019-10-12,4.475123738 118 | 2019-10-13,5.12214026 119 | 2019-10-14,4.442474974 120 | 2019-10-15,4.498174156 121 | 2019-10-16,4.345550884 122 | 2019-10-17,4.952320636 123 | 2019-10-18,3.380705943 124 | 2019-10-19,4.291623837 125 | 2019-10-20,4.507147782 126 | 2019-10-21,3.745156475 127 | 2019-10-22,3.759378575 128 | 2019-10-23,3.896980698 129 | 2019-10-24,4.356306691 130 | 2019-10-25,3.305279583 131 | 2019-10-26,3.687604898 132 | 2019-10-27,4.064117148 133 | 2019-10-28,2.94453414 134 | 2019-10-29,4.327784645 135 | 2019-10-30,4.168623852 136 | 2019-10-31,6.149252489 137 | 2019-11-01,4.418173041 138 | 2019-11-02,3.639089928 139 | 2019-11-03,3.695456313 140 | 2019-11-04,4.582113971 141 | 2019-11-05,4.076825114 142 | 2019-11-06,4.099648797 143 | 2019-11-07,3.306047244 144 | 2019-11-08,3.959822583 145 | 2019-11-09,3.898300556 146 | 2019-11-10,3.834929241 147 | 2019-11-11,3.539285217 148 | 2019-11-12,3.935968583 149 | 2019-11-13,4.277353304 150 | 2019-11-14,1.999252052 151 | 2019-11-15,3.0145884 152 | 2019-11-16,3.663783671 153 | 2019-11-17,3.670931263 154 | 2019-11-18,2.999601607 155 | 2019-11-19,3.383854287 156 | 2019-11-20,1.76155603 157 | 2019-11-21,3.451134627 158 | 2019-11-22,3.241255118 159 | 2019-11-23,4.006360049 160 | 2019-11-24,3.405254942 161 | 2019-11-25,3.425535772 162 | 2019-11-26,4.707818432 163 | 2019-11-27,3.32770193 164 | 2019-11-28,1.890563563 165 | 2019-11-29,2.598091366 166 | 2019-11-30,2.933966367 167 | 2019-12-01,1.791005874 168 | 2019-12-02,3.135864099 169 | 2019-12-03,3.534898606 170 | 2019-12-04,2.981666183 171 | 2019-12-05,3.669392147 172 | 2019-12-06,3.604955484 173 | 2019-12-07,4.275735951 174 | 2019-12-08,3.3372815 175 | 2019-12-09,2.497973281 176 | 2019-12-10,3.077513033 177 | 2019-12-11,2.57848736 178 | 2019-12-12,3.13478468 179 | 2019-12-13,2.353823034 180 | 2019-12-14,2.511903013 181 | 2019-12-15,1.673152109 182 | 2019-12-16,2.016647342 183 | 2019-12-17,1.770205935 184 | 2019-12-18,2.841989173 185 | 2019-12-19,2.592108877 186 | 2019-12-20,2.166838485 187 | 2019-12-21,2.942184348 188 | 2019-12-22,2.65313147 189 | 2019-12-23,2.788169245 190 | 2019-12-24,2.267656535 191 | 2019-12-25,2.272300481 192 | 2019-12-26,1.454645919 193 | 2019-12-27,1.584254181 194 | 2019-12-28,2.490680744 195 | 2019-12-29,2.848690921 196 | 2019-12-30,1.672194288 197 | 2019-12-31,1.464238328 198 | 2020-01-01,1.4943612 199 | 2020-01-02,1.61503247 200 | 2020-01-03,0.443082107 201 | 2020-01-04,1.74443296 202 | 2020-01-05,4.410520763 203 | 2020-01-06,4.716892444 204 | 2020-01-07,4.842942009 205 | 2020-01-08,5.023576757 206 | 2020-01-09,5.200466853 207 | 2020-01-10,5.553862396 208 | 2020-01-11,4.22529426 209 | 2020-01-12,4.789779409 210 | 2020-01-13,3.847028054 211 | 2020-01-14,4.084168074 212 | 2020-01-15,5.074758621 213 | 2020-01-16,4.350705427 214 | 2020-01-17,5.687602532 215 | 2020-01-18,5.123697755 216 | 2020-01-19,4.555685914 217 | 2020-01-20,4.504265503 218 | 2020-01-21,4.558792422 219 | 2020-01-22,3.421375753 220 | 2020-01-23,3.289449111 221 | 2020-01-24,4.575281066 222 | 2020-01-25,3.174376442 223 | 2020-01-26,3.848597934 224 | 2020-01-27,3.964706284 225 | 2020-01-28,4.022490989 226 | 2020-01-29,3.851713768 227 | 2020-01-30,3.974995284 228 | 2020-01-31,4.551939128 229 | 2020-02-01,4.10661987 230 | 2020-02-02,4.421636595 231 | 2020-02-03,3.217418419 232 | 2020-02-04,4.037770562 233 | 2020-02-05,4.508125837 234 | 2020-02-06,3.095634923 235 | 2020-02-07,3.35563768 236 | 2020-02-08,3.73154008 237 | 2020-02-09,2.61194635 238 | 2020-02-10,3.894071431 239 | 2020-02-11,2.973021751 240 | 2020-02-12,3.30837285 241 | 2020-02-13,4.082223868 242 | 2020-02-14,2.579212941 243 | 2020-02-15,3.845651449 244 | 2020-02-16,3.401727676 245 | 2020-02-17,4.730890237 246 | 2020-02-18,3.582127049 247 | 2020-02-19,3.801137291 248 | 2020-02-20,3.847107631 249 | 2020-02-21,2.733484897 250 | 2020-02-22,3.574199119 251 | 2020-02-23,4.088609175 252 | 2020-02-24,4.075303617 253 | 2020-02-25,2.612975971 254 | 2020-02-26,3.592288158 255 | 2020-02-27,4.088492634 256 | 2020-02-28,3.376952775 257 | 2020-02-29,4.01663555 258 | 2020-03-01,4.053660481 259 | 2020-03-02,3.230064476 260 | 2020-03-03,2.525534794 261 | 2020-03-04,3.414481583 262 | 2020-03-05,2.504486844 263 | 2020-03-06,2.817405623 264 | 2020-03-07,2.215513462 265 | 2020-03-08,2.960141936 266 | 2020-03-09,2.174710095 267 | 2020-03-10,3.240202656 268 | 2020-03-11,2.95925792 269 | 2020-03-12,3.392835589 270 | 2020-03-13,2.261535801 271 | 2020-03-14,2.4649715 272 | 2020-03-15,3.051824382 273 | 2020-03-16,3.048529508 274 | 2020-03-17,2.743918018 275 | 2020-03-18,3.17754558 276 | 2020-03-19,1.654560176 277 | 2020-03-20,1.770353879 278 | 2020-03-21,2.346426441 279 | 2020-03-22,2.589233183 280 | 2020-03-23,3.108619811 281 | 2020-03-24,3.891790914 282 | 2020-03-25,2.392697268 283 | 2020-03-26,3.036117145 284 | 2020-03-27,2.461781822 285 | 2020-03-28,2.345935791 286 | 2020-03-29,3.145412626 287 | 2020-03-30,3.193124979 288 | 2020-03-31,2.239052797 289 | 2020-04-01,2.92162142 290 | 2020-04-02,2.692991622 291 | 2020-04-03,3.151627059 292 | 2020-04-04,2.649640513 293 | 2020-04-05,2.484411064 294 | 2020-04-06,1.914102773 295 | 2020-04-07,2.040251971 296 | 2020-04-08,2.142324008 297 | 2020-04-09,2.095307506 298 | 2020-04-10,2.060486248 299 | 2020-04-11,1.954953855 300 | 2020-04-12,1.731846687 301 | 2020-04-13,2.259170573 302 | 2020-04-14,1.918533619 303 | 2020-04-15,1.934162628 304 | 2020-04-16,1.587055831 305 | 2020-04-17,1.187939219 306 | 2020-04-18,2.187929086 307 | 2020-04-19,2.04193367 308 | 2020-04-20,2.39560223 309 | 2020-04-21,1.794879234 310 | 2020-04-22,2.226726983 311 | 2020-04-23,2.236357606 312 | 2020-04-24,3.124120626 313 | 2020-04-25,2.586772497 314 | 2020-04-26,3.082909912 315 | 2020-04-27,2.539595509 316 | 2020-04-28,1.740131892 317 | 2020-04-29,2.56176217 318 | 2020-04-30,3.05815968 319 | 2020-05-01,1.44677887 320 | 2020-05-02,1.856651878 321 | 2020-05-03,2.850421464 322 | 2020-05-04,2.892069225 323 | 2020-05-05,2.416336652 324 | 2020-05-06,3.547262954 325 | 2020-05-07,2.312212598 326 | 2020-05-08,3.732562252 327 | 2020-05-09,1.654652529 328 | 2020-05-10,3.545660964 329 | 2020-05-11,3.541966013 330 | 2020-05-12,3.232969305 331 | 2020-05-13,2.586630655 332 | 2020-05-14,2.818198175 333 | 2020-05-15,2.613753132 334 | 2020-05-16,3.807724669 335 | 2020-05-17,2.781445033 336 | 2020-05-18,2.012445967 337 | 2020-05-19,3.019970255 338 | 2020-05-20,2.885688669 339 | 2020-05-21,3.427353909 340 | 2020-05-22,4.159284984 341 | 2020-05-23,2.970769044 342 | 2020-05-24,3.73197175 343 | 2020-05-25,4.235051071 344 | 2020-05-26,3.607554388 345 | 2020-05-27,3.870090474 346 | 2020-05-28,2.659401234 347 | 2020-05-29,3.610201375 348 | 2020-05-30,3.076365154 349 | 2020-05-31,3.045312503 350 | 2020-06-01,2.900314899 351 | 2020-06-02,3.407470573 352 | 2020-06-03,3.63636604 353 | 2020-06-04,3.345220264 354 | 2020-06-05,3.832698512 355 | 2020-06-06,3.599785806 356 | 2020-06-07,3.17548095 357 | 2020-06-08,3.222704271 358 | 2020-06-09,3.860058162 359 | 2020-06-10,3.788609819 360 | 2020-06-11,2.952579325 361 | 2020-06-12,3.506777178 362 | 2020-06-13,3.133079664 363 | 2020-06-14,3.27103309 364 | 2020-06-15,4.053889929 365 | 2020-06-16,4.501400511 366 | 2020-06-17,4.490640837 367 | 2020-06-18,3.516825189 368 | 2020-06-19,4.651700443 369 | 2020-06-20,4.539143828 370 | 2020-06-21,4.784312826 371 | 2020-06-22,4.389316685 372 | 2020-06-23,4.859901719 373 | 2020-06-24,4.243590019 374 | 2020-06-25,4.761778353 375 | 2020-06-26,4.581255301 376 | 2020-06-27,4.360445803 377 | 2020-06-28,3.999267436 378 | 2020-06-29,4.154754561 379 | 2020-06-30,3.516533114 380 | 2020-07-01,3.89631863 381 | 2020-07-02,3.746339437 382 | 2020-07-03,5.83764892 383 | 2020-07-04,4.334983165 384 | 2020-07-05,3.706011086 385 | 2020-07-06,4.198970973 386 | 2020-07-07,5.069199213 387 | 2020-07-08,4.00126979 388 | 2020-07-09,4.547408212 389 | 2020-07-10,4.873814106 390 | 2020-07-11,4.696290416 391 | 2020-07-12,4.780966416 392 | 2020-07-13,4.384094687 393 | 2020-07-14,3.761130261 394 | 2020-07-15,3.059364808 395 | 2020-07-16,4.772933549 396 | 2020-07-17,5.690760967 397 | 2020-07-18,5.302960916 398 | 2020-07-19,3.470865034 399 | 2020-07-20,3.688237263 400 | 2020-07-21,4.943493522 401 | 2020-07-22,5.776104673 402 | 2020-07-23,2.075441387 403 | 2020-07-24,1.670484188 404 | 2020-07-25,2.074447735 405 | 2020-07-26,2.473213638 406 | 2020-07-27,4.031387328 407 | 2020-07-28,2.289062795 408 | 2020-07-29,1.670126392 409 | 2020-07-30,2.985362727 410 | 2020-07-31,2.271537502 411 | 2020-08-01,2.843799991 412 | 2020-08-02,3.581019728 413 | 2020-08-03,2.122354462 414 | 2020-08-04,2.817453841 415 | 2020-08-05,1.665832613 416 | 2020-08-06,2.497585651 417 | 2020-08-07,2.801402116 418 | 2020-08-08,2.165759506 419 | 2020-08-09,2.064027654 420 | 2020-08-10,2.781172495 421 | 2020-08-11,2.177979578 422 | 2020-08-12,2.781900522 423 | 2020-08-13,4.102063042 424 | 2020-08-14,2.704453163 425 | 2020-08-15,2.466390116 426 | 2020-08-16,2.542689297 427 | 2020-08-17,2.077629917 428 | 2020-08-18,1.976888597 429 | 2020-08-19,2.480715646 430 | 2020-08-20,2.347345748 431 | 2020-08-21,3.591937999 432 | 2020-08-22,3.295269603 433 | 2020-08-23,2.341588036 434 | 2020-08-24,3.520869761 435 | 2020-08-25,3.564854826 436 | 2020-08-26,2.416808761 437 | 2020-08-27,3.06903222 438 | 2020-08-28,2.56892522 439 | 2020-08-29,3.519862917 440 | 2020-08-30,2.808312603 441 | 2020-08-31,2.023258111 442 | 2020-09-01,3.62792072 443 | 2020-09-02,3.915517796 444 | 2020-09-03,2.736583777 445 | 2020-09-04,3.64202516 446 | 2020-09-05,2.586320815 447 | 2020-09-06,3.813037028 448 | 2020-09-07,3.556514946 449 | 2020-09-08,3.191468341 450 | 2020-09-09,3.679735908 451 | 2020-09-10,2.829726321 452 | 2020-09-11,3.906455939 453 | 2020-09-12,4.02946795 454 | 2020-09-13,2.903715355 455 | 2020-09-14,2.591550326 456 | 2020-09-15,3.795521093 457 | 2020-09-16,2.495047694 458 | 2020-09-17,4.4479162 459 | 2020-09-18,3.772534691 460 | 2020-09-19,3.628908318 461 | 2020-09-20,3.589896966 462 | 2020-09-21,3.611078989 463 | 2020-09-22,4.472394285 464 | 2020-09-23,3.368614668 465 | 2020-09-24,3.445291197 466 | 2020-09-25,4.379712241 467 | 2020-09-26,3.294831586 468 | 2020-09-27,4.681911674 469 | 2020-09-28,5.047965221 470 | 2020-09-29,4.121837311 471 | 2020-09-30,4.476694066 472 | 2020-10-01,2.554181017 473 | 2020-10-02,4.724607644 474 | 2020-10-03,4.082104902 475 | 2020-10-04,4.893265807 476 | 2020-10-05,3.975580752 477 | 2020-10-06,4.277217149 478 | 2020-10-07,3.637819632 479 | 2020-10-08,3.895292414 480 | 2020-10-09,4.855510789 481 | 2020-10-10,3.972883594 482 | 2020-10-11,3.165016147 483 | 2020-10-12,4.523176879 484 | 2020-10-13,4.328615078 485 | 2020-10-14,4.011717221 486 | 2020-10-15,4.768252045 487 | 2020-10-16,4.550699407 488 | 2020-10-17,4.717375372 489 | 2020-10-18,4.856115817 490 | 2020-10-19,4.350782787 491 | 2020-10-20,4.852060084 492 | 2020-10-21,4.781567305 493 | 2020-10-22,4.380390341 494 | 2020-10-23,4.150194094 495 | 2020-10-24,4.257025783 496 | 2020-10-25,4.916073245 497 | 2020-10-26,3.528532423 498 | 2020-10-27,4.795479727 499 | 2020-10-28,4.924733739 500 | 2020-10-29,4.554412507 501 | 2020-10-30,4.355544783 502 | 2020-10-31,5.766273472 503 | 2020-11-01,4.818989731 504 | 2020-11-02,5.413999261 505 | 2020-11-03,5.087113018 506 | 2020-11-04,4.582891483 507 | 2020-11-05,4.52056838 508 | 2020-11-06,4.042931093 509 | 2020-11-07,5.612587449 510 | 2020-11-08,4.276061389 511 | 2020-11-09,5.444627522 512 | 2020-11-10,4.983855259 513 | 2020-11-11,4.235532341 514 | 2020-11-12,4.570616292 515 | 2020-11-13,4.143153321 516 | 2020-11-14,5.161603125 517 | 2020-11-15,4.963687405 518 | 2020-11-16,4.974486697 519 | 2020-11-17,5.157449417 520 | 2020-11-18,4.052777702 521 | 2020-11-19,5.710599278 522 | 2020-11-20,4.441379458 523 | 2020-11-21,4.692573553 524 | 2020-11-22,4.277031642 525 | 2020-11-23,4.59285023 526 | 2020-11-24,5.01335271 527 | 2020-11-25,4.067114789 528 | 2020-11-26,5.227181694 529 | 2020-11-27,4.200404243 530 | 2020-11-28,2.761388494 531 | 2020-11-29,4.004310776 532 | 2020-11-30,4.249414884 533 | 2020-12-01,4.759657 534 | 2020-12-02,3.224472541 535 | 2020-12-03,3.676841527 536 | 2020-12-04,4.044826716 537 | 2020-12-05,4.538708079 538 | 2020-12-06,4.150225081 539 | 2020-12-07,3.672394828 540 | 2020-12-08,4.803177883 541 | 2020-12-09,3.402165428 542 | 2020-12-10,4.705708538 543 | 2020-12-11,3.509338857 544 | 2020-12-12,3.151487323 545 | 2020-12-13,3.795294924 546 | 2020-12-14,2.200089052 547 | 2020-12-15,3.972262085 548 | 2020-12-16,3.098053528 549 | 2020-12-17,3.82638957 550 | 2020-12-18,3.916186294 551 | 2020-12-19,3.313576377 552 | 2020-12-20,2.816106987 553 | 2020-12-21,3.603973738 554 | 2020-12-22,4.632549174 555 | 2020-12-23,3.159910996 556 | 2020-12-24,3.602690105 557 | 2020-12-25,4.101040787 558 | 2020-12-26,2.667898761 559 | 2020-12-27,5.160745517 560 | 2020-12-28,3.615466048 561 | 2020-12-29,4.198759582 562 | 2020-12-30,3.256141411 563 | 2020-12-31,3.595848386 564 | 2021-01-01,3.045705171 565 | 2021-01-02,4.310387091 566 | 2021-01-03,2.660859029 567 | 2021-01-04,2.837188088 568 | 2021-01-05,3.314228687 569 | 2021-01-06,2.577290612 570 | 2021-01-07,2.210198818 571 | 2021-01-08,3.009639369 572 | 2021-01-09,2.899065565 573 | 2021-01-10,3.091847465 574 | 2021-01-11,3.057040351 575 | 2021-01-12,2.783993513 576 | 2021-01-13,2.354784056 577 | 2021-01-14,2.633919993 578 | 2021-01-15,2.713934847 579 | 2021-01-16,2.885266454 580 | 2021-01-17,3.060630026 581 | 2021-01-18,1.59264976 582 | 2021-01-19,2.515598955 583 | 2021-01-20,2.188804931 584 | 2021-01-21,1.784315988 585 | 2021-01-22,2.493292625 586 | 2021-01-23,2.430522314 587 | 2021-01-24,2.324673604 588 | 2021-01-25,2.050248672 589 | 2021-01-26,2.608100932 590 | 2021-01-27,2.797063396 591 | 2021-01-28,1.979873101 592 | 2021-01-29,2.155018422 593 | 2021-01-30,1.636949874 594 | 2021-01-31,2.197626403 595 | 2021-02-01,1.817823754 596 | 2021-02-02,1.997302604 597 | 2021-02-03,2.947265911 598 | 2021-02-04,2.644614442 599 | 2021-02-05,1.647710159 600 | 2021-02-06,1.391647681 601 | 2021-02-07,2.908012193 602 | --------------------------------------------------------------------------------