Modify html formatting of tables in Classification "acas" reports
I’m trying to make a R function to extract tables (eg. Confusion matrix) from the html report written by the classification workflow, but I get errors at reading some of them. See https://stackoverflow.com/questions/66529092/reading-html-into-r-with-rvest-problem-with-css-selector?noredirect=1#comment117619313_66529092
I’ve been told to suggest you “not to use merged cells in tables and have all rows within a table of the same length (number of columns)”
Comments (7)
-
-
reporter That would be better. Actually, just a csv of the confusion matrix would be enough, as R has tools to calculate the relevant parameters from it.
-
Here is an CSV example. Any comments?
Classification Performance Reference sample size: 1924 px Map size: 87236.0 square meters Adjusted Confusion Matrix Counts ;(1);(2);(3);(4);(5);(6) roof;293.78;20.0;26.92;30.76;0.0;0.0 pavement;49.96;169.31;8.79;28.22;0.93;0.46 low vegetation;62.65;32.05;234.56;97.61;1.46;2.91 tree;21.8;41.06;20.28;169.31;1.01;0.0 soil;0.0;46.2;46.2;57.75;438.88;0.0 water;0.0;0.0;0.0;0.57;0.0;20.58 Adjusted Confusion Matrix Area Proportions ;(1);(2);(3);(4);(5);(6) roof;0.1527;0.0104;0.014;0.016;0.0;0.0 pavement;0.026;0.088;0.0046;0.0147;0.0005;0.0002 low vegetation;0.0326;0.0167;0.1219;0.0507;0.0008;0.0015 tree;0.0113;0.0213;0.0105;0.088;0.0005;0.0 soil;0.0;0.024;0.024;0.03;0.2281;0.0 water;0.0;0.0;0.0;0.0003;0.0;0.0107 Overall Accuracies ;Estimate;95 % Confidence Interval; Overall Accuracy;0.6894;0.6884;0.6904 Class-wise Accuracies ;User's Accuracy;95 % Confidence Interval; ;Producer's Accuracy;95 % Confidence Interval; ;F1-Score;95 % Confidence Interval; roof;0.7909;0.79;0.7918;0.6861;0.6853;0.6869;0.7348;0.7342;0.7354 pavement;0.6571;0.6561;0.6581;0.5486;0.5465;0.5507;0.598;0.5967;0.5993 low vegetation;0.5439;0.5425;0.5453;0.6966;0.6942;0.699;0.6108;0.6096;0.6121 tree;0.668;0.667;0.669;0.4407;0.4391;0.4422;0.531;0.5298;0.5322 soil;0.7451;0.7421;0.7481;0.9923;0.9921;0.9925;0.8511;0.8492;0.8531 water;0.973;0.9717;0.9743;0.8591;0.8554;0.8627;0.9125;0.9103;0.9146 Class-wise Proportion and Area Estimates ;Proportion;95 % Confidence Interval; ;Area [square meters];95 % Confidence Interval; roof;0.2225;0.2222;0.2229;17472816.87;17448284.93;17497348.8 pavement;0.1604;0.1598;0.161;12593739.23;12544769.35;12642709.12 low vegetation;0.175;0.1744;0.1757;13741407.46;13689033.09;13793781.83 tree;0.1997;0.199;0.2004;15678905.06;15623026.76;15734783.35 soil;0.2299;0.2289;0.2308;18047977.65;17975376.81;18120578.48 water;0.0125;0.0124;0.0125;977553.73;973225.99;981881.47 Implementation is based on: Stehman, S. V., 2014. Estimating area and map accuracy for stratified random sampling when the strata are different from the map classes. Int. J. Remote Sens. 35, 4923-4939, <a href="https://doi.org/10.1080/01431161.2014.930207">https://doi.org/10.1080/01431161.2014.930207</a>
The corresponsing HTML report looks like that:
-
reporter Could you put the link to the csv file to download? Just to make sure I do not make any error with the cut and paste
-
- attached report.html.csv
-
sure, uploaded it
-
- changed status to resolved
- Log in to comment
We already working on an alternative output format for the accuracy assessment, which is more suitable for further processing. Beside the HTML report we will provide a JSON file with all the data that you can easily read into Python or R.