{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"\n#### V3 Edit - The errors I previously flagged have been mostly fixed. \n\n#### However i did spot one price spike outlier which may be another data provider error. I just want to raise it as if erroneous price spikes like these were to occur in the submission period it would undermine all models.\n","metadata":{}},{"cell_type":"code","source":"import pandas as pd","metadata":{"execution":{"iopub.status.busy":"2022-01-20T17:22:18.361201Z","iopub.execute_input":"2022-01-20T17:22:18.362201Z","iopub.status.idle":"2022-01-20T17:22:18.386252Z","shell.execute_reply.started":"2022-01-20T17:22:18.362078Z","shell.execute_reply":"2022-01-20T17:22:18.385577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#train = pd.read_csv('../input/g-research-crypto-forecasting/train.csv')\ns_train = pd.read_csv('../input/g-research-crypto-forecasting/supplemental_train.csv')","metadata":{"execution":{"iopub.status.busy":"2022-01-20T17:22:29.709350Z","iopub.execute_input":"2022-01-20T17:22:29.710342Z","iopub.status.idle":"2022-01-20T17:22:35.615704Z","shell.execute_reply.started":"2022-01-20T17:22:29.710263Z","shell.execute_reply":"2022-01-20T17:22:35.614962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"outliers = s_train.query('abs(Target) > 0.15')","metadata":{"execution":{"iopub.status.busy":"2022-01-20T17:22:35.617103Z","iopub.execute_input":"2022-01-20T17:22:35.617445Z","iopub.status.idle":"2022-01-20T17:22:35.653259Z","shell.execute_reply.started":"2022-01-20T17:22:35.617403Z","shell.execute_reply":"2022-01-20T17:22:35.652375Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"outliers.query('timestamp == 1635442560')","metadata":{"execution":{"iopub.status.busy":"2022-01-20T17:26:53.833195Z","iopub.execute_input":"2022-01-20T17:26:53.833485Z","iopub.status.idle":"2022-01-20T17:26:53.848090Z","shell.execute_reply.started":"2022-01-20T17:26:53.833455Z","shell.execute_reply":"2022-01-20T17:26:53.847390Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### TRX ~10% price spike  at 1635442560 /  Oct 28 2021 17:36:00 ","metadata":{}},{"cell_type":"code","source":"s_train.query('Asset_ID == 13 and timestamp > 1635439560 and timestamp < 1635444560').plot(x='timestamp', y='Close')\n","metadata":{"execution":{"iopub.status.busy":"2022-01-20T17:25:57.913008Z","iopub.execute_input":"2022-01-20T17:25:57.913602Z","iopub.status.idle":"2022-01-20T17:25:58.314261Z","shell.execute_reply.started":"2022-01-20T17:25:57.913553Z","shell.execute_reply":"2022-01-20T17:25:58.313608Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Random price & target spike in TRX  - due to beta component of the target the impact is visible in all asset Targets.","metadata":{}},{"cell_type":"code","source":"s_train.query('Asset_ID == 13 and timestamp > 1635440000 and timestamp < 1635443000').plot(x='timestamp', y='Close')\ns_train.query('Asset_ID == 13 and timestamp > 1635440000 and timestamp < 1635443000').plot(x='timestamp', y='Target')\n\ns_train.query('Asset_ID == 1 and timestamp > 1635440000 and timestamp < 1635443000').plot(x='timestamp', y='Close')\ns_train.query('Asset_ID == 1 and timestamp > 1635440000 and timestamp < 1635443000').plot(x='timestamp', y='Target')\n\ns_train.query('Asset_ID == 6 and timestamp > 1635440000 and timestamp < 1635443000').plot(x='timestamp', y='Close')\ns_train.query('Asset_ID == 6 and timestamp > 1635440000 and timestamp < 1635443000').plot(x='timestamp', y='Target')\n","metadata":{"execution":{"iopub.status.busy":"2022-01-20T17:29:54.546257Z","iopub.execute_input":"2022-01-20T17:29:54.547104Z","iopub.status.idle":"2022-01-20T17:29:55.983120Z","shell.execute_reply.started":"2022-01-20T17:29:54.547054Z","shell.execute_reply":"2022-01-20T17:29:55.982245Z"},"trusted":true},"execution_count":null,"outputs":[]}]}