base
base
Base class for dimmer package.
Classes
| Name | Description |
|---|---|
| DimmerBase | Base class for local homology stratification determination. |
DimmerBase
base.DimmerBase(
radii=None,
neighbors=None,
collapse_edges=False,
n_jobs=1,
threshold=None,
outlier_label=-1,
tree_type=None,
)Base class for local homology stratification determination.
This class should not be called directly, but rather GAD or Intersecter.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| radii | tuple[float, float] | None | The radii of the annular neighborhood at every point. Only one of radii or neighbors should be specified. |
None |
| neighbors | tuple[int, int] | None | The number of neighbors of the annular neighborhood at every point. Only one of radii or neighbors should be specified. |
None |
| collapse_edges | bool | None | The flag determining whether to collapse edges (see giotto-tda’s documentation on VietorisRipsPersistence). The default behavior is False if max_dim < 4; otherwise it is True. |
False |
| n_jobs | int | The number of processors to use. | 1 |
| threshold | float | str | None | The real parameter at which persistent features are counted. If "average" is passed, then the average annular thickness will be used for points. |
None |
| outlier_label | float | The dimension to assign to any outliers. | -1 |
| tree_type | str | None | The style of tree to use for nearest neighbors computation. Can be anything acceptable by sklearn.neighbors.RadiusNeighborsTransformer: {"auto", "ball_tree", "kd_tree", "brute"}, default is "auto" . |
None |
Note: It seems like collapse_edges should be True if the homological dimension is “large”, but what this means in practice is still not clear. This could also cause slow down if a space has strata of many different dimensions.
Methods
| Name | Description |
|---|---|
| predict_dw | Compute GAD classification of each point in a specified degree. |
predict_dw
base.DimmerBase.predict_dw(
X,
y=None,
hom_deg=1,
point_indices=None,
nbhd_dict=None,
)Compute GAD classification of each point in a specified degree.
This method computes the local persistent homology of a point cloud in a specified homological degree and counts the points in its persistence diagram. The local neighborhood is specified by self.radii or self.neighbors. The persistent homology of each neighborhood is computed in degree hom_deg. The points in the persistence diagram of lifetime greater than outer_rad - inner_rad are counted. Boundary, manifold, and stratification points are those with 0, 1, and greater than 1, respectively, such points in their diagram when hom_deg is positive. Because of reduced homology, both boundary and manifold points have 0 such points in their persistence diagrams when hom_deg is zero.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| X | np.ndarray[tuple[int, int], np.dtype[np.float64]] | Array containing n_samples points within ambient Euclidean space of dimension n_features. |
required |
| y | np.ndarray[tuple[int], np.dtype[np.float64]] | None | Ignored. | None |
| hom_deg | int | The homological degree to compute. | 1 |
| point_indices | np.ndarray[tuple[int], np.dtype[np.int64]] | None | Indices of X at which to compute the local cohomology. |
None |
| nbhd_dict | dict[int, np.ndarray[tuple[int], np.dtype[np.int64]]] | None | Dictionary containing the annular neighborhood each key, indexed on self.subset. | None |
Returns
| Name | Type | Description |
|---|---|---|
| strat_points | list[int] | list The indices of X determined to be stratification points. |
| boundary_points | list[int] | list The indices of X determined to be boundary points. |
| manifold_points | list[int] | list The indices of X determined to be manifold points. |