Skip to content

Repository files navigation

Spatial modeling using machine learning concepts

tests docs

📖 Documentation — the API reference and the design records, published with each release.

Geoscientific data is becoming increasingly larger and more complex. Multiple variables, structural constraints, etc. are becoming the norm rather than the exception.

Conventional modelling approaches are very labour-intensive, subjective, and hard to reproduce. CAD-drawn orebodies, variograms, pre- and post-processing steps can result in workflows so complicated that even professionals can become lost within their own work. geoML is being designed to simplify geomodelling and empower the user with advanced machine larning tools that respect geology.

This package contains machine learning models specialized in spatial interpolation and smoothing with calibrated confidence intervals. Current functionality includes:

  • Gaussian process modeling in 1D, 2D, and 3D, with anisotropy ellipsoid;
  • Variational Gaussian process for classification and multivariate modeling;
  • Support for compositional data;
  • Support for directional data (structural geology measurements, scalar field gradients, etc.);
  • Support for implicit modelling with boundary data (points lying in the boundary between two rock types);
  • Deep learning for non-stationary modeling;
  • Exports results to PyVista format;
  • Back-end powered by TensorFlow.

A worked example

Walker Lake, end to end: look at the data, build a model, train it, and map the answer with its uncertainty beside it.

import geoml

geoml.set_seed(1234)
walker, grid = geoml.datasets.walker()

# 100 inducing points, a spherical covariance, and a warping that keeps the
# predictions positive and takes care of the skew
inducing = geoml.data.inducing.from_kmeans(walker, 100, seed=0)
gp = geoml.latent.BasicGP(
    geoml.latent.BasicInput(inducing,
                            transform=geoml.transform.Isotropic(50)),
    size=1, kernel=geoml.kernels.Spherical())
warping = geoml.warping.ChainedWarping(
    geoml.warping.Softplus(1), geoml.warping.ZScore(1))

model = geoml.models.VGPNetwork(
    walker, "V", geoml.likelihood.Gaussian(warping), gp)
model.train_full(max_iter=300)

model.predict(grid, n_sim=50)
grid.variables["V"].reset_quantiles([0.05, 0.5, 0.95])

geoml.plots.Explorer(grid, continuous="V").scene()

No experimental variogram is fitted (the model estimates its own), no normal-score tables are built (the warping is the transform, trained), and no search neighbourhood is tuned (the inducing points are the sparsity).

Installation

pip install git+https://github.com/italo-goncalves/geoML

Python 3.10 or newer. The dependencies — NumPy, SciPy, pandas, scikit-learn, scikit-image, TensorFlow, TensorFlow Probability, Zarr, xarray, dask, PyVista, VTK, Matplotlib, Plotly, ezdxf and openpyxl — are declared with their lower bounds in pyproject.toml and installed with the package. pip install -e .[dev] adds what the documentation and the type check need.

Examples

The following notebooks demonstrate the capabilities of the package (if one of them seems broken, it is probably going through an update).

Learning materials

Using geoML with Claude Code

This repository ships a Claude Code plugin carrying the package's own working knowledge: the object model, the module layout, the modelling workflow, and the notebook conventions the examples above follow. It means Claude writes geoML code the way geoML is meant to be written, rather than guessing an API from its name.

Install it from within Claude Code:

/plugin marketplace add italo-goncalves/geoML
/plugin install geoml@geoml

Claude then loads it by itself whenever a task involves geoML, or you can invoke it directly with /geoml:geo-ml. It costs about 200 tokens per session until it is used.

References

External links

Licensing

geoML is available under a dual license model:

Open-Source License (GPL v3)

geoML is free and open-source software licensed under the GNU General Public License v3.0. Under this license, you may use, study, modify, and distribute geoML at no cost, provided that any software incorporating geoML is also distributed under the GPL v3. This applies to academic research, personal projects, and any open-source work.

Commercial License

If you wish to integrate geoML into a proprietary or closed-source product — such as commercial geostatistical software, consulting workflows, or any application whose source code will not be made publicly available under the GPL — a separate commercial license is required. The commercial license grants you the right to use geoML without the copyleft obligations of the GPL. Typical use cases for a commercial license include:

  • Embedding geoML in commercial mining, oil & gas, or environmental software
  • Using geoML in paid consulting deliverables distributed as closed-source tools
  • Integrating geoML into a SaaS platform

To inquire about commercial licensing terms and pricing, please fill this contact form.

About

Spatial modeling using machine learning concepts

Topics

Resources

Stars

97 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages