{"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,"isSourceIdPinned":false,"sourceType":"competition"}],"dockerImageVersionId":31153,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import os\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.preprocessing import PowerTransformer\nfrom scipy.stats import boxcox\nfrom collections import defaultdict\nfrom PIL import Image\nfrom tqdm import tqdm\nimport cv2\nimport glob\nfrom glob import glob","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:23:10.608611Z","iopub.execute_input":"2025-10-29T05:23:10.609257Z","iopub.status.idle":"2025-10-29T05:23:10.949004Z","shell.execute_reply.started":"2025-10-29T05:23:10.609228Z","shell.execute_reply":"2025-10-29T05:23:10.947999Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import warnings\nwarnings.filterwarnings(\"ignore\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:17.992385Z","iopub.execute_input":"2025-10-29T05:18:17.992899Z","iopub.status.idle":"2025-10-29T05:18:17.997714Z","shell.execute_reply.started":"2025-10-29T05:18:17.992864Z","shell.execute_reply":"2025-10-29T05:18:17.996794Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pd.set_option('display.max_columns', None) \npd.set_option('display.width', None)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:17.998645Z","iopub.execute_input":"2025-10-29T05:18:17.999010Z","iopub.status.idle":"2025-10-29T05:18:18.016487Z","shell.execute_reply.started":"2025-10-29T05:18:17.998981Z","shell.execute_reply":"2025-10-29T05:18:18.015512Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"TRAIN_IMAGE_FOLDER = \"/kaggle/input/csiro-biomass/train\"\nTEST_IMAGE_FOLDER = \"/kaggle/input/csiro-biomass/test\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.018793Z","iopub.execute_input":"2025-10-29T05:18:18.019036Z","iopub.status.idle":"2025-10-29T05:18:18.032741Z","shell.execute_reply.started":"2025-10-29T05:18:18.019015Z","shell.execute_reply":"2025-10-29T05:18:18.031819Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_csv = pd.read_csv(\"/kaggle/input/csiro-biomass/train.csv\")\ntest_csv = pd.read_csv(\"/kaggle/input/csiro-biomass/test.csv\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.033664Z","iopub.execute_input":"2025-10-29T05:18:18.033969Z","iopub.status.idle":"2025-10-29T05:18:18.078616Z","shell.execute_reply.started":"2025-10-29T05:18:18.033944Z","shell.execute_reply":"2025-10-29T05:18:18.077663Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"train_csv_shape: \", train_csv.shape)\nprint(\"test_csv_shape: \", test_csv.shape)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.079867Z","iopub.execute_input":"2025-10-29T05:18:18.080145Z","iopub.status.idle":"2025-10-29T05:18:18.084942Z","shell.execute_reply.started":"2025-10-29T05:18:18.080117Z","shell.execute_reply":"2025-10-29T05:18:18.083905Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_csv.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.086089Z","iopub.execute_input":"2025-10-29T05:18:18.086423Z","iopub.status.idle":"2025-10-29T05:18:18.126146Z","shell.execute_reply.started":"2025-10-29T05:18:18.086400Z","shell.execute_reply":"2025-10-29T05:18:18.125232Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_csv.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.126994Z","iopub.execute_input":"2025-10-29T05:18:18.127293Z","iopub.status.idle":"2025-10-29T05:18:18.136263Z","shell.execute_reply.started":"2025-10-29T05:18:18.127266Z","shell.execute_reply":"2025-10-29T05:18:18.135313Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Convert Sampling_Date to datetime\ntrain_csv[\"Sampling_Date\"] = pd.to_datetime(train_csv[\"Sampling_Date\"], errors=\"coerce\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.137660Z","iopub.execute_input":"2025-10-29T05:18:18.137968Z","iopub.status.idle":"2025-10-29T05:18:18.162044Z","shell.execute_reply.started":"2025-10-29T05:18:18.137942Z","shell.execute_reply":"2025-10-29T05:18:18.161121Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def summarize_dataframe(df):\n    summary = []\n\n    for col in df.columns:\n        data = df[col]\n        dtype = data.dtype\n\n        # Missing values\n        missing = data.isna().sum()\n        missing_pct = (missing / len(df)) * 100\n\n        # Unique values\n        unique_vals = data.nunique()\n\n        # Initialize stats\n        mean = median = mode = std = np.nan\n\n        # Compute only for numeric columns\n        if np.issubdtype(dtype, np.number):\n            mean = data.mean()\n            median = data.median()\n            mode = data.mode().iloc[0] if not data.mode().empty else np.nan\n            std = data.std()\n\n        summary.append({\n            \"Column\": col,\n            \"Dtype\": dtype,\n            \"Missing\": missing,\n            \"Missing_%\": round(missing_pct, 2),\n            \"Mean\": round(mean, 3) if pd.notna(mean) else \"-\",\n            \"Median\": round(median, 3) if pd.notna(median) else \"-\",\n            \"Mode\": round(mode, 3) if pd.notna(mode) else \"-\",\n            \"Std\": round(std, 3) if pd.notna(std) else \"-\",\n            \"Unique\": unique_vals\n        })\n\n    return pd.DataFrame(summary)\n\n# 🧠 Usage:\nsummary_df = summarize_dataframe(train_csv)\nsummary_df.head(20)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.165178Z","iopub.execute_input":"2025-10-29T05:18:18.165449Z","iopub.status.idle":"2025-10-29T05:18:18.198673Z","shell.execute_reply.started":"2025-10-29T05:18:18.165428Z","shell.execute_reply":"2025-10-29T05:18:18.197776Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# State distribution\ntrain_csv[\"State\"].value_counts().plot.pie(autopct='%1.1f%%', figsize=(5,5), title=\"State Distribution\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.199529Z","iopub.execute_input":"2025-10-29T05:18:18.199891Z","iopub.status.idle":"2025-10-29T05:18:18.486573Z","shell.execute_reply.started":"2025-10-29T05:18:18.199865Z","shell.execute_reply":"2025-10-29T05:18:18.485499Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Target name distribution\ntrain_csv[\"target_name\"].value_counts().plot.pie(autopct='%1.1f%%', figsize=(6,6), title=\"Target Name Distribution\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.487517Z","iopub.execute_input":"2025-10-29T05:18:18.487855Z","iopub.status.idle":"2025-10-29T05:18:18.611314Z","shell.execute_reply.started":"2025-10-29T05:18:18.487828Z","shell.execute_reply":"2025-10-29T05:18:18.610441Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"species_counts = train_csv[\"Species\"].value_counts()\n\n# -----------------------------\n# 1️⃣ Bar plot (frequency)\n# -----------------------------\nplt.figure(figsize=(8,5))\nspecies_counts.plot(kind=\"bar\", color=\"skyblue\", edgecolor=\"black\")\nplt.title(\"Species Frequency\")\nplt.xlabel(\"Species\")\nplt.ylabel(\"Count\")\nplt.xticks(rotation=45)\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.612253Z","iopub.execute_input":"2025-10-29T05:18:18.612840Z","iopub.status.idle":"2025-10-29T05:18:18.886261Z","shell.execute_reply.started":"2025-10-29T05:18:18.612811Z","shell.execute_reply":"2025-10-29T05:18:18.885338Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"\n# Sampling date histogram\nplt.figure(figsize=(10,5))\nsns.histplot(train_csv[\"Sampling_Date\"], bins=30)\nplt.title(\"Sampling Date Distribution\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:18.886972Z","iopub.execute_input":"2025-10-29T05:18:18.887252Z","iopub.status.idle":"2025-10-29T05:18:19.210103Z","shell.execute_reply.started":"2025-10-29T05:18:18.887226Z","shell.execute_reply":"2025-10-29T05:18:19.209164Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Pre_GSHH_NDVI histogram\nplt.figure(figsize=(10,5))\nsns.histplot(train_csv[\"Pre_GSHH_NDVI\"], bins=30, color=\"skyblue\")\nplt.title(\"Pre_GSHH_NDVI Distribution\")\nplt.show()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:19.210981Z","iopub.execute_input":"2025-10-29T05:18:19.211294Z","iopub.status.idle":"2025-10-29T05:18:19.444533Z","shell.execute_reply.started":"2025-10-29T05:18:19.211266Z","shell.execute_reply":"2025-10-29T05:18:19.443470Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Height_Ave_cm histogram\nplt.figure(figsize=(10,5))\nsns.histplot(train_csv[\"Height_Ave_cm\"], bins=20, color=\"orange\")\nplt.title(\"Height_Ave_cm Distribution\")\nplt.show()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:19.445477Z","iopub.execute_input":"2025-10-29T05:18:19.445944Z","iopub.status.idle":"2025-10-29T05:18:19.665377Z","shell.execute_reply.started":"2025-10-29T05:18:19.445917Z","shell.execute_reply":"2025-10-29T05:18:19.664415Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# 1️⃣ Distribution of target for each target_name\n# ----------------------------\nplt.figure(figsize=(10,6))\nsns.boxplot(x=\"target_name\", y=\"target\", data=train_csv)\nplt.title(\"Distribution of Target by Target Name\")\nplt.xticks(rotation=45)\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:19.666152Z","iopub.execute_input":"2025-10-29T05:18:19.666551Z","iopub.status.idle":"2025-10-29T05:18:19.908988Z","shell.execute_reply.started":"2025-10-29T05:18:19.666532Z","shell.execute_reply":"2025-10-29T05:18:19.908102Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"target_names = train_csv[\"target_name\"].unique()\n\n# Set up subplots — one per target_name\nplt.figure(figsize=(12, 8))\n\nfor i, name in enumerate(target_names, 1):\n    plt.subplot(2, (len(target_names) + 1)//2, i)  # Auto layout\n    sns.histplot(train_csv[train_csv[\"target_name\"] == name][\"target\"], bins=15, kde=True)\n    plt.title(f\"{name} - Target Distribution\")\n    plt.xlabel(\"Target\")\n    plt.ylabel(\"Frequency\")\n\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:19.910155Z","iopub.execute_input":"2025-10-29T05:18:19.910487Z","iopub.status.idle":"2025-10-29T05:18:21.021700Z","shell.execute_reply.started":"2025-10-29T05:18:19.910457Z","shell.execute_reply":"2025-10-29T05:18:21.020796Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from sklearn.preprocessing import PowerTransformer\nfrom scipy.stats import boxcox, skew, kurtosis\n\n# Setup\npt = PowerTransformer(method='yeo-johnson')\nepsilon = 1e-9\ntarget_names = train_csv[\"target_name\"].unique()\n\nfor name in target_names:\n    subset = train_csv.loc[train_csv[\"target_name\"] == name, \"target\"].dropna()\n\n    # Prepare figure\n    fig, axes = plt.subplots(3, 2, figsize=(11, 10))\n    fig.suptitle(f\"{name} - Transformations (with Normality Stats)\", fontsize=14, y=1.02)\n\n    transforms = {\n        \"Log Transform\": np.log1p(subset),\n        \"Sqrt Transform\": np.sqrt(subset),\n        \"Cube Root Transform\": np.cbrt(subset),\n        \"Yeo–Johnson Transform\": pt.fit_transform(subset.values.reshape(-1, 1)).flatten(),\n    }\n\n    # Add Box–Cox safely\n    if (subset + epsilon > 0).all():\n        bc, lam = boxcox(subset + epsilon)\n        transforms[f\"Box–Cox Transform (λ={lam:.2f})\"] = bc\n\n    # Plot each transform\n    for i, (title, data) in enumerate(transforms.items()):\n        ax = axes.flat[i]\n        sns.histplot(data, bins=20, kde=True, ax=ax, color=\"skyblue\", edgecolor=\"black\")\n        ax.set_title(title)\n\n        # Calculate skewness & kurtosis\n        sk = skew(data)\n        ku = kurtosis(data)\n        ax.text(0.02, 0.95, f\"Skew: {sk:.2f}\\nKurt: {ku:.2f}\",\n                transform=ax.transAxes, fontsize=10,\n                verticalalignment='top',\n                bbox=dict(facecolor='white', alpha=0.7, edgecolor='gray'))\n\n    # Hide any extra subplot\n    for j in range(i + 1, len(axes.flat)):\n        axes.flat[j].set_visible(False)\n\n    plt.tight_layout()\n    plt.show()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:21.022857Z","iopub.execute_input":"2025-10-29T05:18:21.023774Z","iopub.status.idle":"2025-10-29T05:18:27.130242Z","shell.execute_reply.started":"2025-10-29T05:18:21.023717Z","shell.execute_reply":"2025-10-29T05:18:27.129259Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pt = PowerTransformer(method='yeo-johnson')\nepsilon = 1e-9\n\n# Extract the full target column\ntarget = train_csv[\"target\"].dropna()\n\n# Store all transformations\ntransforms = {\n    \"Original\": target,\n    \"Log Transform\": np.log1p(target),\n    \"Sqrt Transform\": np.sqrt(target),\n    \"Cube Root Transform\": np.cbrt(target),\n    \"Yeo–Johnson Transform\": pt.fit_transform(target.values.reshape(-1, 1)).flatten()\n}\n\n# Box–Cox (only if all values > 0)\nif (target + epsilon > 0).all():\n    bc, lam = boxcox(target + epsilon)\n    transforms[f\"Box–Cox Transform (λ={lam:.2f})\"] = bc\n\n# Plot all transforms with KDE + Normality stats\nfig, axes = plt.subplots(3, 2, figsize=(12, 10))\nfig.suptitle(\"Overall Target - Transformations with Normality Metrics\", fontsize=15, y=1.02)\n\nfor i, (title, data) in enumerate(transforms.items()):\n    ax = axes.flat[i]\n    sns.histplot(data, bins=25, kde=True, ax=ax, color=\"skyblue\", edgecolor=\"black\")\n    ax.set_title(title)\n\n    # Compute normality statistics\n    sk = skew(data)\n    ku = kurtosis(data)\n    ax.text(0.02, 0.95, f\"Skew: {sk:.2f}\\nKurt: {ku:.2f}\",\n            transform=ax.transAxes, fontsize=10,\n            verticalalignment='top',\n            bbox=dict(facecolor='white', alpha=0.7, edgecolor='gray'))\n\n# Hide any extra subplot\nfor j in range(i + 1, len(axes.flat)):\n    axes.flat[j].set_visible(False)\n\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:27.131280Z","iopub.execute_input":"2025-10-29T05:18:27.131644Z","iopub.status.idle":"2025-10-29T05:18:28.567029Z","shell.execute_reply.started":"2025-10-29T05:18:27.131610Z","shell.execute_reply":"2025-10-29T05:18:28.566020Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# NOTE - \n# For Dry_Clover_g - we can do cuberoot\n# For Dry_Dead_g - sqrt transform\n# For Dry_Green_g - sqrt transform\n# For Dry_Total_g - yeo johnson transform\n# For GDM_g - box cox transform with lamda = 0.25\n# For overall - sqrt transform","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:28.568035Z","iopub.execute_input":"2025-10-29T05:18:28.568282Z","iopub.status.idle":"2025-10-29T05:18:28.572003Z","shell.execute_reply.started":"2025-10-29T05:18:28.568264Z","shell.execute_reply":"2025-10-29T05:18:28.571295Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def get_unique_sizes(directory):\n    size_counts = defaultdict(int)\n    for root, _, files in os.walk(directory):\n        for file in files:\n            if file.lower().endswith(('.png', '.jpg', '.jpeg', 'JPG')):\n                try:\n                    with Image.open(os.path.join(root, file)) as img:\n                        size = img.size  # (width, height)\n                        channels = len(img.getbands())  # count color channels\n                        key = (size[0], size[1], channels)\n                        size_counts[key] += 1\n                except Exception as e:\n                    print(f\"Error {file}: {e}\")\n    return size_counts\n\n# List of folders to check\nfolders = [\n    TRAIN_IMAGE_FOLDER,\n    TEST_IMAGE_FOLDER\n]\n\n# Display results\nfor folder in folders:\n    print(f\"\\n📂 Folder: {folder}\")\n    sizes = get_unique_sizes(folder)\n\n    if not sizes:\n        print(\"⚠️ No images found or mistake in path/code\")\n        continue\n    \n    sorted_sizes = sorted(sizes.items(), key=lambda x: x[1], reverse=True)\n\n    print(\"┌──────────────┬──────────────┬────────────┬─────────┐\")\n    print(\"│ Width (px)  │ Height (px) │ Channels  │ Quantity│\")\n    print(\"├──────────────┼──────────────┼────────────┼─────────┤\")\n    for (w, h, c), count in sorted_sizes:\n        print(f\"│ {w:<12} │ {h:<12} │ {c:<10} │ {count:<7} │\")\n    print(\"└──────────────┴──────────────┴────────────┴─────────┘\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:28.572897Z","iopub.execute_input":"2025-10-29T05:18:28.573161Z","iopub.status.idle":"2025-10-29T05:18:31.346551Z","shell.execute_reply.started":"2025-10-29T05:18:28.573135Z","shell.execute_reply":"2025-10-29T05:18:31.345503Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nfrom tqdm import tqdm\n\ndef plot_channel_histograms(image_folder, sample_limit=None, batch_size=100):\n    \"\"\"\n    Efficiently plot pixel intensity histograms for each RGB channel across all images.\n    Uses precomputed histograms (no pixel expansion, no sampling, low memory).\n    \"\"\"\n    # List all image files\n    image_files = [\n        os.path.join(image_folder, f)\n        for f in os.listdir(image_folder)\n        if f.lower().endswith(('.jpg', '.jpeg', '.png'))\n    ]\n\n    if sample_limit:\n        image_files = image_files[:sample_limit]\n\n    print(f\"📸 Found {len(image_files)} images in {image_folder}\")\n\n    # Initialize histograms (bins for pixel intensities 0–255)\n    hist_r = np.zeros(256, dtype=np.int64)\n    hist_g = np.zeros(256, dtype=np.int64)\n    hist_b = np.zeros(256, dtype=np.int64)\n\n    # Process in batches\n    for i in tqdm(range(0, len(image_files), batch_size), desc=\"Processing images\"):\n        batch = image_files[i:i + batch_size]\n        for path in batch:\n            try:\n                with Image.open(path) as img:\n                    img = img.convert(\"RGB\")\n                    arr = np.array(img)\n                    hist_r += np.bincount(arr[:,:,0].ravel(), minlength=256)\n                    hist_g += np.bincount(arr[:,:,1].ravel(), minlength=256)\n                    hist_b += np.bincount(arr[:,:,2].ravel(), minlength=256)\n            except Exception as e:\n                print(f\"⚠️ Error reading {path}: {e}\")\n\n    # Normalize for better visual comparison\n    hist_r = hist_r / hist_r.sum()\n    hist_g = hist_g / hist_g.sum()\n    hist_b = hist_b / hist_b.sum()\n\n    # Create intensity axis\n    intensities = np.arange(256)\n\n    # Use Seaborn for consistent style\n    sns.set(style=\"whitegrid\")\n    plt.figure(figsize=(10, 6))\n    plt.plot(intensities, hist_r, color='red', label='Red Channel', alpha=0.7)\n    plt.plot(intensities, hist_g, color='green', label='Green Channel', alpha=0.7)\n    plt.plot(intensities, hist_b, color='blue', label='Blue Channel', alpha=0.7)\n\n    plt.title(\"Normalized Pixel Intensity Distribution per Channel (Train Images)\", fontsize=13)\n    plt.xlabel(\"Pixel Intensity (0–255)\")\n    plt.ylabel(\"Normalized Frequency\")\n    plt.legend()\n    plt.grid(alpha=0.3)\n    plt.tight_layout()\n    plt.show()\n    \nplot_channel_histograms(TRAIN_IMAGE_FOLDER, sample_limit=None, batch_size=16)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:18:31.348089Z","iopub.execute_input":"2025-10-29T05:18:31.348657Z","iopub.status.idle":"2025-10-29T05:19:03.697490Z","shell.execute_reply.started":"2025-10-29T05:18:31.348627Z","shell.execute_reply":"2025-10-29T05:19:03.696519Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def plotImages(tools,directory):\n    print(tools)\n    multipleImages = glob(directory)\n    plt.rcParams['figure.figsize'] = (8, 8) #Original is 15,15. Since we have 18 veggies I decreased the size\n    plt.subplots_adjust(wspace=0, hspace=0)\n    i_ = 0\n    for l in multipleImages[:25]: #Original is 25\n        im = cv2.imread(l)\n        im = cv2.resize(im, (256, 256)) \n        plt.subplot(5, 5, i_+1) #.set_title(l)\n        plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n        i_ += 1\n\nplotImages(\"Biomass train images\",\"../input/csiro-biomass/train/**\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-10-29T05:23:15.986802Z","iopub.execute_input":"2025-10-29T05:23:15.987130Z","iopub.status.idle":"2025-10-29T05:23:19.762610Z","shell.execute_reply.started":"2025-10-29T05:23:15.987109Z","shell.execute_reply":"2025-10-29T05:23:19.761186Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}