Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First attempt at fix of #438 * Fix y-axis in `PersistenceImage` plots, extending #453 * Represent multiplicity of persistence pairs in hovertext in `plot_diagram` * Change reflect mode of `gaussian_filter` to "constant" from "reflect" Affects `HeatKernel` and `PersistenceImage` * Fix `PersistenceLandscape` plot method - Only the figure corresponding to the first seen homology dimension was returned - Output is now a figure with subplots, a main title, and one subtitle per plot (homology dimension) * Improve tests for plot methods in gtda.diagrams.representations Cover use of `plotly_params` * Minor docstring linting * Miscellaneous docstring improvements in gtda/diagrams * Fix validation dictionary for `metric_params` in the case of `PersistenceImage` * Change default value of `order` in Amplitude, from 2. to None (vector features) * Change meaning of default None for `weight_function` in `PersistenceImage` - ``None`` corresponding the identity means that there really is a non-trivial weighting in that case. Semantically, this does not seem correct ("None" should mean no weighting at all) * Improve code style and clarity in plot methods in gtda.diagrams.representations * Refactor gtda/diagrams/_metrics.py to fix several bugs - Change computation of heat/persistence image distances and amplitudes to yield the continuum limit when `n_bins` tends to infinity. - Make `sigma` in persistence-image-- and heat-kernel--based representations/distances/amplitudes measured in the same units as the filtration parameter (not in pixels), thus decoupling its effect from the effect of `n_bins`. Also change the default value in PairwiseDistance, Amplitude, HeatKernel and PersistenceImage from 1. to 0.1. - Remove trivial points from diagrams before creating a sampled image in `heats` and `persistence_images`. This ensures in particular that the trivial points really give no contribution regardless of the weight function used for persistence images. - Finish fixing #438 and similar issues with PairwiseDistance when the metric is persistence-image--based. - Ensure `silhouettes` does not create NaNs when a subdiagram is trivial. - Change default value of `power` in `silhouette_amplitudes` and `silhouette_distances` to 1., to agree with Amplitude and PairwiseDistance docs. - Fix use of np.array_equal in `persistence_image_distances` and `heat_distances` -- so far the boolean check for equal inputs always failed due to the in-place modifications of `diagrams_1`. - No longer store weights in `effective_metric_params_` attribute of PairwiseDistance and Amplitude when the metric is persistence-image--based. - Remove _heat from gtda.diagrams._metrics. - Remove identity from gtda.diagrams._utils and make default `weight_function` kwargs equal to np.ones_like everywhere to agree with default in `PersistenceImage`. - Other style improvements (variable names, linting) * Fix trace name when homology dimension is np.inf in `BettiCurve` and `Silhouette` * Adapt `test_all_pts_the_same` to new behaviour of `heats_` in gtda.diagrams._metrics * Improve test coverage of `Amplitude` and `PairwiseDistance` - Make sure silhouettes and persistence images are covered throughout - Cover `order` parameter throughout * Add test of zero `weight_function` for `PersistenceImage` * Make behaviour of `Scaler.fit` when the metric is persistence image the same as `Amplitude` Accordingly add more combinations of metrics and metric_params in tests for Scaler * Delete never-used `_matrix_wrapper` and `_arrays_wrapper` functions * Remove `_pad` from gtda.diagrams._utils as it is never used * Make `copy=True` in calls to check_diagrams in Scaler.transform and Scaler.inverse_transform * Make `homology_dimensions_` attributes tuples instead of lists, with integers when possible * Improve code style * Hard-code zero array outputs by `heats` and `persistence_images` when step sizes are zero * Add `homology_dimensions` kwarg to `_bin` Achieves beautification of self._samplings and self.samplings_ (ints shown instead of floats) in several transformers (and saves some computation) * Adapt choices of `min_values`, `max_values` and `sigma` in hypothesis-based tests New meaning of sigma led to overflow issues in existing tests. * Make all homology dimensions equal in `test_hk_big_sigma` Also extend this test to `PersistenceImage`, and rename it accordingly * Cover use of `plotly_params` kwarg in diagram preprocessing classes plot methods * Extract some common logic from plot methods in gtda.diagrams.representations * Silence expected warnings from image transformers in test_common * Implement @wreise's suggestion to abstract away sorting and integer conversion of fit hom dims * Add tests for `Amplitude` and `PairwiseDistance` to check that a zero weight function yields identically zero amplitudes/distances. * Refactor `_subdiagrams` to throw informative errors on unfulfilled input properties
- Loading branch information