persim.PersImage¶
- class persim.PersImage(*args, **kwargs)[source]¶
Initialize a persistence image generator.
- Parameters:
pixels (pair of ints like (int, int)) – Tuple representing number of pixels in return image along x and y axis.
spread (float) – Standard deviation of gaussian kernel.
specs (dict) –
Parameters for shape of image with respect to diagram domain. This is used if you would like images to have a particular range. Shaped like:
{ "maxBD": float, "minBD": float }
kernel_type (string or ...) – TODO: Implement this feature. Determine which type of kernel used in the convolution, or pass in custom kernel. Currently only implements Gaussian.
weighting_type (string or ...) – TODO: Implement this feature. Determine which type of weighting function used, or pass in custom weighting function. Currently only implements linear weighting.
Deprecated since version 0.1.5: Replaced with the class
persim.PersistenceImager
.- __init__(pixels=(20, 20), spread=None, specs=None, kernel_type='gaussian', weighting_type='linear', verbose=True)[source]¶
Methods
__init__
([pixels, spread, specs, ...])fit_transform
(X[, y])Fit to data, then transform it.
kernel
([spread])This will return whatever kind of kernel we want to use.
set_output
(*[, transform])Set output container.
show
(imgs[, ax])Visualize the persistence image
to_landscape
(diagram)Convert a diagram to a landscape (b,d) -> (b, d-b)
transform
(diagrams)Convert diagram or list of diagrams to a persistence image.
weighting
([landscape])Define a weighting function, for stability results to hold, the function must be 0 at y=0.