geoml.transform

What distance means before a kernel sees it: the ranges, the anisotropy ellipsoid, and the projections. Chained transforms compose, so a periodic direction and an anisotropic one can sit in the same model.

Isotropic and anisotropic

class geoml.transform.Identity[source]

Bases: _Transform

The identity transformation

class geoml.transform.Isotropic(r=1.0)[source]

Bases: _Transform

Isotropic range

__init__(r=1.0)[source]

Initializer for Isotropic.

Parameters:

r (double) – The range. Must be positive.

set_limits(data)[source]
class geoml.transform.Anisotropy2D(maxrange=1.0, minrange_fct=1, azimuth=0)[source]

Bases: _Ellipsoidal

Anisotropy in two dimensions

__init__(maxrange=1.0, minrange_fct=1, azimuth=0)[source]

Builds an anisotropy matrix, to be multiplied by a coordinate matrix from the right.

Parameters:
  • azimuth (double) – Defined clockwise from north, and is aligned with maxrange.

  • maxrange (double) – The maximum range. Must be positive.

  • minrange_fct (double) – matrix multiple of maxrange, contained in the [0,1) interval.

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy2DMath(range_x=1.0, range_y=1.0, theta=0)[source]

Bases: _Ellipsoidal

Anisotropy in two dimensions

__init__(range_x=1.0, range_y=1.0, theta=0)[source]

Anisotropy matrix in mathematical parametrization.

Parameters:
  • range_x (double) – The ellipsoid semi-length in each direction. Must be positive.

  • range_y (double) – The ellipsoid semi-length in each direction. Must be positive.

  • theta (double) – The rotation angle in degrees.

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy2DDynamic(n_directions=9)[source]

Bases: _Ellipsoidal

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy3D(maxrange=1.0, midrange_fct=1, minrange_fct=1, azimuth=0, dip=0, rake=0)[source]

Bases: _Ellipsoidal

Anisotropy in two dimensions

__init__(maxrange=1.0, midrange_fct=1, minrange_fct=1, azimuth=0, dip=0, rake=0)[source]

Builds an anisotropy matrix, to be multiplied by a coordinate matrix from the right.

Parameters:
  • maxrange (double) – The maximum range. Must be positive.

  • midrange_fct (double) – A multiple of maxrange, contained in the [0,1) interval.

  • minrange_fct (double) – A multiple of midrange, contained in the [0,1) interval.

  • azimuth (double) – Defined clockwise from north, and is aligned with maxrange.

  • dip (double) – Dip angle, from 0 to 90 degrees.

  • rake (double) – Rake angle, from -90 to 90 degrees.

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy3DMath(range_x=1.0, range_y=1.0, range_z=1.0, theta_x=0, theta_y=0, theta_z=0)[source]

Bases: _Ellipsoidal

Anisotropy in two dimensions

__init__(range_x=1.0, range_y=1.0, range_z=1.0, theta_x=0, theta_y=0, theta_z=0)[source]

Anisotropy matrix in mathematical parametrization.

Parameters:
  • range_x (double) – The ellipsoid semi-length in each direction. Must be positive.

  • range_y (double) – The ellipsoid semi-length in each direction. Must be positive.

  • range_z (double) – The ellipsoid semi-length in each direction. Must be positive.

  • theta_x (double) – The rotation angles in degrees.

  • theta_y (double) – The rotation angles in degrees.

  • theta_z (double) – The rotation angles in degrees.

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy3DDynamic(n_directions_per_axis=3)[source]

Bases: _Ellipsoidal

refresh()[source]
set_limits(data)[source]
class geoml.transform.ProjectionTo1D(n_dim)[source]

Bases: _Transform

Projection of high-dimensional data to a line.

__init__(n_dim)[source]

Initializer for ProjectionTo1D.

Parameters:

n_dim (int) – The number of dimensions. May be greater than 3 when used in conjunction with a space-expanding transform.

class geoml.transform.AnisotropyARD(n_dim)[source]

Bases: _Transform

Automatic Relevance Detection

__init__(n_dim)[source]

Initializer for Isotropic.

Parameters:

n_dim (int) – The number of dimensions.

set_limits(data)[source]
class geoml.transform.ChainedTransform(*transforms)[source]

Bases: _Transform

Chained transform.

This object allows multiple transforms to be called sequentially. Useful for complex transformations.

__init__(*transforms)[source]

Chained transform.

Parameters:

transforms – Transformes to chain.

set_limits(data)[source]
class geoml.transform.SelectVariables(index)[source]

Bases: _Transform

Variable selection.

Returns the specified columns of the input, discarding the others.

__init__(index)[source]

Variable selection.

Parameters:

index (list) – Indices of variables to select.

class geoml.transform.NormalizeWithBoundingBox(box)[source]

Bases: _Transform

Normalization with a bounding box.

Uses a BoundingBox object as guide to normalize the data. All columns will be contained in the [-3, 3] interval.

__init__(box)[source]

Normalization with a bounding box.

Parameters:

box – The bounding box to use as reference for normalization.

class geoml.transform.Periodic[source]

Bases: _Transform

Periodic transform.

Returns sines and cosines doubling the number of columns in the data. The periods can be specified by chaining an Anisotropy* transform with this one.

class geoml.transform.Concatenate(*transforms)[source]

Bases: ChainedTransform

Concatenation of transforms.

Consolidates a list of inputs into a single one.

set_limits(data)[source]
class geoml.transform.RandomProjections(n_dim, n_directions, seed=1234)[source]

Bases: _Transform

class geoml.transform.BellFault2D(start, end)[source]

Bases: _Transform

Fault simulation.

__init__(start, end)[source]

Fault simulation.

Creates a discontinuity in space, returning an additional coordinate that can be used to artificially repel points on opposite sides of a line.

Parameters:
  • start (array-like) – Starting point of fault.

  • end (array-like) – Endpoint of fault.

static kernelize(x)[source]

Angles given rather than fitted

The Math and Dynamic variants take the ellipsoid’s orientation from somewhere other than training — a structural measurement, or another node.

class geoml.transform.Anisotropy2DMath(range_x=1.0, range_y=1.0, theta=0)[source]

Bases: _Ellipsoidal

Anisotropy in two dimensions

__init__(range_x=1.0, range_y=1.0, theta=0)[source]

Anisotropy matrix in mathematical parametrization.

Parameters:
  • range_x (double) – The ellipsoid semi-length in each direction. Must be positive.

  • range_y (double) – The ellipsoid semi-length in each direction. Must be positive.

  • theta (double) – The rotation angle in degrees.

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy2DDynamic(n_directions=9)[source]

Bases: _Ellipsoidal

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy3DMath(range_x=1.0, range_y=1.0, range_z=1.0, theta_x=0, theta_y=0, theta_z=0)[source]

Bases: _Ellipsoidal

Anisotropy in two dimensions

__init__(range_x=1.0, range_y=1.0, range_z=1.0, theta_x=0, theta_y=0, theta_z=0)[source]

Anisotropy matrix in mathematical parametrization.

Parameters:
  • range_x (double) – The ellipsoid semi-length in each direction. Must be positive.

  • range_y (double) – The ellipsoid semi-length in each direction. Must be positive.

  • range_z (double) – The ellipsoid semi-length in each direction. Must be positive.

  • theta_x (double) – The rotation angles in degrees.

  • theta_y (double) – The rotation angles in degrees.

  • theta_z (double) – The rotation angles in degrees.

refresh()[source]
set_limits(data)[source]
class geoml.transform.Anisotropy3DDynamic(n_directions_per_axis=3)[source]

Bases: _Ellipsoidal

refresh()[source]
set_limits(data)[source]

Composing and reshaping

class geoml.transform.ChainedTransform(*transforms)[source]

Bases: _Transform

Chained transform.

This object allows multiple transforms to be called sequentially. Useful for complex transformations.

__init__(*transforms)[source]

Chained transform.

Parameters:

transforms – Transformes to chain.

set_limits(data)[source]
class geoml.transform.Concatenate(*transforms)[source]

Bases: ChainedTransform

Concatenation of transforms.

Consolidates a list of inputs into a single one.

set_limits(data)[source]
class geoml.transform.SelectVariables(index)[source]

Bases: _Transform

Variable selection.

Returns the specified columns of the input, discarding the others.

__init__(index)[source]

Variable selection.

Parameters:

index (list) – Indices of variables to select.

class geoml.transform.ProjectionTo1D(n_dim)[source]

Bases: _Transform

Projection of high-dimensional data to a line.

__init__(n_dim)[source]

Initializer for ProjectionTo1D.

Parameters:

n_dim (int) – The number of dimensions. May be greater than 3 when used in conjunction with a space-expanding transform.

class geoml.transform.RandomProjections(n_dim, n_directions, seed=1234)[source]

Bases: _Transform

class geoml.transform.NormalizeWithBoundingBox(box)[source]

Bases: _Transform

Normalization with a bounding box.

Uses a BoundingBox object as guide to normalize the data. All columns will be contained in the [-3, 3] interval.

__init__(box)[source]

Normalization with a bounding box.

Parameters:

box – The bounding box to use as reference for normalization.

class geoml.transform.Periodic[source]

Bases: _Transform

Periodic transform.

Returns sines and cosines doubling the number of columns in the data. The periods can be specified by chaining an Anisotropy* transform with this one.

class geoml.transform.BellFault2D(start, end)[source]

Bases: _Transform

Fault simulation.

__init__(start, end)[source]

Fault simulation.

Creates a discontinuity in space, returning an additional coordinate that can be used to artificially repel points on opposite sides of a line.

Parameters:
  • start (array-like) – Starting point of fault.

  • end (array-like) – Endpoint of fault.

static kernelize(x)[source]