{"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":"code","source":"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\ncrypto = pd.read_csv(\"../input/g-research-crypto-forecasting/supplemental_train.csv\")","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-11-24T10:06:54.258353Z","iopub.execute_input":"2021-11-24T10:06:54.259049Z","iopub.status.idle":"2021-11-24T10:06:56.787062Z","shell.execute_reply.started":"2021-11-24T10:06:54.259008Z","shell.execute_reply":"2021-11-24T10:06:56.786057Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"bitcoin=crypto[crypto['Asset_ID']==1].dropna()\nbtc_train=bitcoin[bitcoin['timestamp']<1630181440] \nbtc_test=bitcoin[bitcoin['timestamp']>1630181440] \ntraining_data = btc_train.drop(['timestamp','Asset_ID'], axis = 1)","metadata":{"execution":{"iopub.status.busy":"2021-11-24T10:06:56.789779Z","iopub.execute_input":"2021-11-24T10:06:56.790011Z","iopub.status.idle":"2021-11-24T10:06:56.836540Z","shell.execute_reply.started":"2021-11-24T10:06:56.789984Z","shell.execute_reply":"2021-11-24T10:06:56.835849Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.decomposition import PCA\nfrom sklearn import preprocessing\nfrom sklearn.preprocessing import MinMaxScaler\nimport seaborn as sns\n\neth_pca_dataset1 = bitcoin.dropna().drop(labels=['Target','timestamp','Asset_ID'], axis=1)\n#print(eth_pca_dataset1.size)\n\npca = PCA(n_components=2)\npca.fit(eth_pca_dataset1)\n\nX_r = pca.fit(eth_pca_dataset1).transform(eth_pca_dataset1)\nmin_max_scaler =preprocessing.MinMaxScaler()\n\ny = bitcoin.dropna()\n#print(y.tail(17))\ny = y['Target']\n\nprint(max(y))\nprint(min(y))\nprint(np.std(y))\ny = y.values.reshape(-1,1)\n\ny =min_max_scaler.fit_transform(y)\n\n\n\n#print(y.size)\n\n\n#print(pca.explained_variance_ratio_)\n\npca.get_covariance()\n\nprint(max(y))\n\ncmap = sns.cubehelix_palette(as_cmap = True)\nf,ax = plt.subplots()\npoints = ax.scatter(X_r[:,0],X_r[:,1],c=y[:,0],cmap=cmap)\nf.colorbar(points)\nplt.xlim(0, 30000)\nplt.ylim(0, 10000)\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2021-11-24T10:06:56.837613Z","iopub.execute_input":"2021-11-24T10:06:56.838121Z","iopub.status.idle":"2021-11-24T10:06:59.412823Z","shell.execute_reply.started":"2021-11-24T10:06:56.838081Z","shell.execute_reply":"2021-11-24T10:06:59.411893Z"},"trusted":true},"execution_count":null,"outputs":[]}]}