{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":7391,"databundleVersionId":44328,"sourceType":"competition"}],"dockerImageVersionId":30822,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport seaborn as sns","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.105Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\n\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\nimport os\npaths = []\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n        paths.append(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.107Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!pip install py7zr","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.107Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import py7zr\nfor filenames in paths:\n    with py7zr.SevenZipFile(filenames, mode='r') as z_ref:\n        z_ref.extractall(path='/kaggle/working')","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.108Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Corporación Favorita Grocery Sales Forecasting\n\nPlease read data description: https://www.kaggle.com/c/favorita-grocery-sales-forecasting","metadata":{}},{"cell_type":"markdown","source":"## Splitting Data into Training and Test Sets\nThe data you are working with splited into **training** and **test** sets and stored in the following files:\n\n- **`/kaggle/working/train_data.csv`** – the training dataset used for model training.\n- **`/kaggle/working/test_data.csv`** – the test dataset used to evaluate the model's performance.","metadata":{}},{"cell_type":"code","source":"%%time\ndata = pd.read_csv(\"/kaggle/working/train.csv\")\ndata[\"date\"] =  pd.to_datetime(data[\"date\"])","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.108Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"monthly_counts_data = data['date'].dt.to_period('M').value_counts().sort_index()\n\nplt.figure(figsize=(12, 6))\nmonthly_counts_data.plot(kind='bar', color='skyblue')\nplt.title('Count of Data for Each Month for All data', fontsize=14)\nplt.xlabel('Month', fontsize=12)\nplt.ylabel('Count', fontsize=12)\nplt.xticks(rotation=45)\nplt.grid(axis='y', linestyle='--', alpha=0.7)\nplt.show()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.108Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"%%time\nTHRESHOLD_TRAIN_DATE = pd.to_datetime(\"2017-07-01\")\nTHRESHOLD_TEST_DATE = pd.to_datetime(\"2017-08-01\")\n\ndata[data[\"date\"] < THRESHOLD_TRAIN_DATE].to_csv(\"/kaggle/working/train_data.csv\")\ndata[(data[\"date\"] >= THRESHOLD_TRAIN_DATE)&(data[\"date\"] < THRESHOLD_TEST_DATE)].to_csv(\"/kaggle/working/test_data.csv\")\n\n%xdel data","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.109Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"%%time\ndf = pd.read_csv(\"/kaggle/working/train_data.csv\")\ntest_df = pd.read_csv(\"/kaggle/working/test_data.csv\")","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.109Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df[\"date\"] = pd.to_datetime(df[\"date\"])\ntest_df[\"date\"] = pd.to_datetime(test_df[\"date\"])","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.109Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"monthly_counts = df['date'].dt.to_period('M').value_counts().sort_index().reset_index()\nmonthly_counts_test = test_df['date'].dt.to_period('M').value_counts().sort_index().reset_index()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.109Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"monthly_counts['type'] = 'Train'\nmonthly_counts_test['type'] = 'Test'\ncombined = pd.concat([monthly_counts, monthly_counts_test])\n\nplt.figure(figsize=(12, 6))\nsns.barplot(data=combined, x='date', y='count', hue='type', palette=['blue', 'red'])\nplt.title('Count of Data for Each Month (Train vs Test)', fontsize=14)\nplt.xlabel('Month', fontsize=12)\nplt.ylabel('Count', fontsize=12)\nplt.xticks(rotation=45)\nplt.legend(title='Dataset')\nplt.grid(axis='y', linestyle='--', alpha=0.7)\nplt.show()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.109Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.head()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.110Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Additional Data\n\n\nTo make more effective use of the data, you also have access to several auxiliary datasets containing contextual information:\n\n#### 1. **`holidays_events.csv`**\n   - **Description**:\n     Contains information about holidays and events that may influence sales.\n   - **Useful Columns**:\n     - `date`: The date of the holiday or event.\n     - `type`: The type of event (national, regional, local).\n     - `locale`: The level of impact (national, regional, local).\n     - `description`: A description of the event.\n   - **How to Use**:\n     - Add a flag indicating whether a date is a holiday to the training and test sets.\n     - Categorize holidays by their `type` and consider their impact on sales.\n     - Use the `locale` column to analyze regional effects.","metadata":{"execution":{"iopub.status.busy":"2024-12-22T19:12:02.31896Z","iopub.execute_input":"2024-12-22T19:12:02.319553Z","iopub.status.idle":"2024-12-22T19:12:02.32548Z","shell.execute_reply.started":"2024-12-22T19:12:02.319516Z","shell.execute_reply":"2024-12-22T19:12:02.323891Z"}}},{"cell_type":"code","source":"holiday_events = pd.read_csv(\"/kaggle/working/holidays_events.csv\")\nprint(holiday_events.shape)\nholiday_events.head()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.110Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"1st part","metadata":{}},{"cell_type":"code","source":"# Ensure date columns are datetime\nholiday_events[\"date\"] = pd.to_datetime(holiday_events[\"date\"])\n\n# Create a flag for holidays in the training dataset\ndf[\"is_holiday\"] = df[\"date\"].isin(holiday_events[\"date\"]).astype(int)\n\n# Create a flag for holidays in the test dataset\ntest_df[\"is_holiday\"] = test_df[\"date\"].isin(holiday_events[\"date\"]).astype(int)\n\n# Display the updated training dataset\ndf[[\"date\", \"is_holiday\"]].head()\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.110Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"2nd part","metadata":{}},{"cell_type":"code","source":"# Create a dictionary to map dates to holiday types\nholiday_type_map = dict(zip(holiday_events['date'], holiday_events['type']))\n\n# Map the holiday type to the training and test datasets\ndf['type'] = df['date'].map(holiday_type_map).fillna('None')\ntest_df['type'] = test_df['date'].map(holiday_type_map).fillna('None')\n\n# Display a few rows to confirm\ndisplay(df[['date', 'type']].head())\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.110Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Group by holiday type to calculate average sales\nholiday_impact = df.groupby('type')['unit_sales'].mean().reset_index()\ndisplay(holiday_impact)\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.110Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"3rd part","metadata":{}},{"cell_type":"code","source":"# Create a dictionary to map dates to holiday locales\nholiday_locale_map = dict(zip(holiday_events['date'], holiday_events['locale']))\n\n# Map the holiday locale to the training and test datasets\ndf['locale'] = df['date'].map(holiday_locale_map).fillna('None')\ntest_df['locale'] = test_df['date'].map(holiday_locale_map).fillna('None')\n\n# Group by locale to calculate average sales\nlocale_impact = df.groupby('locale')['unit_sales'].mean().reset_index()\ndisplay(locale_impact)\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.112Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"#### 2. **`items.csv`**\n   - **Description**:\n     Contains information about the items being sold.\n   - **Useful Columns**:\n     - `item_nbr`: Unique identifier for each item.\n     - `family`: The category or family the item belongs to (e.g., \"Beverages\").\n     - `class`: A finer categorization of items.\n     - `perishable`: A binary indicator for whether the item is perishable (1 for perishable, 0 otherwise).\n   - **How to Use**:\n     - Use `family` and `class` to group items and analyze trends across categories.\n     - Include the `perishable` indicator to weight predictions for perishable items.","metadata":{}},{"cell_type":"code","source":"items = pd.read_csv(\"/kaggle/working/items.csv\")\nprint(items.shape)\nitems.head()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.112Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Load items.csv\nitems = pd.read_csv(\"/kaggle/working/items.csv\")\n\n# Create dictionaries for memory-efficient mapping\nfamily_map = dict(zip(items['item_nbr'], items['family']))\nclass_map = dict(zip(items['item_nbr'], items['class']))\nperishable_map = dict(zip(items['item_nbr'], items['perishable']))\n\n# Map family, class, and perishable to df and test_df\ndf['family'] = df['item_nbr'].map(family_map)\ndf['class'] = df['item_nbr'].map(class_map)\ndf['perishable'] = df['item_nbr'].map(perishable_map)\n\ntest_df['family'] = test_df['item_nbr'].map(family_map)\ntest_df['class'] = test_df['item_nbr'].map(class_map)\ntest_df['perishable'] = test_df['item_nbr'].map(perishable_map)\n\n# Display a few rows to confirm\ndf[['item_nbr', 'family', 'class', 'perishable']].head()\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.112Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Group by family and calculate average sales\nfamily_trends = df.groupby('family')['unit_sales'].mean().reset_index()\n\n# Group by class and calculate average sales\nclass_trends = df.groupby('class')['unit_sales'].mean().reset_index()\n\n# Display the top 5 families and classes with the highest sales\ndisplay(family_trends.sort_values(by='unit_sales', ascending=False).head())\ndisplay(class_trends.sort_values(by='unit_sales', ascending=False).head())\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.112Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"#### 3. **`oil.csv`**\n   - **Description**:\n     Contains daily oil price data, which can serve as an external economic indicator.\n   - **Useful Columns**:\n     - `date`: The date corresponding to the oil price.\n     - `dcoilwtico`: The daily oil price.\n   - **How to Use**:\n     - Join this dataset with the training and test sets on the `date` column to include oil price as a feature.\n     - Analyze the correlation between oil price fluctuations and sales trends.","metadata":{}},{"cell_type":"code","source":"oil = pd.read_csv(\"/kaggle/working/oil.csv\")\nprint(oil.shape)\noil.head()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.113Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Create a dictionary for oil prices\noil['date'] = pd.to_datetime(oil['date'])\noil_price_map = dict(zip(oil['date'], oil['dcoilwtico']))\n\n# Map oil prices to the training and test datasets\ndf['oil_price'] = df['date'].map(oil_price_map)\ntest_df['oil_price'] = test_df['date'].map(oil_price_map)\n\n# Display a few rows to confirm\nprint(df[['date', 'oil_price']].head())\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.113Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Drop rows where oil_price is NaN for correlation analysis\noil_sales_correlation = df[['oil_price', 'unit_sales']].dropna().corr()\n\n# Display correlation results\nprint(\"Correlation between oil price and unit sales:\")\nprint(oil_sales_correlation)\n\n# Visualize the trend of oil price vs. sales (optional if memory allows)\nimport matplotlib.pyplot as plt\n\nplt.figure(figsize=(12, 6))\nplt.scatter(df['oil_price'], df['unit_sales'], alpha=0.5)\nplt.title('Oil Price vs Unit Sales')\nplt.xlabel('Oil Price')\nplt.ylabel('Unit Sales')\nplt.grid()\nplt.show()\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.113Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"#### 4. **`stores.csv`**\n   - **Description**:\n     Contains information about the stores where items are sold.\n   - **Useful Columns**:\n     - `store_nbr`: Unique identifier for each store.\n     - `city`: The city where the store is located.\n     - `state`: The state where the store is located.\n     - `type`: The store type.\n     - `cluster`: A grouping of similar stores based on sales patterns.\n   - **How to Use**:\n     - Use `city` and `state` for regional analysis of sales trends.\n     - Incorporate `type` and `cluster` to identify patterns and group stores with similar behavior.\n","metadata":{}},{"cell_type":"code","source":"stores = pd.read_csv(\"/kaggle/working/stores.csv\")\nprint(stores.shape)\nstores.head()","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.113Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import pandas as pd\n\n# Load the stores data and create mappings\nstores = pd.read_csv(\"/kaggle/working/stores.csv\")\ncity_map = dict(zip(stores['store_nbr'], stores['city']))\nstate_map = dict(zip(stores['store_nbr'], stores['state']))\ntype_map = dict(zip(stores['store_nbr'], stores['type']))\ncluster_map = dict(zip(stores['store_nbr'], stores['cluster']))\n\n# Define a function to map attributes in chunks\ndef process_chunk(input_path, output_path, city_map, state_map, type_map, cluster_map):\n    chunk_size = 50000  # Smaller chunks to save memory\n    with pd.read_csv(input_path, chunksize=chunk_size) as reader:\n        for i, chunk in enumerate(reader):\n            # Map store attributes to the chunk\n            chunk['city'] = chunk['store_nbr'].map(city_map)\n            chunk['state'] = chunk['store_nbr'].map(state_map)\n            chunk['store_type'] = chunk['store_nbr'].map(type_map)\n            chunk['cluster'] = chunk['store_nbr'].map(cluster_map)\n            \n            # Append or create a new file\n            if i == 0:\n                chunk.to_csv(output_path, index=False)\n            else:\n                chunk.to_csv(output_path, mode='a', header=False, index=False)\n\n# Process the training data\nprocess_chunk(\"/kaggle/working/train_data.csv\", \"/kaggle/working/updated_train_data.csv\", \n              city_map, state_map, type_map, cluster_map)\n\n# Process the test data\nprocess_chunk(\"/kaggle/working/test_data.csv\", \"/kaggle/working/updated_test_data.csv\", \n              city_map, state_map, type_map, cluster_map)\n","metadata":{"trusted":true,"execution":{"execution_failed":"2025-01-05T16:42:07.113Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import pandas as pd\n\n# Define a function to process chunks and calculate regional sales\ndef calculate_regional_sales(input_path, output_path):\n    chunk_size = 50000  # Process small chunks to save memory\n    regional_data = {}  # Dictionary to hold aggregated sales by city and state\n    \n    # Read data in chunks\n    with pd.read_csv(input_path, chunksize=chunk_size) as reader:\n        for chunk in reader:\n            # Group by city and state to calculate sales for the chunk\n            grouped = chunk.groupby(['city', 'state'])['unit_sales'].sum()\n            \n            # Aggregate the results into the dictionary\n            for (city, state), sales in grouped.items():\n                if (city, state) not in regional_data:\n                    regional_data[(city, state)] = 0\n                regional_data[(city, state)] += sales\n    \n    # Convert the aggregated results to a DataFrame\n    regional_df = pd.DataFrame.from_dict(regional_data, orient='index', columns=['total_sales'])\n    regional_df.reset_index(inplace=True)\n    regional_df.rename(columns={'level_0': 'city', 'level_1': 'state'}, inplace=True)\n    \n    # Save the results to disk\n    regional_df.to_csv(output_path, index=False)\n\n# Process training data for regional sales\ncalculate_regional_sales(\"/kaggle/working/updated_train_data.csv\", \"/kaggle/working/regional_sales.csv\")\n\n# Load and display the results to confirm\nregional_sales = pd.read_csv(\"/kaggle/working/regional_sales.csv\")\nprint(regional_sales.head())\n","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Define a function to process chunks and calculate sales by store type\ndef calculate_store_type_sales(input_path, output_path):\n    chunk_size = 50000  # Process small chunks to save memory\n    store_type_data = {}  # Dictionary to hold aggregated sales by store type\n    \n    # Read data in chunks\n    with pd.read_csv(input_path, chunksize=chunk_size) as reader:\n        for chunk in reader:\n            # Group by store_type to calculate sales for the chunk\n            grouped = chunk.groupby('store_type')['unit_sales'].sum()\n            \n            # Aggregate the results into the dictionary\n            for store_type, sales in grouped.items():\n                if store_type not in store_type_data:\n                    store_type_data[store_type] = 0\n                store_type_data[store_type] += sales\n    \n    # Convert the aggregated results to a DataFrame\n    store_type_df = pd.DataFrame.from_dict(store_type_data, orient='index', columns=['total_sales'])\n    store_type_df.reset_index(inplace=True)\n    store_type_df.rename(columns={'index': 'store_type'}, inplace=True)\n    \n    # Save the results to disk\n    store_type_df.to_csv(output_path, index=False)\n\n# Process training data for store type sales\ncalculate_store_type_sales(\"/kaggle/working/updated_train_data.csv\", \"/kaggle/working/store_type_sales.csv\")\n\n# Load and display the results to confirm\nstore_type_sales = pd.read_csv(\"/kaggle/working/store_type_sales.csv\")\nprint(store_type_sales.head())\n","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Define a function to process chunks and calculate sales by cluster\ndef calculate_cluster_sales(input_path, output_path):\n    chunk_size = 50000  # Process small chunks to save memory\n    cluster_data = {}  # Dictionary to hold aggregated sales by cluster\n    \n    # Read data in chunks\n    with pd.read_csv(input_path, chunksize=chunk_size) as reader:\n        for chunk in reader:\n            # Group by cluster to calculate sales for the chunk\n            grouped = chunk.groupby('cluster')['unit_sales'].sum()\n            \n            # Aggregate the results into the dictionary\n            for cluster, sales in grouped.items():\n                if cluster not in cluster_data:\n                    cluster_data[cluster] = 0\n                cluster_data[cluster] += sales\n    \n    # Convert the aggregated results to a DataFrame\n    cluster_df = pd.DataFrame.from_dict(cluster_data, orient='index', columns=['total_sales'])\n    cluster_df.reset_index(inplace=True)\n    cluster_df.rename(columns={'index': 'cluster'}, inplace=True)\n    \n    # Save the results to disk\n    cluster_df.to_csv(output_path, index=False)\n\n# Process training data for cluster sales\ncalculate_cluster_sales(\"/kaggle/working/updated_train_data.csv\", \"/kaggle/working/cluster_sales.csv\")\n\n# Load and display the results to confirm\ncluster_sales = pd.read_csv(\"/kaggle/working/cluster_sales.csv\")\nprint(cluster_sales.head())\n","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"**[READ DATA DESCRIPTION CAREFULY](https://www.kaggle.com/competitions/favorita-grocery-sales-forecasting) !!!!** \n\n## Exploratory Data Analysis and Model Training\n\n### 1. Baseline Model\n- Consider which model would be suitable as `DummyModel` for this task, then create, train, and use its predictions as a baseline.\n\n### 2. Feature Engineering\n- Generate new features by incorporating data from additional datasets to enhance the model's predictive capabilities.\n\n### 3. Model Training and Optimization\n- Utilize advanced regression models, such as **LGBM Regression** or **CatBoost Regression**, to achieve the best results. Focus on hyperparameter tuning and evaluation metrics to optimize performance. **Use foremention Normalized Weighted Root Mean Squared Logarithmic Error**.  \n\n### Thats All :-)\n","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error\n\n# Load training and test datasets\ntrain_data = pd.read_csv(\"/kaggle/working/updated_train_data.csv\", usecols=['unit_sales'])\ntest_data = pd.read_csv(\"/kaggle/working/updated_test_data.csv\", usecols=['unit_sales'])\n\n# Calculate the mean of unit_sales from the training set\nmean_sales = train_data['unit_sales'].mean()\n\n# Predict the mean for all test data\ntest_data['baseline_prediction'] = mean_sales\n\n# Evaluate the baseline model\nmae = mean_absolute_error(test_data['unit_sales'], test_data['baseline_prediction'])\nmse = mean_squared_error(test_data['unit_sales'], test_data['baseline_prediction'])\n\nprint(f\"Baseline Model Performance:\")\nprint(f\"Mean Absolute Error (MAE): {mae}\")\nprint(f\"Mean Squared Error (MSE): {mse}\")\n\n# Display the first few predictions\nprint(test_data[['unit_sales', 'baseline_prediction']].head())\n","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}