{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":96164,"databundleVersionId":12993472,"sourceType":"competition"}],"dockerImageVersionId":31089,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# 1. Import necessary libraries\nimport pandas as pd\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:32:45.464112Z","iopub.execute_input":"2025-07-15T01:32:45.464499Z","iopub.status.idle":"2025-07-15T01:32:46.567089Z","shell.execute_reply.started":"2025-07-15T01:32:45.464467Z","shell.execute_reply":"2025-07-15T01:32:46.566091Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 2. Load datasets using Parquet format\ntrain = pd.read_parquet('/kaggle/input/drw-crypto-market-prediction/train.parquet')\ntest = pd.read_parquet('/kaggle/input/drw-crypto-market-prediction/test.parquet')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:32:46.568970Z","iopub.execute_input":"2025-07-15T01:32:46.569481Z","iopub.status.idle":"2025-07-15T01:33:44.342679Z","shell.execute_reply.started":"2025-07-15T01:32:46.569423Z","shell.execute_reply":"2025-07-15T01:33:44.341600Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 3. Select anonymized feature columns (X_1 to X_780)\nfeature_cols = [col for col in train.columns if col.startswith('X')]\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:33:44.344048Z","iopub.execute_input":"2025-07-15T01:33:44.344374Z","iopub.status.idle":"2025-07-15T01:33:44.349414Z","shell.execute_reply.started":"2025-07-15T01:33:44.344343Z","shell.execute_reply":"2025-07-15T01:33:44.348631Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 4. Prepare training and testing datasets\nX_train = train[feature_cols]\ny_train = train['label']\nX_test = test[feature_cols]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:33:44.350121Z","iopub.execute_input":"2025-07-15T01:33:44.350331Z","iopub.status.idle":"2025-07-15T01:33:50.907430Z","shell.execute_reply.started":"2025-07-15T01:33:44.350312Z","shell.execute_reply":"2025-07-15T01:33:50.906474Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 5. Train Linear Regression model\nmodel = LinearRegression()\nmodel.fit(X_train, y_train)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:33:50.909825Z","iopub.execute_input":"2025-07-15T01:33:50.910122Z","iopub.status.idle":"2025-07-15T01:34:56.485944Z","shell.execute_reply.started":"2025-07-15T01:33:50.910100Z","shell.execute_reply":"2025-07-15T01:34:56.484985Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 6. Make predictions\npreds = model.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:34:56.486892Z","iopub.execute_input":"2025-07-15T01:34:56.487169Z","iopub.status.idle":"2025-07-15T01:34:57.066350Z","shell.execute_reply.started":"2025-07-15T01:34:56.487138Z","shell.execute_reply":"2025-07-15T01:34:57.065455Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 7. Prepare submission file\nsample_submission = pd.read_csv('/kaggle/input/drw-crypto-market-prediction/sample_submission.csv')\nsample_submission['predictions'] = preds\nsample_submission.to_csv('submission.csv', index=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-07-15T01:34:57.067239Z","iopub.execute_input":"2025-07-15T01:34:57.067555Z","iopub.status.idle":"2025-07-15T01:34:59.591465Z","shell.execute_reply.started":"2025-07-15T01:34:57.067525Z","shell.execute_reply":"2025-07-15T01:34:59.590648Z"}},"outputs":[],"execution_count":null}]}