[GRASS-user] v.class.mlR Error

Moritz Lennert mlennert at club.worldonline.be
Thu Jun 7 06:44:34 PDT 2018


Thanks

On 07/06/18 15:17, Jamille Haarloo wrote:
> The first 20+ lines of Stats_Training_Ben_test:
> 
> cat,area,perimeter,compact_circle,compact_square,fd,WV_Benatimofo_1_min,WV_Benatimofo_1_max,WV_Benatimofo_1_range,WV_Benatimofo_1_mean,WV_Benatimofo_1_stddev,WV_Benatimofo_1_variance,WV_Benatimofo_1_coeff_var,WV_Benatimofo_1_sum,WV_Benatimofo_1_first_quart,WV_Benatimofo_1_median,WV_Benatimofo_1_third_quart,WV_Benatimofo_2_min,WV_Benatimofo_2_max,WV_Benatimofo_2_range,WV_Benatimofo_2_mean,WV_Benatimofo_2_stddev,WV_Benatimofo_2_variance,WV_Benatimofo_2_coeff_var,WV_Benatimofo_2_sum,WV_Benatimofo_2_first_quart,WV_Benatimofo_2_median,WV_Benatimofo_2_third_quart,WV_Benatimofo_3_min,WV_Benatimofo_3_max,WV_Benatimofo_3_range,WV_Benatimofo_3_mean,WV_Benatimofo_3_stddev,WV_Benatimofo_3_variance,WV_Benatimofo_3_coeff_var,WV_Benatimofo_3_sum,WV_Benatimofo_3_first_quart,WV_Benatimofo_3_median,WV_Benatimofo_3_third_quart,WV_Benatimofo_4_min,WV_Benatimofo_4_max,WV_Benatimofo_4_range,WV_Benatimofo_4_mean,WV_Benatimofo_4_stddev,WV_Benatimofo_4_variance,WV_Benatimofo_4_coeff_var,WV_Benatimofo_4_sum,WV_Benatimofo_4_first_quart,WV_Benatimofo_4_median,WV_Benatimofo_4_third_quart
> 1144,3832.000000,1256.000000,5.723635,0.197144,1.729624,13,76,63,46.4097077244259,9.98454911351384,99.69122100017,21.5139237092391,177842,40,47,53,40,138,98,90.2687891440501,15.2500825418009,232.565017531741,16.8940812061464,345910,81,92,100,15,61,46,40.8582985386221,7.82663897784868,61.2562776895802,19.1555675536767,156569,36,42,47,28,124,96,68.4253653444676,13.5774536655369,184.347248039801,19.8427200164517,262206,59,68,77
> 1145,12092.000000,2282.000000,5.854120,0.192750,1.645226,13,94,81,51.386288455177,10.5294376761475,110.869057775874,20.4907534532914,621363,45,52,59,21,220,199,114.230731061859,23.3590328249442,545.644414516822,20.4489917973953,1381278,101,114,128,7,76,69,46.4219318557724,8.42747122371732,71.0222712265835,18.1540726264915,561334,42,48,52,17,198,181,97.2732385047966,22.492313569247,505.904169697333,23.1228176577445,1176228,84,97,110
> 
[...]

> ---------------------
> All the lines of the output of v.db.select Training_Ben2 at haarlooj_Ben_Test:
> 
> cat|id|Type|code
> 1|4|B29|18
> 2|5|B31|19
> 3|3|B28|17


Again a lack of clear documentation on my side: both the training and 
the segment info should contain the same attributes, with only 
additional one column ('code' in your case) present in the training data.

It should be possible to do this differently, i.e. provide the module 
with the features of all segments, and only the id/cat of each training 
segment with the relevant class and have the module merge the two, but 
this is not implemented, yet.

I also just notice that you have the word 'Training' in both names.

The segment_file/segment_map contains the info (cat + all feature 
variables) of all segments you wish to classify, either in the form of a 
csv file or in the form of a vector map with the info in the attribute 
table.

The training_file/training_map contains the info (cat + all feature 
variables + class) of the training data. Often this is an extract of the 
former, but not necessarily.

All columns in the training file have to be present in the segment file, 
except for the class column (your 'code').

Sorry for the lack of docs. This module has mostly been used internally 
here and so we are not always aware of the unclear and missing parts. 
Having your feedback has been very useful !

Moritz



More information about the grass-user mailing list