{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Validation\n", "\n", "When a classification is performed, whether it is generated with machine learning tools such as Random Forest or based on thresholds of a spectral index for example, it should be validated on the basis of *in situ* data (ground data). \n", "\n", "**In the case where *in situ* data are also used to generate the classification, the data used to validate the classification must be independent.**\n", "\n", "The validation data are used to assess the map accuracy defined by the agreement between the map output and the validation data assumed to be the truth. The most common way to derive the map accuracy is to analyse the confusion matrix, which is a square co-occurrence matrix compiling the number of samples matching a given land cover class with validation information. Diagonal values represent the agreement frequency between the validation data and the map output, while non-diagonal values represent the errors.\n", "\n", "\n", "It is recommended to use as primary accuracy measures :\n", "- user accuracy (UA),\n", "- producer accuracy (PA)\n", "- overall accuracy (OA)\n", "\n", "For binary maps such as the cropland mask, the OA depends to a large extent on the respective proportion of both classes in the validation data set. In this case, the F-Score, the use of which has been recently adopted, is a more informative accuracy metric.\n", "\n", "\n", "The **Overall Accuracy** (OA) is computed as the ratio of the number of all correctly classified samples to the total number (N) of all validation samples. A standard target for the overall accuracy of a land cover map is typically 85 percent. In some cases, simple land cover maps that include very few classes can reach 90 percent.\n", "\n", "$\\mathrm{OA}(\\%)=\\left(100 \\times \\sum_{k=1}^{q} n_{\\mathrm{kk}}\\right) / \\mathrm{N}$\n", "\n", "\n", "The **User Accuracy** (UA) for a given class i is the ratio between the number of correctly classified samples as belonging to this class and **all samples classified in this class**.\n", "\n", "$\\mathrm{UA}_{\\mathrm{i}}(\\%)=100 \\times \\frac{n_{i i}}{n_{i+}}$\n", "\n", "\n", "The **Producer Accuracy** (PA) for a given class i is the ratio between the number of correctly classified samples and all samples belonging to this class, **according to the validation data**.\n", "\n", "$\\mathrm{PA}_{\\mathrm{i}}(\\%)=100 \\times \\frac{n_{i i}}{n_{+i}}$\n", "\n", "The **F-score** is calculated as a combination of PA and UA for a given land cover class i:\n", "\n", "$\\mathrm{F-score}_{\\mathrm{i}} =\\frac{2 \\times \\mathrm{PA}_{\\mathrm{i}} \\times \\mathrm{UA}_{\\mathrm{i}}}{\\mathrm{PA}_{\\mathrm{i}} + \\mathrm{UA}_{\\mathrm{i}}}$\n", "\n", "---\n", "\n", "[Handbook on remote sensing for agricultural statistics](https://nicolasdeffense.github.io/eo-toolbox/docs/Remote_Sensing_for_Agricultural_Statistics.pdf)\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "All libraries successfully imported!\n", "Scikit-learn: 1.2.0\n" ] } ], "source": [ "import os\n", "import numpy as np\n", "import pandas as pd\n", "import geopandas as gpd\n", "import rasterio\n", "from rasterio import features\n", "\n", "import matplotlib.pyplot as plt\n", "import sklearn\n", "from sklearn.metrics import confusion_matrix, f1_score, accuracy_score, classification_report\n", "\n", "from pathlib import Path\n", "\n", "import plotly.express as px\n", "import plotly.figure_factory as ff\n", "import plotly.graph_objects as go\n", "import plotly.offline\n", "plotly.offline.init_notebook_mode()\n", "\n", "print('All libraries successfully imported!')\n", "print(f'Scikit-learn: {sklearn.__version__}')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Set directory**" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Accuracy Metrics path is set to : /export/miro/ndeffense/LBRAT2104/STUDENTS/GROUP_99/TP/ACCURACY_METRICS/\n" ] } ], "source": [ "computer_path = 'X:/'\n", "grp_nb = '99'\n", "\n", "data_path = f'{computer_path}data/' # Directory with data shared by the assistant\n", "work_path = f'{computer_path}STUDENTS/GROUP_{grp_nb}/' # Directory for all work files\n", "\n", "# Input directories\n", "in_situ_path = f'{work_path}C_IN_SITU_CAL_VAL/'\n", "classif_path = f'{work_path}CLASSIF/'\n", "lut_path = f'{data_path}LUT/'\n", "\n", "# Output directory\n", "am_path = f'{work_path}ACCURACY_METRICS/'\n", "\n", "\n", "Path(am_path).mkdir(parents=True, exist_ok=True)\n", "\n", "print(f'Accuracy Metrics path is set to : {am_path}')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Set parameters**" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "site = 'NAMUR'\n", "year = '2020'\n", "\n", "feat_nb = 2\n", "no_data = -999\n", "\n", "ws = 3 # Window size radius (filtering post classification)\n", "\n", "reclassif_flag = True\n", "filter_flag = True\n", "\n", "# Field used for classification\n", "field_classif_code = 'grp_1_nb'\n", "field_classif_name = 'grp_1'\n", "\n", "# Field used for reclassification\n", "field_reclassif_code = 'grp_A_nb'\n", "field_reclassif_name = 'grp_A'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Set filenames**" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reclassification : True\n", "Filter : True\n", "Classification file used : \n", " /export/miro/ndeffense/LBRAT2104/STUDENTS/GROUP_99/TP/CLASSIF/NAMUR_2020_classif_RF_feat_2_grp_1_reclassify_grp_A_filter_ws_3.tif\n", "Validation polygons used : \n", " /export/miro/ndeffense/LBRAT2104/STUDENTS/GROUP_99/TP/C_IN_SITU_CAL_VAL/NAMUR_2020_IN_SITU_ROI_VAL.shp\n" ] } ], "source": [ "if not reclassif_flag and not filter_flag:\n", " print(f'Reclassification : {reclassif_flag}')\n", " print(f'Filter : {filter_flag}')\n", " classif_tif = f'{classif_path}{site}_{year}_classif_RF_feat_{feat_nb}_{field_classif_name}.tif'\n", "\n", " field_code = field_classif_code\n", " field_name = field_classif_name\n", "\n", "elif reclassif_flag and not filter_flag:\n", " print(f'Reclassification : {reclassif_flag}')\n", " print(f'Filter : {filter_flag}')\n", " classif_tif = f'{classif_path}{site}_{year}_classif_RF_feat_{feat_nb}_{field_classif_name}_reclassify_{field_reclassif_name}.tif'\n", "\n", " field_code = field_reclassif_code\n", " field_name = field_reclassif_name\n", "\n", "elif reclassif_flag and filter_flag:\n", " print(f'Reclassification : {reclassif_flag}')\n", " print(f'Filter : {filter_flag}')\n", " classif_tif = f'{classif_path}{site}_{year}_classif_RF_feat_{feat_nb}_{field_classif_name}_reclassify_{field_reclassif_name}_filter_ws_{ws}.tif'\n", "\n", " field_code = field_reclassif_code\n", " field_name = field_reclassif_name\n", " \n", "else:\n", " print('No classfication file is available !')\n", " classif_tif = \"\"\n", "\n", "\n", "# LUT to get class names\n", "lut_xlsx = f'{lut_path}crop_dictionary.xlsx'\n", "\n", "\n", "# In situ data used for validation\n", "in_situ_val_shp = f'{in_situ_path}{site}_{year}_IN_SITU_ROI_VAL.shp'\n", "in_situ_val_tif = f'{in_situ_path}{site}_{year}_IN_SITU_ROI_VAL_{field_name}.tif'\n", "\n", "# Confusion matrix and Accuracy metrics files\n", "cm_csv = f'{am_path}{os.path.basename(classif_tif)}_CM.csv'\n", "cm_html = f'{am_path}{os.path.basename(classif_tif)}_CM.html'\n", "am_html = f'{am_path}{os.path.basename(classif_tif)}_AM.html'\n", "\n", "\n", "# USED ONLY FOR VISU ON WEBSITE !\n", "#cm_html = f'/export/miro/ndeffense/LBRAT2104/GIT/eo-toolbox/figures/{site}_{year}_CM.html'\n", "#am_html = f'/export/miro/ndeffense/LBRAT2104/GIT/eo-toolbox/figures/{site}_{year}_AM.html'\n", "\n", "print(f'Classification file used : \\n {classif_tif}')\n", "print(f'Validation polygons used : \\n {in_situ_val_shp}')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Prepare data " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.1 Rasterize *in situ* data validation shapefile" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Raster template file : /export/miro/ndeffense/LBRAT2104/STUDENTS/GROUP_99/TP/CLASSIF/NAMUR_2020_classif_RF_feat_2_grp_1_reclassify_grp_A_filter_ws_3.tif\n", "The CRS of in situ data is : 32631\n", "The CRS of raster template is : 32631\n", "CRS are the same\n", "Rasterize starts : /export/miro/ndeffense/LBRAT2104/STUDENTS/GROUP_99/TP/C_IN_SITU_CAL_VAL/NAMUR_2020_IN_SITU_ROI_VAL.shp\n", "Rasterize is done : /export/miro/ndeffense/LBRAT2104/STUDENTS/GROUP_99/TP/C_IN_SITU_CAL_VAL/NAMUR_2020_IN_SITU_ROI_VAL_grp_A.tif\n" ] } ], "source": [ "# Open the shapefile with GeoPandas\n", "in_situ_gdf = gpd.read_file(in_situ_val_shp)\n", "\n", "# Open the raster file you want to use as a template for rasterize\n", "print(f'Raster template file : {classif_tif}')\n", "\n", "src = rasterio.open(classif_tif, \"r\")\n", "\n", "# Update metadata\n", "\n", "out_meta = src.meta\n", "out_meta.update(nodata=no_data)\n", "\n", "crs_shp = str(in_situ_gdf.crs).split(\":\",1)[1]\n", "crs_tif = str(src.crs).split(\":\",1)[1]\n", "\n", "print(f'The CRS of in situ data is : {crs_shp}')\n", "print(f'The CRS of raster template is : {crs_tif}')\n", "\n", "if crs_shp == crs_tif:\n", " print(\"CRS are the same\")\n", "\n", " print(f'Rasterize starts : {in_situ_val_shp}')\n", "\n", " # Burn the features into the raster and write it out\n", "\n", " dst = rasterio.open(in_situ_val_tif, 'w+', **out_meta)\n", " dst_arr = dst.read(1)\n", "\n", " # This is where we create a generator of geom, value pairs to use in rasterizing\n", "\n", " geom_col = in_situ_gdf.geometry\n", " code_col = in_situ_gdf[field_code].astype(int)\n", "\n", " shapes = ((geom,value) for geom, value in zip(geom_col, code_col))\n", "\n", " in_situ_arr = features.rasterize(shapes=shapes,\n", " fill=no_data,\n", " out=dst_arr,\n", " transform=dst.transform)\n", " \n", " dst.write_band(1, in_situ_arr)\n", "\n", " print(f'Rasterize is done : {in_situ_val_tif}')\n", "\n", " # Close rasterio objects\n", " src.close()\n", " dst.close()\n", "\n", "else:\n", " print('CRS are different --> repoject in-situ data shapefile with \"to_crs\"')" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 1.2 Build `y_pred` and `y_true`\n", "\n", "- `y_pred` : Estimated targets as returned by a classifier\n", "- `y_true` : Ground truth (correct) target values" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reference data (truth) : [ 3 3 3 ... 111 111 111]\n", "Classification data : [ 3 3 3 ... 111 111 111]\n", "---------------------------------------------\n", "Number of validation samples : 72599\n" ] } ], "source": [ "# Open in-situ used for validation\n", "src = rasterio.open(in_situ_val_tif, \"r\")\n", "val_arr = src.read(1)\n", "src.close()\n", "\n", "# Open classification map\n", "src = rasterio.open(classif_tif, \"r\")\n", "classif_arr = src.read(1)\n", "src.close()\n", "\n", "# Get the postion of validation pixels\n", "idx = np.where(val_arr == no_data, 0, 1).astype(bool)\n", "\n", "\n", "# Ground truth (correct) target values\n", "y_true = val_arr[idx]\n", "\n", "print(f'Reference data (truth) : {y_true}')\n", "\n", "# Estimated targets as returned by a classifier.\n", "y_pred = classif_arr[idx]\n", "\n", "print(f'Classification data : {y_pred}')\n", "\n", "print('---------------------------------------------')\n", "print(f'Number of validation samples : {len(y_true)}')\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Sometimes, some classes do not appear in the classification map, they are not predicted by the Random Forest.\n", "\n", "This means that some classes in `y_true` don't appear in `y_pred`." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 classes are missing in the classification (y_pred) : set() \n", "\n", "All training classes :\n", " [3, 6, 8, 9, 17, 21, 22, 111, 112, 115, 117, 119, 121, 143, 151, 181, 192]\n", "All predicted classes (at least once) :\n", " [3, 6, 8, 9, 17, 21, 22, 111, 112, 115, 117, 119, 121, 143, 151, 181, 192]\n" ] } ], "source": [ "# Check if there are missing classes in the classification\n", "\n", "classes_all = sorted(np.unique(y_true))\n", "classes_pred = sorted(np.unique(y_pred))\n", "\n", "classes_missing = set(y_true) - set(y_pred)\n", "\n", "print(f'{len(classes_missing)} classes are missing in the classification (y_pred) : {classes_missing} \\n')\n", "\n", "print(f'All training classes :\\n {classes_all}')\n", "print(f'All predicted classes (at least once) :\\n {classes_pred}')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.3 Find class names" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3 - Grassland and meadows\n", "6 - Forest\n", "8 - Build-up surface\n", "9 - Water bodies\n", "17 - Leguminous crops\n", "21 - Fruits trees\n", "22 - Vineyards\n", "111 - Wheat\n", "112 - Maize\n", "115 - Barley\n", "117 - Oats\n", "119 - Other cereals\n", "121 - Leafy or stem vegetables\n", "143 - Other oilseed crops\n", "151 - Potatoes\n", "181 - Sugar beet\n", "192 - Fibre crops\n" ] } ], "source": [ "lut_df = pd.read_excel(lut_xlsx)\n", "\n", "classes_name = lut_df[lut_df[field_code].isin(classes_all)].sort_values(field_code)[field_name].drop_duplicates().to_list()\n", "\n", "for code,name in zip(classes_all, classes_name):\n", " print(f'{code} - {name}')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Confusion Matrix" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.1 Compute Confusion Matrix" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
3689172122111112115117119121143151181192
31753329711008759003000000
6577292700000000000000
82713443800035000000000
90032240000000000000
1715201001138001000000101
216880000000000000000
222000003400000000000
1111287320701202040106632718000035
11217229000006457001001280
11528211000012880293113635700000
117800000080010000000126
1192904000041520012133400000
121500000007260003500190
143792100002006000542000
1513152000011590000038348480
181880004003490301030150740
1920000000359008100000311
\n", "
" ], "text/plain": [ " 3 6 8 9 17 21 22 111 112 115 117 119 121 \\\n", "3 17533 297 11 0 0 8 7 59 0 0 3 0 0 \n", "6 57 729 27 0 0 0 0 0 0 0 0 0 0 \n", "8 27 13 443 8 0 0 0 35 0 0 0 0 0 \n", "9 0 0 32 24 0 0 0 0 0 0 0 0 0 \n", "17 152 0 10 0 1138 0 0 1 0 0 0 0 0 \n", "21 688 0 0 0 0 0 0 0 0 0 0 0 0 \n", "22 20 0 0 0 0 34 0 0 0 0 0 0 0 \n", "111 128 7 32 0 7 0 1 20204 0 1066 32 718 0 \n", "112 17 2 29 0 0 0 0 0 6457 0 0 1 0 \n", "115 282 1 1 0 0 0 0 1288 0 2931 136 357 0 \n", "117 8 0 0 0 0 0 0 8 0 0 100 0 0 \n", "119 29 0 4 0 0 0 0 4152 0 0 121 334 0 \n", "121 5 0 0 0 0 0 0 0 726 0 0 0 35 \n", "143 79 2 1 0 0 0 0 20 0 6 0 0 0 \n", "151 3 15 2 0 0 0 0 1 159 0 0 0 0 \n", "181 8 8 0 0 0 4 0 0 349 0 3 0 103 \n", "192 0 0 0 0 0 0 0 359 0 0 81 0 0 \n", "\n", " 143 151 181 192 \n", "3 0 0 0 0 \n", "6 0 0 0 0 \n", "8 0 0 0 0 \n", "9 0 0 0 0 \n", "17 0 1 0 1 \n", "21 0 0 0 0 \n", "22 0 0 0 0 \n", "111 0 0 0 35 \n", "112 0 1 28 0 \n", "115 0 0 0 0 \n", "117 0 0 0 126 \n", "119 0 0 0 0 \n", "121 0 0 19 0 \n", "143 542 0 0 0 \n", "151 0 3834 848 0 \n", "181 0 1 5074 0 \n", "192 0 0 0 311 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "cm = confusion_matrix(y_true, y_pred)\n", "\n", "# Convert CM in dataframe\n", "cm_df = pd.DataFrame(cm)\n", "\n", "cm_df.columns = classes_all\n", "cm_df.index = classes_all\n", "\n", "# Export CM in a CSV file\n", "cm_df.to_csv(cm_csv, index=True, sep=';')\n", "\n", "display(cm_df)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.2 Plot Confusion Matrix" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "colorscale": [ [ 0, "rgb(158,1,66)" ], [ 0.1, "rgb(213,62,79)" ], [ 0.2, "rgb(244,109,67)" ], [ 0.3, "rgb(253,174,97)" ], [ 0.4, "rgb(254,224,139)" ], [ 0.5, "rgb(255,255,191)" ], [ 0.6, "rgb(230,245,152)" ], [ 0.7, "rgb(171,221,164)" ], [ 0.8, "rgb(102,194,165)" ], [ 0.9, "rgb(50,136,189)" ], [ 1, "rgb(94,79,162)" ] ], "reversescale": true, "showscale": false, "type": "heatmap", "x": [ "Grassland and meadows", "Forest", "Build-up surface", "Water bodies", "Leguminous crops", "Fruits trees", "Vineyards", "Wheat", "Maize", "Barley", "Oats", "Other cereals", "Leafy or stem vegetables", "Other oilseed crops", "Potatoes", "Sugar beet", "Fibre crops" ], "y": [ "Fibre crops", "Sugar beet", "Potatoes", "Other oilseed crops", "Leafy or stem vegetables", "Other cereals", "Oats", "Barley", "Maize", "Wheat", "Vineyards", "Fruits trees", "Leguminous crops", "Water bodies", "Build-up surface", "Forest", "Grassland and meadows" ], "z": [ [ 0, 0, 0, 0, 0, 0, 0, 359, 0, 0, 81, 0, 0, 0, 0, 0, 311 ], [ 8, 8, 0, 0, 0, 4, 0, 0, 349, 0, 3, 0, 103, 0, 1, 5074, 0 ], [ 3, 15, 2, 0, 0, 0, 0, 1, 159, 0, 0, 0, 0, 0, 3834, 848, 0 ], [ 79, 2, 1, 0, 0, 0, 0, 20, 0, 6, 0, 0, 0, 542, 0, 0, 0 ], [ 5, 0, 0, 0, 0, 0, 0, 0, 726, 0, 0, 0, 35, 0, 0, 19, 0 ], [ 29, 0, 4, 0, 0, 0, 0, 4152, 0, 0, 121, 334, 0, 0, 0, 0, 0 ], [ 8, 0, 0, 0, 0, 0, 0, 8, 0, 0, 100, 0, 0, 0, 0, 0, 126 ], [ 282, 1, 1, 0, 0, 0, 0, 1288, 0, 2931, 136, 357, 0, 0, 0, 0, 0 ], [ 17, 2, 29, 0, 0, 0, 0, 0, 6457, 0, 0, 1, 0, 0, 1, 28, 0 ], [ 128, 7, 32, 0, 7, 0, 1, 20204, 0, 1066, 32, 718, 0, 0, 0, 0, 35 ], [ 20, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 152, 0, 10, 0, 1138, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1 ], [ 0, 0, 32, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 27, 13, 443, 8, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 57, 729, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 17533, 297, 11, 0, 0, 8, 7, 59, 0, 0, 3, 0, 0, 0, 0, 0, 0 ] ] } ], "layout": { "annotations": [ { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Grassland and meadows", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Build-up surface", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "359", "x": "Wheat", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "81", "x": "Oats", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "311", "x": "Fibre crops", "xref": "x", "y": "Fibre crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "8", "x": "Grassland and meadows", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "8", "x": "Forest", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Build-up surface", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "4", "x": "Fruits trees", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "349", "x": "Maize", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "3", "x": "Oats", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "103", "x": "Leafy or stem vegetables", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Potatoes", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "5074", "x": "Sugar beet", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Sugar beet", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "3", "x": "Grassland and meadows", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "15", "x": "Forest", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "2", "x": "Build-up surface", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Wheat", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "159", "x": "Maize", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "3834", "x": "Potatoes", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "848", "x": "Sugar beet", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Potatoes", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "79", "x": "Grassland and meadows", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "2", "x": "Forest", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Build-up surface", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "20", "x": "Wheat", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "6", "x": "Barley", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "542", "x": "Other oilseed crops", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Other oilseed crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "5", "x": "Grassland and meadows", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Build-up surface", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "726", "x": "Maize", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "35", "x": "Leafy or stem vegetables", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "19", "x": "Sugar beet", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Leafy or stem vegetables", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "29", "x": "Grassland and meadows", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "4", "x": "Build-up surface", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "4152", "x": "Wheat", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "121", "x": "Oats", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "334", "x": "Other cereals", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Other cereals", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "8", "x": "Grassland and meadows", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Build-up surface", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "8", "x": "Wheat", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "100", "x": "Oats", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "126", "x": "Fibre crops", "xref": "x", "y": "Oats", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "282", "x": "Grassland and meadows", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Forest", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Build-up surface", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1288", "x": "Wheat", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "2931", "x": "Barley", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "136", "x": "Oats", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "357", "x": "Other cereals", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Barley", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "17", "x": "Grassland and meadows", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "2", "x": "Forest", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "29", "x": "Build-up surface", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "6457", "x": "Maize", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Other cereals", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Potatoes", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "28", "x": "Sugar beet", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Maize", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "128", "x": "Grassland and meadows", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "7", "x": "Forest", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "32", "x": "Build-up surface", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "7", "x": "Leguminous crops", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Vineyards", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "20204", "x": "Wheat", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1066", "x": "Barley", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "32", "x": "Oats", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "718", "x": "Other cereals", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "35", "x": "Fibre crops", "xref": "x", "y": "Wheat", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "20", "x": "Grassland and meadows", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Build-up surface", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "34", "x": "Fruits trees", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Vineyards", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "688", "x": "Grassland and meadows", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Build-up surface", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Fruits trees", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "152", "x": "Grassland and meadows", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "10", "x": "Build-up surface", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1138", "x": "Leguminous crops", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Wheat", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Potatoes", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "1", "x": "Fibre crops", "xref": "x", "y": "Leguminous crops", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Grassland and meadows", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Forest", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "32", "x": "Build-up surface", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "24", "x": "Water bodies", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Water bodies", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "27", "x": "Grassland and meadows", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "13", "x": "Forest", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "443", "x": "Build-up surface", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "8", "x": "Water bodies", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "35", "x": "Wheat", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Build-up surface", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "57", "x": "Grassland and meadows", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "729", "x": "Forest", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "27", "x": "Build-up surface", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fruits trees", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Vineyards", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Wheat", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Oats", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Forest", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "17533", "x": "Grassland and meadows", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "297", "x": "Forest", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "11", "x": "Build-up surface", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Water bodies", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leguminous crops", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "8", "x": "Fruits trees", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "7", "x": "Vineyards", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "59", "x": "Wheat", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Maize", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Barley", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "3", "x": "Oats", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other cereals", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Leafy or stem vegetables", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Other oilseed crops", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Potatoes", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Sugar beet", "xref": "x", "y": "Grassland and meadows", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0", "x": "Fibre crops", "xref": "x", "y": "Grassland and meadows", "yref": "y" } ], "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "dtick": 1, "gridcolor": "rgb(0, 0, 0)", "side": "top", "ticks": "" }, "yaxis": { "dtick": 1, "ticks": "", "ticksuffix": " " } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# invert z idx values\n", "z = cm[::-1]\n", "\n", "x = classes_name\n", "y = x[::-1].copy() # invert idx values of x\n", "\n", "# change each element of z to type string for annotations\n", "z_text = [[str(y) for y in x] for x in z]\n", "\n", "# set up figure \n", "fig = ff.create_annotated_heatmap(z,\n", " x=x,\n", " y=y,\n", " annotation_text=z_text,\n", " colorscale='spectral',\n", " reversescale=True)\n", "\n", "# add title\n", "#fig.update_layout(title_text=f\"Confusion Matrix - {site}, {year}\")\n", "\n", "# adjust margins to make room for yaxis title\n", "#fig.update_layout(margin=dict(t=200, l=200))\n", "\n", "#fig.update_xaxes(tickfont_size=20)\n", "#fig.update_yaxes(tickfont_size=20)\n", "#fig.update_layout(font_size=25)\n", "\n", "# add colorbar\n", "#fig['data'][0]['showscale'] = True\n", "\n", "fig.show()\n", "fig.write_html(cm_html)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Accuracy metrics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.1 Compute Accuracy Metrics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you decide that you are not interested in the scores of classes that were not predicted, then you can explicitly specify the classes you are interested in (which are labels that were predicted at least once)." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " Grassland and meadows 0.921 0.979 0.949 17918\n", " Forest 0.679 0.897 0.773 813\n", " Build-up surface 0.748 0.842 0.792 526\n", " Water bodies 0.750 0.429 0.545 56\n", " Leguminous crops 0.994 0.873 0.930 1303\n", " Fruits trees 0.000 0.000 0.000 688\n", " Vineyards 0.000 0.000 0.000 54\n", " Wheat 0.773 0.909 0.836 22230\n", " Maize 0.840 0.988 0.908 6535\n", " Barley 0.732 0.587 0.651 4996\n", " Oats 0.210 0.413 0.279 242\n", " Other cereals 0.237 0.072 0.110 4640\n", "Leafy or stem vegetables 0.254 0.045 0.076 785\n", " Other oilseed crops 1.000 0.834 0.909 650\n", " Potatoes 0.999 0.789 0.881 4862\n", " Sugar beet 0.850 0.914 0.881 5550\n", " Fibre crops 0.658 0.414 0.508 751\n", "\n", " accuracy 0.822 72599\n", " macro avg 0.626 0.587 0.590 72599\n", " weighted avg 0.788 0.822 0.797 72599\n", "\n" ] } ], "source": [ "acc_metrics_str = classification_report(y_true,\n", " y_pred,\n", " target_names=classes_name,\n", " labels=classes_all,\n", " digits=3)\n", "\n", "print(acc_metrics_str)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.2 Compute Overall Accuracy" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Overall Accuracy : 82.22%\n" ] } ], "source": [ "oa = accuracy_score(y_true, y_pred)\n", "oa = round(oa*100, 2)\n", "\n", "print(f'Overall Accuracy : {oa}%')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.3 Plot Accuracy Metrics" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "name": "Precision", "text": [ "0.921", "0.679", "0.748", "0.75", "0.994", "0.0", "0.0", "0.773", "0.84", "0.732", "0.21", "0.237", "0.254", "1.0", "0.999", "0.85", "0.658" ], "textposition": "auto", "type": "bar", "x": [ "Grassland and meadows", "Forest", "Build-up surface", "Water bodies", "Leguminous crops", "Fruits trees", "Vineyards", "Wheat", "Maize", "Barley", "Oats", "Other cereals", "Leafy or stem vegetables", "Other oilseed crops", "Potatoes", "Sugar beet", "Fibre crops" ], "y": [ 0.921, 0.679, 0.748, 0.75, 0.994, 0, 0, 0.773, 0.84, 0.732, 0.21, 0.237, 0.254, 1, 0.999, 0.85, 0.658 ] }, { "name": "Recall", "text": [ "0.979", "0.897", "0.842", "0.429", "0.873", "0.0", "0.0", "0.909", "0.988", "0.587", "0.413", "0.072", "0.045", "0.834", "0.789", "0.914", "0.414" ], "textposition": "auto", "type": "bar", "x": [ "Grassland and meadows", "Forest", "Build-up surface", "Water bodies", "Leguminous crops", "Fruits trees", "Vineyards", "Wheat", "Maize", "Barley", "Oats", "Other cereals", "Leafy or stem vegetables", "Other oilseed crops", "Potatoes", "Sugar beet", "Fibre crops" ], "y": [ 0.979, 0.897, 0.842, 0.429, 0.873, 0, 0, 0.909, 0.988, 0.587, 0.413, 0.072, 0.045, 0.834, 0.789, 0.914, 0.414 ] }, { "name": "F1-score", "text": [ "0.949", "0.773", "0.792", "0.545", "0.93", "0.0", "0.0", "0.836", "0.908", "0.651", "0.279", "0.11", "0.076", "0.909", "0.881", "0.881", "0.508" ], "textposition": "auto", "type": "bar", "x": [ "Grassland and meadows", "Forest", "Build-up surface", "Water bodies", "Leguminous crops", "Fruits trees", "Vineyards", "Wheat", "Maize", "Barley", "Oats", "Other cereals", "Leafy or stem vegetables", "Other oilseed crops", "Potatoes", "Sugar beet", "Fibre crops" ], "y": [ 0.949, 0.773, 0.792, 0.545, 0.93, 0, 0, 0.836, 0.908, 0.651, 0.279, 0.11, 0.076, 0.909, 0.881, 0.881, 0.508 ] } ], "layout": { "barmode": "group", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Accuracy Metrics - NAMUR, 2020" }, "yaxis": { "range": [ 0, 1 ], "tickfont": { "size": 10 } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "acc_metrics_dict = classification_report(y_true, y_pred,target_names=classes_name, output_dict=True)\n", "\n", "am_df = pd.DataFrame.from_dict(acc_metrics_dict).round(3)\n", "\n", "am_df = am_df.iloc[:,:-3]\n", "\n", "#am_df = pd.concat([am_df, nb_df])\n", "\n", "#am_df = am_df.sort_values(by='pix_count', ascending=False, axis=1)\n", "\n", "class_name = am_df.columns.to_list()\n", "precision = am_df.loc['precision'].to_list()\n", "recall = am_df.loc['recall'].to_list()\n", "f1_score = am_df.loc['f1-score'].to_list()\n", "\n", "fig = go.Figure(data=[\n", " go.Bar(name='Precision', x=class_name, y=precision, text=precision, textposition='auto'),\n", " go.Bar(name='Recall', x=class_name, y=recall, text=recall, textposition='auto'),\n", " go.Bar(name='F1-score', x=class_name, y=f1_score, text=f1_score, textposition='auto')\n", "])\n", "# Change the bar mode\n", "fig.update_layout(title_text=f'Accuracy Metrics - {site}, {year}',\n", " barmode='group')\n", "\n", "#fig.update_xaxes(tickfont_size=30)\n", "fig.update_yaxes(tickfont_size=10, range=[0,1])\n", "#fig.update_layout(xaxis_title=None, font_size=10)\n", "#fig.update_layout(legend=dict(font=dict(size=25)))\n", "\n", "fig.show()\n", "fig.write_html(am_html)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.6.12 64-bit", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.8" }, "metadata": { "interpreter": { "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" } }, "orig_nbformat": 2, "vscode": { "interpreter": { "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" } } }, "nbformat": 4, "nbformat_minor": 2 }