Cannot use new algorithms in model designer

Issue #929 resolved
Former user created an issue

EnMAP-Box version: 3.9 and 3.10 QGIS version: 3.22.3 Compiled against Qt: 5.15.2 Compiled against GDAL/OGR: 3.4.1 OS version: Windows 11 (QGIS falsely says 'Windows 10 Version 2009') Active python plugins:

enmapboxplugin 3.10.20220118T090426.develop Serval 3.10.2 db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.5 processing 2.12.99 sagaprovider 2.12.99

I've been using a 'develop' version of 3.8 for a few months, which did everything I needed albeit slowly at times. I've just tried upgrading to 3.9 and many of the new algorithms (in the asterisked categories) will not open in the model designer, either by double clicking or dragging, e.g. all of the spatial convolution algorithms. I tested with 3.10x and have the same issue.

Many thanks otherwise for a very useful plugin!

Comments (19)

  1. Andreas Janz

    Yes, that is a known issue and will be fixed in v3.10.

    It affects all algorithms that use the custom code editor widget:

  2. Former user Account Deleted

    Thanks Andreas, is there a quick fix I can do to disable this widget or do I need to wait until ~end of March release?

  3. Andreas Janz

    No, not in the GUI, that would require code changes. What I could do for you is to increase the issue priority, so that this issue is fixed first.

    BTW - I saw that you are using a dev version (3.10.20220118T090426.develop). Did you build that on your own?

  4. Former user Account Deleted

    Okay that’d great thanks! I downloaded the dev version here a couple of days ago.

  5. Andreas Janz

    Ah, alright, you found the secret dev-version site 🙂.

    Note that those versions are not heavily testet and may contain loosely implemented new features.

    If you like I can prepare one of those dev versions after your issue is fixed.

  6. Former user Account Deleted

    Haha yes, and I’m currently on a dev version of 3.8 as I was able to get xgboost and lgbm regression working with some modifications to core.py. Hopefully can get these going on 3.10dev as well once model designer is working fine. I’m getting some very nice results compared to random forest by the way, I recommend as alternate regression options for next release!

  7. Andreas Janz

    I recommend as alternate regression options for next release!

    Is xgboost and lgbm regression part of Scikit-Learn?

  8. Former user Account Deleted

    Yes, though I’m not sure if that’s why they’re working (I’m quite new to Python). Attached screenshot of added lines in core.py in directory:

    C:\Users\J\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages\hubflow

    I then run the random forest regressor algorithm and replace the code with:

    import xgboost
    estimator = xgboost.XGBRegressor()

    or

    import lightgbm
    estimator = lightgbm.LGBMRegressor()

    Also need to pip install these in osgeo4w shell before running.

  9. Andreas Janz

    Alright, yes, those implementations use the Scikit-Learn interface, good job.

    Note that I will overhaul the regression algorithms soon and the hubflow module won’t be used anymore.

    Just contact me if you have problems afterwards with your regressors.

    If the xgboost, lightgbm and catboost packages are easily installable via pip on all systems. We could support those regressors by default.

  10. Former user Account Deleted

    Alright, I can test it when the time comes, and that’d be great if you support them by default. As far as I know it would be the first implementation of these regressors in a GIS software. Both give me double the r2 values compared to random forest when predicting biomass.

  11. Former user Account Deleted

    Thanks Andreas, works great so far, and the 2D convolution is much faster than the previous version. Are you thinking of supporting the new regression models (XGBoost, LGBM, CatBoost) in 3.10 or later in the year?

  12. Log in to comment