Space

class compressed_kde.Space

Bases: pybind11_object

Base class for space definitions.

Attributes Summary

default_kernel

Default kernel for this space.

nbw

Number of bandwidth values.

ndim

Number of dimensions.

Methods Summary

distance(x, y)

Retrieve distance for each dimension

from_yaml(string)

Construct space definition from YAML.

issubspace(space)

Test if space is subspace.

load_from_yaml(path)

Load space definition from file.

save_to_yaml(path)

Save space definition to YAML file.

selection(space)

Selection of dimensions that make up subspace.

to_yaml()

Represent space definition as YAML.

Attributes Documentation

default_kernel

Default kernel for this space.

nbw

Number of bandwidth values.

ndim

Number of dimensions.

Methods Documentation

distance(x, y) array

Retrieve distance for each dimension

Parameters
  • x ((ndim,) or (n,ndim) array) – Array of values

  • y ((ndim,) or (n,ndim) array) – Array of values

Returns

distance between x and y

Return type

array

static from_yaml(string) Space

Construct space definition from YAML.

Parameters

string (string) – YAML string space representation

Return type

Space

issubspace(space) bool

Test if space is subspace.

Parameters

space (Space) –

Return type

bool

static load_from_yaml(path) Space

Load space definition from file.

Parameters

path (string) – path to YAML file

Return type

Space

save_to_yaml(path) None

Save space definition to YAML file.

Parameters

path (string) – path tho YAML file

selection(space) [bool]

Selection of dimensions that make up subspace.

Parameters

space (Space) – Proper subspace of this Space

Returns

For each dimension if it is part of the subspace

Return type

[bool]

to_yaml() str

Represent space definition as YAML.

Return type

string