r-spatial / rgee

Google Earth Engine for R
https://r-spatial.github.io/rgee/
Other
692 stars 148 forks source link

smileRandomForest() is unavailable? #340

Closed diegoseba88 closed 1 year ago

diegoseba88 commented 1 year ago

Description ### What I did ### Outcome

I was trying to perform a randomForest supervised classification on a 4-band Sentinel 2 Image. Using randomForest() triggers an error depicting the function has been deprecated. Using the updated smileRandomForest() triggers the following error message:

trained <- ee$Classifier$smileRandomForest()$train(training, "class", bands) Error in py_call_impl(callable, dots$args, dots$keywords) : AttributeError: 'ApiFunction' object has no attribute 'name'

Detailed traceback: File "C:\Users\aquin\AppData\Local\R-MINI~1\envs\rgee\lib\site-packages\ee\apifunction.py", line 205, in return lambda *args, *kwargs: func.call(args, **kwargs) # pylint: disable=unnecessary-lambda File "C:\Users\aquin\AppData\Local\R-MINI~1\envs\rgee\lib\site-packages\ee\function.py", line 67, in call return self.apply(self.nameArgs(args, kwargs)) File "C:\Users\aquin\AppData\Local\R-MINI~1\envs\rgee\lib\site-packages\ee\function.py", line 80, in apply result = computedobject.ComputedObject(self, self.promoteArgs(named_args)) File "C:\Users\aquin\AppData\Local\R-MINI~1\envs\rgee\lib\site-packages\ee\function.py", line 111, in promoteArgs % (name, self.name))



Thanks!