{"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":"# G-Research Crypto with purifier & AutoViz\n\n\n### Contents\n* data-purifier\n* autoviz\n\n### Data Description\nThis dataset contains information on historic trades for several cryptoassets, such as Bitcoin and Ethereum. Your challenge is to predict their future returns.\n\nAs historic cryptocurrency prices are not confidential this will be a forecasting competition using the time series API. Furthermore the public leaderboard targets are publicly available and are provided as part of the competition dataset. Expect to see many people submitting perfect submissions for fun. Accordingly, THE PUBLIC LEADERBOARD FOR THIS COMPETITION IS NOT MEANINGFUL and is only provided as a convenience for anyone who wants to test their code. The final private leaderboard will be determined using real market data gathered after the submission period closes.\n\n### Files\n#### train.csv - The training set\n\n* timestamp - A timestamp for the minute covered by the row.\n* Asset_ID - An ID code for the cryptoasset.\n* Count - The number of trades that took place this minute.\n* Open - The USD price at the beginning of the minute.\n* High - The highest USD price during the minute.\n* Low - The lowest USD price during the minute.\n* Close - The USD price at the end of the minute.\n* Volume - The number of cryptoasset units traded during the minute.\n* VWAP - The volume weighted average price for the minute.\n* Target - 15 minute residualized returns. See the 'Prediction and Evaluation' section of this notebook for details of how the target is calculated.","metadata":{}},{"cell_type":"code","source":"pip install data-purifier==0.3.0","metadata":{"_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-11-03T10:07:51.315072Z","iopub.execute_input":"2021-11-03T10:07:51.315404Z","iopub.status.idle":"2021-11-03T10:08:09.326361Z","shell.execute_reply.started":"2021-11-03T10:07:51.315369Z","shell.execute_reply":"2021-11-03T10:08:09.325168Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport datapurifier as dp\nfrom datapurifier import Mleda","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:08:09.328328Z","iopub.execute_input":"2021-11-03T10:08:09.328593Z","iopub.status.idle":"2021-11-03T10:08:23.551229Z","shell.execute_reply.started":"2021-11-03T10:08:09.328561Z","shell.execute_reply":"2021-11-03T10:08:23.550258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = '../input/g-research-crypto-forecasting/train.csv'\nasset_details = '../input/g-research-crypto-forecasting/asset_details.csv'","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:09:28.368163Z","iopub.execute_input":"2021-11-03T10:09:28.368521Z","iopub.status.idle":"2021-11-03T10:09:28.373476Z","shell.execute_reply.started":"2021-11-03T10:09:28.368488Z","shell.execute_reply":"2021-11-03T10:09:28.372757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(train)\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:09:32.133243Z","iopub.execute_input":"2021-11-03T10:09:32.133892Z","iopub.status.idle":"2021-11-03T10:10:33.786864Z","shell.execute_reply.started":"2021-11-03T10:09:32.13382Z","shell.execute_reply":"2021-11-03T10:10:33.786066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:10:33.789061Z","iopub.execute_input":"2021-11-03T10:10:33.789645Z","iopub.status.idle":"2021-11-03T10:10:33.804899Z","shell.execute_reply.started":"2021-11-03T10:10:33.789593Z","shell.execute_reply":"2021-11-03T10:10:33.803819Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:10:33.806268Z","iopub.execute_input":"2021-11-03T10:10:33.806483Z","iopub.status.idle":"2021-11-03T10:10:34.300734Z","shell.execute_reply.started":"2021-11-03T10:10:33.806456Z","shell.execute_reply":"2021-11-03T10:10:34.299904Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.dropna(axis=0, inplace=True)","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:10:34.302406Z","iopub.execute_input":"2021-11-03T10:10:34.302622Z","iopub.status.idle":"2021-11-03T10:10:36.491196Z","shell.execute_reply.started":"2021-11-03T10:10:34.302596Z","shell.execute_reply":"2021-11-03T10:10:36.490181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.describe()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:10:53.032868Z","iopub.execute_input":"2021-11-03T10:10:53.033356Z","iopub.status.idle":"2021-11-03T10:11:01.46152Z","shell.execute_reply.started":"2021-11-03T10:10:53.033316Z","shell.execute_reply":"2021-11-03T10:11:01.460456Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1 = pd.read_csv(asset_details)\ndf1.head()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:08:23.559745Z","iopub.execute_input":"2021-11-03T10:08:23.559988Z","iopub.status.idle":"2021-11-03T10:08:23.605923Z","shell.execute_reply.started":"2021-11-03T10:08:23.55996Z","shell.execute_reply":"2021-11-03T10:08:23.605056Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:08:40.577562Z","iopub.execute_input":"2021-11-03T10:08:40.577945Z","iopub.status.idle":"2021-11-03T10:08:40.588781Z","shell.execute_reply.started":"2021-11-03T10:08:40.577898Z","shell.execute_reply":"2021-11-03T10:08:40.587994Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.info()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:10:44.741091Z","iopub.execute_input":"2021-11-03T10:10:44.741475Z","iopub.status.idle":"2021-11-03T10:10:44.758709Z","shell.execute_reply.started":"2021-11-03T10:10:44.741438Z","shell.execute_reply":"2021-11-03T10:10:44.757105Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1.describe().T","metadata":{"execution":{"iopub.status.busy":"2021-11-03T10:10:45.648239Z","iopub.execute_input":"2021-11-03T10:10:45.648603Z","iopub.status.idle":"2021-11-03T10:10:45.672666Z","shell.execute_reply.started":"2021-11-03T10:10:45.648565Z","shell.execute_reply":"2021-11-03T10:10:45.67162Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Data-Purifier\n* A Python library for Automated Exploratory Data Analysis, Automated Data Cleaning and Automated Data Preprocessing For Machine Learning and Natural Language Processing Applications in Python.\n\n<img src=\"https://github.com/Elysian01/Data-Purifier/raw/master/static/demo.gif\" width=\"800px\">","metadata":{}},{"cell_type":"code","source":"df = Mleda(df)\ndf","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:11:18.468098Z","iopub.execute_input":"2021-11-03T08:11:18.468349Z","iopub.status.idle":"2021-11-03T08:12:41.629816Z","shell.execute_reply.started":"2021-11-03T08:11:18.46832Z","shell.execute_reply":"2021-11-03T08:12:41.628973Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"asse = pd.read_csv(asset_details)\nasse.head()","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:12:41.632788Z","iopub.execute_input":"2021-11-03T08:12:41.633043Z","iopub.status.idle":"2021-11-03T08:12:41.649603Z","shell.execute_reply.started":"2021-11-03T08:12:41.633013Z","shell.execute_reply":"2021-11-03T08:12:41.648599Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"asse = Mleda(asse)\nasse","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:12:41.651072Z","iopub.execute_input":"2021-11-03T08:12:41.651487Z","iopub.status.idle":"2021-11-03T08:12:43.170194Z","shell.execute_reply.started":"2021-11-03T08:12:41.651456Z","shell.execute_reply":"2021-11-03T08:12:43.169605Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Autoviz: Automatically Visualize\n* Automatically Visualize any dataset, any size with a single line of code.\n\n\n\n<img src=\"https://i.redd.it/qovrrxfp0kj71.gif\" width=\"800px\">","metadata":{}},{"cell_type":"code","source":"pip install autoviz","metadata":{"_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-11-03T08:12:43.172842Z","iopub.execute_input":"2021-11-03T08:12:43.173212Z","iopub.status.idle":"2021-11-03T08:12:52.935228Z","shell.execute_reply.started":"2021-11-03T08:12:43.173164Z","shell.execute_reply":"2021-11-03T08:12:52.934166Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pip install xlrd","metadata":{"_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-11-03T08:12:52.936849Z","iopub.execute_input":"2021-11-03T08:12:52.937134Z","iopub.status.idle":"2021-11-03T08:13:02.000784Z","shell.execute_reply.started":"2021-11-03T08:12:52.937102Z","shell.execute_reply":"2021-11-03T08:13:01.999823Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from autoviz.AutoViz_Class import AutoViz_Class\nAV = AutoViz_Class()\ndf_Q = AV.AutoViz(train)","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:13:02.002069Z","iopub.execute_input":"2021-11-03T08:13:02.002328Z","iopub.status.idle":"2021-11-03T08:14:19.621838Z","shell.execute_reply.started":"2021-11-03T08:13:02.002297Z","shell.execute_reply":"2021-11-03T08:14:19.62105Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = AV.AutoViz(train, depVar='Open')","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:14:19.624825Z","iopub.execute_input":"2021-11-03T08:14:19.625064Z","iopub.status.idle":"2021-11-03T08:15:54.484713Z","shell.execute_reply.started":"2021-11-03T08:14:19.625035Z","shell.execute_reply":"2021-11-03T08:15:54.483912Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"AV = AutoViz_Class()\ndf_Q_asse = AV.AutoViz(asset_details)","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:15:54.485952Z","iopub.execute_input":"2021-11-03T08:15:54.48641Z","iopub.status.idle":"2021-11-03T08:15:56.32885Z","shell.execute_reply.started":"2021-11-03T08:15:54.486379Z","shell.execute_reply":"2021-11-03T08:15:56.327968Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = AV.AutoViz(asset_details, depVar='Weight')","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:17:31.657034Z","iopub.execute_input":"2021-11-03T08:17:31.657715Z","iopub.status.idle":"2021-11-03T08:17:34.434596Z","shell.execute_reply.started":"2021-11-03T08:17:31.657668Z","shell.execute_reply":"2021-11-03T08:17:34.433562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = AV.AutoViz(asset_details, depVar='Asset_Name')","metadata":{"execution":{"iopub.status.busy":"2021-11-03T08:17:39.732492Z","iopub.execute_input":"2021-11-03T08:17:39.7328Z","iopub.status.idle":"2021-11-03T08:17:43.210436Z","shell.execute_reply.started":"2021-11-03T08:17:39.732769Z","shell.execute_reply":"2021-11-03T08:17:43.209577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"![Upvote!](https://img.shields.io/badge/Upvote-If%20you%20like%20my%20work-07b3c8?style=for-the-badge&logo=kaggle)","metadata":{}}]}