[GRASS-user] v.class.mlR error

Markus Neteler neteler at osgeo.org
Thu Nov 10 10:25:05 PST 2016


On Thu, Nov 10, 2016 at 3:45 PM, James Duffy
<james.philip.duffy at gmail.com> wrote:
> Hello,
>
> I'm trying to run v.class.mlR on a vector map, with a separate vector map
> containing my training data. Currently I have two classes '1' and '2' stored
> in the column 'class'. My region is set to that of the segments to be
> classified. I run the following command:
>
> v.class.mlR segments_map=gp_seg_stats_vec at gp1 \
> training_map=gp_seg_sed_grass at gp1 train_class_column=class \
> output_class_column=vote output_prob_column=prob folds=5 \
> partitions=10 tunelength=10 weighting_metric=accuracy
>
> And get the following output:
>
> Running R now. Following output is R output.

[...]

While I didn't look at the v.class.mlR.py script, I see:

> Loading required package: rpart
> Error in eval(expr, envir, enclos) : object 'cat_' not found

which suggests that vector export is involved somehow. The cat_
originates from a export of a previously imported vector map (first
import adds the category "cat" which is then exported and at re-import
it is renamed to "cat_" since a new "cat" is also generated). Hence
there might be used v.out.ogr somewhere in the process which should be
used with this flag:

-s   Skip export of GRASS category ID ('cat') attribute

to avoid that "cat_" is generated later.

Some script analysis will be needed.

Best,
Markus

-- 
Markus Neteler
http://www.mundialis.de - free data with free software
http://grass.osgeo.org
http://courses.neteler.org/blog


More information about the grass-user mailing list