[GRASS-user] bayesian belief network analysis (was r.binfer)

Stefan Blumentrath Stefan.Blumentrath at nina.no
Mon May 31 23:32:07 PDT 2021


Hi Donovan,

If you know how to put together some Python code, you could have a look at PyMC3: https://docs.pymc.io/
That can be basically used like scikit-learn in r.learn.ml.

You load GRASS data into a numpy array with e.g. r.what, r.stats, v.db.select, or using pygrass (e.g. reading entire raster maps with raster2numpy) and create training and test data that that you feed into a model...

There have been some efforts to move to TensorFlow as backend in PyMC, but that seems to be abandoned and PyMC devs are now continuing with JAX (https://pymc-devs.medium.com/the-future-of-pymc3-or-theano-is-dead-long-live-theano-d8005f8a0e9b).

Cheers,
Stefan


From: grass-user <grass-user-bounces at lists.osgeo.org> On Behalf Of Saulteau Don
Sent: lørdag 29. mai 2021 21:13
To: GRASS user list <grass-user at lists.osgeo.org>
Subject: Re: [GRASS-user] bayesian belief network analysis (was r.binfer)

OK thanks! I'll see if I can find an old grass executable, compile in a VM with r.binfer in it or fallback to QGIS and OpenBugs. I thought I'd poke around cause I prefer analysis in GRASS over any other platform out there :)

I've started to assist indigenous nations with assertion and protection/preservation of their rights with GIS. Some of these analytical methods like fuzzy/boolean patch modelling, weighted overlays, bayesian belief networks (BBN) allow them to translate their oral history and ecological knowledge into tools that help them engage effectively and meaningfully with other parties such as other nations/governments and industries who have expressed interest in their lands and resources.

I SO wish I could code or even knew what to ask for in procurement for these things cause I would.

Been a lowly user, bug reporter, package maintainer and crowd funder. Continuing to find ways to feed back and wholly contribute into these FOSS communities any way I can.




Donovan
On Sat., May 29, 2021, 03:12 Markus Neteler, <neteler at osgeo.org<mailto:neteler at osgeo.org>> wrote:
On Sat, May 29, 2021 at 4:20 AM Donovan Cameron <sault.don at gmail.com<mailto:sault.don at gmail.com>> wrote:
>
> Evening,
>
> I'm attempting to analyze a set of layers (slope, aspect, vegetation,
> soil, etc) that have been coded/scored based on expert opinion to output
> a probability/suitability map.
>
> I'm looking to apply a bayesian belief network [1] and i've got the
> raster layers ready for the inputs and coded like seen in this figure [2].
>
> There was a grass4 module called r.binfer [3] that did this and I can't
> seem to find it with GRASS 78 - deprecated or replaced?

The latest code trace which I could find is this one:

GRASS GIS 5.5:
https://github.com/OSGeo/grass-legacy/tree/releasebranch_5_5/src/raster/r.binfer<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOSGeo%2Fgrass-legacy%2Ftree%2Freleasebranch_5_5%2Fsrc%2Fraster%2Fr.binfer&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164541148%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Ce57HPAcVIfTx6w%2BMJV5wXQahQxz90U8FGREdvXxed8%3D&reserved=0>

I do not recall why the module has been abandoned in GRASS GIS 6
(maybe no particular reason and a volunteer could update it...?).

Another option might be to rely on R and use "rgrass7" to exchange
data between GRASS GIS and R.

Best,
Markus

> Searches lead me to either r.regression.multi [4] or r.learn.ml<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fr.learn.ml%2F&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164551146%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=To5Tf1A%2FYtiovnKTSsxJAziO0rxO2KCLtlTIdxH3jYc%3D&reserved=0> [5] but
> i'm not sure where to start with these to get a BBN processed thru them.
>
>
> SaultDon
>
> [1] https://www.gislounge.com/gis-bayesian-belief-networks/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.gislounge.com%2Fgis-bayesian-belief-networks%2F&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164551146%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=LDXIFRyMkk2v9bFEdClj182JKgOJaL5NGzdgH64e0K8%3D&reserved=0>
> [2]
> https://www.sciencedirect.com/science/article/pii/S0169204618307497#f0010<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS0169204618307497%23f0010&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164561143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2Bwhn8WEk5K9Rkulzj3XY7cv8T62cN5o53pLzQLOIMWE%3D&reserved=0>
> [3] https://grass.osgeo.org/grass43/manuals/html_grass4/html/r.binfer.html<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass.osgeo.org%2Fgrass43%2Fmanuals%2Fhtml_grass4%2Fhtml%2Fr.binfer.html&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164561143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=GfsK6Icym2ouQxxwSHorsSfvl4gVbNJz%2FyzbZ%2F51AUk%3D&reserved=0>
> [4] https://grass.osgeo.org/grass78/manuals/r.regression.multi.html<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass.osgeo.org%2Fgrass78%2Fmanuals%2Fr.regression.multi.html&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164571135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Vzy3PfbGUlVKcBmJ%2F9atqiv1fZWxyx6WxI03vXIgS5c%3D&reserved=0>
> [5] https://grass.osgeo.org/grass78/manuals/addons/r.learn.ml.html<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass.osgeo.org%2Fgrass78%2Fmanuals%2Faddons%2Fr.learn.ml.html&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164571135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=9aI5alkZ%2Fcs59Ryy6YklHMmPxT%2F2Hf%2BE0neSIugHUoI%3D&reserved=0>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164581126%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=juX5bHMUHy5A1Wcq%2BFCBUvjMjcVqlASA9mxFfotvhJ0%3D&reserved=0>



--
Markus Neteler, PhD
https://www.mundialis.de<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mundialis.de%2F&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164581126%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=mkJQDoDrlYx5ci7TV0cdg%2F8ip0GOl93lJJ3z51Sp1%2Fo%3D&reserved=0> - free data with free software
https://grass.osgeo.org<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass.osgeo.org%2F&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164581126%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=lG3h9MEVGZ6HqgEJpfTcZlLd99Mt9Ha67g84EYkBOUI%3D&reserved=0>
https://courses.neteler.org/blog<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcourses.neteler.org%2Fblog&data=04%7C01%7C%7C7eb8abac8e6a4de10cda08d922d5c7dd%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637579124164591122%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=e05DVxi1nSthQm3%2BYxuZ23IG3dOSSY86fj6Pjbi0v4o%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210601/c65dae35/attachment-0001.html>


More information about the grass-user mailing list