Datacube does not know 'fit_class_random_forest'

In the UC9 notebook (dynamic land cover mapping) when attempting to run fit_class_random_forest() I get the error “AttributeError: ‘DataCube’ object has no attribute ‘fit_class_random_forest’”

all variables seem defined at this point and also the datacube object exists.
Is this an issue with outdated client library or similar?

fit_class_random_forest was added in openeo python client version 0.10.0

what is the version you are using?

import openeo

Ah thanks…

It’s version:

updated the client and will retry
pip install openeo --upgrade

BTW, we should ensure that the client libraries in the jupyterlab is always up to date, by default (we discussed this also at SRR3)…

Doing auto-updates is tricky business I’m afraid

A simpler and less intrusive solution is to show a warning when doing import openeo and it can be detected that a newer version is available. Vote here: warn about newer version of python client · Issue #296 · Open-EO/openeo-python-client · GitHub

Issue#296 - this would be very useful I think!

Follow up issue here: after updating the clint lib, the fit_rf… process is known, but now the parameter "training"is unknown, see screenshot below:

TypeError: fit_class_random_forest() got an unexpected keyword argument ‘training’

The python client documentation still lists this attribute at one point:

But in another it does not show this attribute anymore:

good catch, that bit of documentation is indeed outdated, the training argument was indeed dropped from fit_class_random_forest. Should be fixed by now

1 Like