Re: [GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-16 Thread Moritz Lennert
On 16/04/19 16:50, Jamille Haarloo wrote: Replacing ids <- rownames(features) with ids <- rownames(predicted) is the only edit I did after the previous try, so this should have solved the error. Watch out: I'm not sure that this is really equivalent. I think I used the rownames(features) to

Re: [GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-16 Thread Jamille Haarloo
Replacing ids <- rownames(features) with ids <- rownames(predicted) is the only edit I did after the previous try, so this should have solved the error. If I understood correctly na.action = na.exclude can help to work around the NA values without deleting rows but somehow I did not work. The

Re: [GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-16 Thread Jamille Haarloo
Hi Moritz, Thank you! it worked. I did not find the line nor similar lines of 'features <- na.omit(features)' in the v.class.mlR script/ R_script4 file. Best, Jamille On Mon, Apr 15, 2019 at 11:09 AM Moritz Lennert < mlenn...@club.worldonline.be> wrote: > Hi Jamille, > > On 15/04/19 14:49,

Re: [GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-15 Thread Moritz Lennert
Hi Jamille, On 15/04/19 14:49, Jamille Haarloo wrote:> Dear Moritz and other Grass- users and developers, > > I tried dealing with the error myself by changing predicted <- > data.frame(predict(models.cv , features)) into > predicted <- data.frame(predict(models.cv

[GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-15 Thread Jamille Haarloo
Dear Moritz and other Grass- users and developers, I tried dealing with the error myself by changing predicted <- data.frame(predict(models.cv, features)) into predicted <- data.frame(predict(models.cv, features, na.action = na.exclude)), based on discussions online implying some predictions

Re: [GRASS-user] v.class.mlR Error

2018-06-20 Thread Moritz Lennert
On 20/06/18 13:18, Moritz Lennert wrote: Actually I noticed that your error message concerned the qbwwv voting algorithm which wasn't in the command line you provided. I was just able to reproduce your error using that same voting scheme. I'll have to dig into this a bit deeper to see where the

Re: [GRASS-user] v.class.mlR Error

2018-06-20 Thread Moritz Lennert
On 19/06/18 19:32, Jamille Haarloo wrote: Hi Moritz, Thanx for the advice! Will check it out. From the publications I read, I inferred it was better to use an alternative method (data mining/ object-based) on high resolution imagery than pixel-based. Generally this is true, but when you

Re: [GRASS-user] v.class.mlR Error

2018-06-19 Thread Jamille Haarloo
Hi Moritz, Thanx for the advice! Will check it out. From the publications I read, I inferred it was better to use an alternative method (data mining/ object-based) on high resolution imagery than pixel-based. I also read that texture metrics (e.g. standard deviation of spectral bands) may capture

Re: [GRASS-user] v.class.mlR Error

2018-06-19 Thread Moritz Lennert
P.S. I'm not sure that for the landscape you are working on (mainly forest areas) OBIA is the best approach. You might want to also try a pixel-based approach with i.smap: #create raster training areas v.to.rast Training_Ben5 out=training use=attr attrcol=Ecosystem #create a subgroup with all

Re: [GRASS-user] v.class.mlR Error

2018-06-19 Thread Moritz Lennert
Hi Jamille, Testing with the data you sent me offlist (which BTW was a mapset, not a location. A location contains at least one mapset named PERMANENT which contains the projection info - I just assumed that you are working in UTM Zone 21N, created my own location and copied your mapset into

Re: [GRASS-user] v.class.mlR Error

2018-06-18 Thread Moritz Lennert
Hi Jamille, [Putting the discussion back onto the list.] Le Mon, 18 Jun 2018 16:51:57 -0300, Jamille Haarloo a écrit : > Hello Moritz, > > It looks like I got some results, but I suspect there are still some > issues due to the warning messages. I'm sorry, but I haven't had the time, yet,

Re: [GRASS-user] v.class.mlR Error

2018-06-08 Thread Jamille Haarloo
Hello Moritz, This time I asked a vector to be created with the stats and used this to extract training polygons in QGIS and imported the training map in GRASS. I had to do some interventions regarding the column names to make sure they are the same except for the class. I still get an error, and

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Jamille Haarloo
Hello Moritz, No worries. Thankful these modules are made available for newbies in RS like me and also happy these interactions are possible for learning. Hope to get back soon after some adjustments. Best, Jamille On Thu, Jun 7, 2018 at 10:44 AM, Moritz Lennert < mlenn...@club.worldonline.be>

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Moritz Lennert
Thanks On 07/06/18 15:17, Jamille Haarloo wrote: The first 20+ lines of Stats_Training_Ben_test:

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Jamille Haarloo
The first 20+ lines of Stats_Training_Ben_test:

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Moritz Lennert
On 07/06/18 13:45, Jamille Haarloo wrote: I see. That was one of the big problems then. I knew it used R-resources but wasn't sure the software itself was required. Must have overlooked it in the documentation and other user- topics as I was reading about the module. You are right that it is

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Jamille Haarloo
I see. That was one of the big problems then. I knew it used R-resources but wasn't sure the software itself was required. Must have overlooked it in the documentation and other user- topics as I was reading about the module. Now I have R-3.5, but still get an error: v.class.mlR --overwrite

Re: [GRASS-user] v.class.mlR Error

2018-06-06 Thread Moritz Lennert
On 04/06/18 15:42, Jamille Haarloo wrote: It did not work out from another station, but I tried today from the same computer. I first reinstalled the module. This is the command output: Running R now. Following output is R output. Traceback (most recent call last):   File

Re: [GRASS-user] v.class.mlR Error

2018-06-04 Thread Jamille Haarloo
It did not work out from another station, but I tried today from the same computer. I first reinstalled the module. This is the command output: Running R now. Following output is R output. Traceback (most recent call last): File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri

Re: [GRASS-user] v.class.mlR Error

2018-06-02 Thread Moritz Lennert
Le Fri, 1 Jun 2018 12:15:03 -0700 (MST), Helmut Kudrnovsky a écrit : > >I committed a patch in r72758 which now correctly applies the > >replace() call to all tempfiles created. Please test. > > locally patched the addons script with this v.patch >

Re: [GRASS-user] v.class.mlR Error

2018-06-01 Thread Helmut Kudrnovsky
>I committed a patch in r72758 which now correctly applies the replace() >call to all tempfiles created. Please test. locally patched the addons script with this v.patch , then the script also works with exporting result files incl

Re: [GRASS-user] v.class.mlR Error

2018-06-01 Thread Helmut Kudrnovsky
>For clarity, tomorrow I should install the v.class.mlR again and test it? yes, testing welcome. there is still an issue when results should be exported to several files; this has to be fixed. - best regards Helmut -- Sent from:

Re: [GRASS-user] v.class.mlR Error

2018-06-01 Thread Jamille Haarloo
Hi Moritz and Helmut, Great proactive energy. Highly appreciated! For clarity, tomorrow I should install the v.class.mlR again and test it? Should I also install the needed packages first in R as stated in one of the messages? I will not have access to the same computer this weekend, but I can

Re: [GRASS-user] v.class.mlR Error

2018-06-01 Thread Helmut Kudrnovsky
>I committed a patch in r72758 which now correctly applies the replace() >call to all tempfiles created. Please test. tested now with export to files: --- v.class.mlR -i segments_map=lsat7_segs_stats@user1 training_map=training@user1 train_class_column=class

Re: [GRASS-user] v.class.mlR Error

2018-06-01 Thread Moritz Lennert
On 01/06/18 00:41, Helmut Kudrnovsky wrote: But it's not about the tempfile, it's about calling Rscript and >Windows not being able to find it, or ? looking closer at the report and the used command, the Rscript and other files should be written to files in some folder, right? Rscript is an

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>But it's not about the tempfile, it's about calling Rscript and >Windows not being able to find it, or ? looking closer at the report and the used command, the Rscript and other files should be written to files in some folder, right? >Some paths to set correctly maybe ? What I've seen today

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Moritz Lennert
Am 31. Mai 2018 22:43:58 MESZ schrieb Helmut Kudrnovsky : >>This said, if I understand the OP's message, the issue was in finding >>Rscript in MS Windows. > >looking at the original report: > >--- >[...] >Running R now. Following output is R output. >Traceback (most recent call

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>This said, if I understand the OP's message, the issue was in finding >Rscript in MS Windows. looking at the original report: --- [...] Running R now. Following output is R output. Traceback (most recent call last): File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Moritz Lennert
Le Thu, 31 May 2018 13:14:39 -0700 (MST), Helmut Kudrnovsky a écrit : > Moritz Lennert wrote > > On 31/05/18 14:25, Helmut Kudrnovsky wrote: > >> Helmut Kudrnovsky wrote > Yes, obviously. Sorry for that. > >>> > >>> no problem. > >>> > >>> patch applied: > >>> > >>> - >

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
Moritz Lennert wrote > On 31/05/18 14:25, Helmut Kudrnovsky wrote: >> Helmut Kudrnovsky wrote Yes, obviously. Sorry for that. >>> >>> no problem. >>> >>> patch applied: >>> >>> - >>> v.class.mlR --verbose segments_map=lsat7_segs_stats >>> training_map=training >>>

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Moritz Lennert
On 31/05/18 14:25, Helmut Kudrnovsky wrote: Helmut Kudrnovsky wrote Yes, obviously. Sorry for that. no problem. patch applied: - v.class.mlR --verbose segments_map=lsat7_segs_stats training_map=training train_class_colum=class processes=3 Running R now. Following output is R

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
Helmut Kudrnovsky wrote >>Yes, obviously. Sorry for that. > > no problem. > > patch applied: > > - > v.class.mlR --verbose segments_map=lsat7_segs_stats training_map=training > train_class_colum=class processes=3 > Running R now. Following output is R output. > Loading required

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>Yes, obviously. Sorry for that. no problem. patch applied: - v.class.mlR --verbose segments_map=lsat7_segs_stats training_map=training train_class_colum=class processes=3 Running R now. Following output is R output. Loading required package: caret Loading required package: lattice

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Moritz Lennert
On 31/05/18 13:45, Helmut Kudrnovsky wrote: Could you try with below patch ? unfortunately it seems copy/paste the patch from mail to a diff file doesn't work, maybe caused by some whitespace or similar. could you attach the patch as a file? Yes, obviously. Sorry for that. I'm a bit under

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>Could you try with below patch ? unfortunately it seems copy/paste the patch from mail to a diff file doesn't work, maybe caused by some whitespace or similar. could you attach the patch as a file? - best regards Helmut -- Sent from:

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Moritz Lennert
On 31/05/18 12:16, Helmut Kudrnovsky wrote: In file(file, ifelse(append, "a", "w")) : cannot open file '.gscript_tmp_model_output_2392.csv': Permission denied in the R script: [...] resultsdf$prob_smv <- vote$V2 write.csv(resultsdf, '.gscript_tmp_model_output_2392.csv', row.names=FALSE,

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
Helmut Kudrnovsky wrote >>In file(file, ifelse(append, "a", "w")) : >> cannot open file '.gscript_tmp_model_output_2392.csv': Permission denied > > in the R script: > > [...] > resultsdf$prob_smv <- vote$V2 > write.csv(resultsdf, '.gscript_tmp_model_output_2392.csv', > row.names=FALSE, >

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>In file(file, ifelse(append, "a", "w")) : > cannot open file '.gscript_tmp_model_output_2392.csv': Permission denied in the R script: [...] resultsdf$prob_smv <- vote$V2 write.csv(resultsdf, '.gscript_tmp_model_output_2392.csv', row.names=FALSE, quote=FALSE) write.csv(resultsdf,

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>Here's a complete working example of the entire OBIA chain in the NC >dataset (warning: this is a demo example, not necessarily one of best >practice ;-)) : thanks, testing it here now. https://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.class.mlR/v.class.mlR.py#L278 278

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Moritz Lennert
On 31/05/18 09:52, Helmut Kudrnovsky wrote: My hunch is that the problem is some PATH issues making it >difficult to call R. Maybe some of the Windows gurus out there could help with this ? Is there a working example available for this addon? Here's a complete working example of the

Re: [GRASS-user] v.class.mlR Error

2018-05-31 Thread Helmut Kudrnovsky
>My hunch is that the problem is some PATH issues making it >difficult to >call R. >Maybe some of the Windows gurus out there could help with this ? Is there a working example available for this addon? - best regards Helmut -- Sent from:

Re: [GRASS-user] v.class.mlR Error

2018-05-30 Thread Moritz Lennert
Hi Jamille, On 29/05/18 21:38, Jamille Haarloo wrote: Dear GRASS GIS community, I just started working with Grass to try some object-based analysis. I do not have much experience with programming, but learning bits on the go. The segmentation test with uspo appears to have been ok, but I am

[GRASS-user] v.class.mlR Error

2018-05-29 Thread Jamille Haarloo
Dear GRASS GIS community, I just started working with Grass to try some object-based analysis. I do not have much experience with programming, but learning bits on the go. The segmentation test with uspo appears to have been ok, but I am struggling with the next step. I was suspecting the

Re: [GRASS-user] v.class.mlR error

2017-05-25 Thread James Duffy
I've just tried using a csv as input instead of a vector file and I get the same error, now relating to the path of the csv. Could I suggest also putting in a check / replace line for csv paths if they are entered from a windows machine (especially using the GUI). Thank you. James On 25 May

Re: [GRASS-user] v.class.mlR error

2017-05-25 Thread Moritz Lennert
Le Thu, 25 May 2017 10:54:18 +0100, James Duffy a écrit : > Hi Moritz, > > Your suggested edits to v.class.mlR.py worked (except you had one too > many brackets on the end of each line, so I removed those). Once I > updated and saved that script file, the error

Re: [GRASS-user] v.class.mlR error

2017-05-25 Thread Moritz Lennert
Le Thu, 25 May 2017 00:25:57 +0200, Markus Neteler a écrit : > On Wed, May 24, 2017 at 12:14 PM, James Duffy > wrote: > ... > > v.class.mlR --verbose segments_map=seg_stats_vec@MAP1 > ... > > My GRASS mapset is located in -

Re: [GRASS-user] v.class.mlR error

2017-05-24 Thread Markus Neteler
On Wed, May 24, 2017 at 12:14 PM, James Duffy wrote: ... > v.class.mlR --verbose segments_map=seg_stats_vec@MAP1 ... > My GRASS mapset is located in - C:\Sandbox\RGRASS\TEST\MAP1 > > Given that R takes paths with / rather than \, I think the issue lies at the > start

[GRASS-user] v.class.mlR error

2017-05-24 Thread James Duffy
Hello, When trying to run the following: *v.class.mlR --verbose segments_map=seg_stats_vec@MAP1 training_map=seg_stats_train_val@MAP1 raster_segments_map=seg_optimum_clump@MAP1 classified_map=out train_class_column=class output_class_column=vote output_prob_column=prob folds=5 partitions=10

Re: [GRASS-user] v.class.mlR error

2016-11-14 Thread Moritz Lennert
On 11/11/16 17:53, James Duffy wrote: Thanks for the suggestion. Removing that column worked. Could I suggest adding in a check either pre reading into R or pre-analysis in R to drop any character columns from the modelling but keep them in the attribute table? Well, as I said, I'm not sure

Re: [GRASS-user] v.class.mlR error

2016-11-11 Thread James Duffy
On 11 Nov 2016 11:08 am, "Moritz Lennert" wrote: > > On 11/11/16 11:36, James Duffy wrote: >> >> >> >> On 11 November 2016 at 10:07, Moritz Lennert >> > wrote: >> >> >> >> Le 11 novembre 2016

Re: [GRASS-user] v.class.mlR error

2016-11-11 Thread Moritz Lennert
On 11/11/16 11:36, James Duffy wrote: On 11 November 2016 at 10:07, Moritz Lennert > wrote: Le 11 novembre 2016 10:21:11 GMT+01:00, James Duffy >

Re: [GRASS-user] v.class.mlR error

2016-11-11 Thread James Duffy
On 11 November 2016 at 10:07, Moritz Lennert wrote: > > > Le 11 novembre 2016 10:21:11 GMT+01:00, James Duffy < > james.philip.du...@gmail.com> a écrit : > >On 10 November 2016 at 19:37, Moritz Lennert > > > >wrote: > > > >> > >> > >>

Re: [GRASS-user] v.class.mlR error

2016-11-11 Thread Moritz Lennert
Le 11 novembre 2016 10:21:11 GMT+01:00, James Duffy a écrit : >On 10 November 2016 at 19:37, Moritz Lennert > >wrote: > >> >> >> Le 10 novembre 2016 15:45:59 GMT+01:00, James Duffy < >> james.philip.du...@gmail.com> a écrit : >>

Re: [GRASS-user] v.class.mlR error

2016-11-11 Thread James Duffy
On 10 November 2016 at 19:37, Moritz Lennert wrote: > > > Le 10 novembre 2016 15:45:59 GMT+01:00, James Duffy < > james.philip.du...@gmail.com> a écrit : > >Hello, > > > >I'm trying to run v.class.mlR on a vector map, with a separate vector > >map > >containing my

Re: [GRASS-user] v.class.mlR error

2016-11-10 Thread Moritz Lennert
Le 10 novembre 2016 15:45:59 GMT+01:00, James Duffy a écrit : >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

Re: [GRASS-user] v.class.mlR error

2016-11-10 Thread Markus Neteler
On Thu, Nov 10, 2016 at 3:45 PM, James Duffy 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

[GRASS-user] v.class.mlR error

2016-11-10 Thread James Duffy
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