{"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":112509,"databundleVersionId":14254895,"sourceType":"competition"}],"dockerImageVersionId":31192,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"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\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\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 numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nfrom tqdm.auto import tqdm\n\nimport torch\nimport warnings\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(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":{"iopub.status.busy":"2025-11-11T04:59:20.758004Z","iopub.execute_input":"2025-11-11T04:59:20.758305Z","iopub.status.idle":"2025-11-11T04:59:23.466158Z","shell.execute_reply.started":"2025-11-11T04:59:20.758280Z","shell.execute_reply":"2025-11-11T04:59:23.465144Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"path_data = '/kaggle/input/csiro-biomass'\npath_train_csv = os.path.join(path_data,'train.csv')\npath_train_img = os.path.join(path_data,'train')\npath_test_img = os.path.join(path_data,'test')\n\ndf = pd.read_csv(path_train_csv)\nprint(f\"dataset size: {df.shape}\")\ndisplay(df.head())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-11T04:59:29.661924Z","iopub.execute_input":"2025-11-11T04:59:29.662407Z","iopub.status.idle":"2025-11-11T04:59:29.692184Z","shell.execute_reply.started":"2025-11-11T04:59:29.662375Z","shell.execute_reply":"2025-11-11T04:59:29.691358Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Exploring Data\n","metadata":{}},{"cell_type":"code","source":"target_cols = [col for col in df.columns if col not in ['image_id', 'Image' ] ]\nprint(f\"target columns: {target_cols}\")\nprint(f\"number of targets: {len(target_cols)}\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-11T04:59:32.694824Z","iopub.execute_input":"2025-11-11T04:59:32.695123Z","iopub.status.idle":"2025-11-11T04:59:32.700610Z","shell.execute_reply.started":"2025-11-11T04:59:32.695103Z","shell.execute_reply":"2025-11-11T04:59:32.699562Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Plotting the Target Distribution","metadata":{}},{"cell_type":"code","source":"cols_plot = [col for col in target_cols if col not in ['sample_id','image_path','State','target_name']]\n\nfor col in cols_plot:\n    plt.figure(figsize=(8,3))\n    plt.hist(df[col].dropna(), bins=45, edgecolor='yellow', alpha=0.7)\n    plt.xlabel(col, fontsize=11)\n    plt.ylabel('Count',fontsize=11)\n    plt.title(f'{col} Distribution', fontsize=14,fontweight='bold')\n    plt.grid(alpha=0.3)\n    plt.xticks(rotation=45, ha='right')\n    plt.tight_layout()\n    plt.show()\n    ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-11T04:59:35.000400Z","iopub.execute_input":"2025-11-11T04:59:35.000909Z","iopub.status.idle":"2025-11-11T04:59:36.397139Z","shell.execute_reply.started":"2025-11-11T04:59:35.000865Z","shell.execute_reply":"2025-11-11T04:59:36.396086Z"}},"outputs":[],"execution_count":null}]}