On 26-03-16 18:42, Paulo van Breugel wrote:

*2nd try - input random sample of 100 points, 1 (12) and 0 (88), with b flag* r.randomforest -b igroup=predictors@SampleSize roi=test2 output=test2_output ntrees=500 mfeatures=-1 minsplit=2 randst=1 lines=100
Group <predictors> references the following raster maps:
Traceback (most recent call last):
  File "/home/paulo/.grass7/addons/scripts/r.randomforest",
line 335, in <module>
    main()
  File "/home/paulo/.grass7/addons/scripts/r.randomforest",
line 243, in main
    class_weight = "balanced", max_features = mfeatures,
min_samples_split = minsplit, random_state = randst)
TypeError: __init__() got an unexpected keyword argument
'class_weight'
Removing raster <tmp_jNyNcqZa>


Hi Steven,

I finally found out the above-mentioned problem. I was using an old version of the skikit package. In first instance I failed to realize this because I had actually upgraded it using:

sudo pip install --upgrade scikit-learn

Just in case others encounter the same problem, the problem was that some point I must have installed it through the Synaps package manager (I am on Ubuntu), which is a old version. Apparently the version installed this way overrides the version installed via pip. Removing the package in Synaps package manager (one can of course use apt-get remove) resolved it.

Cheers,

Paulo


_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to