locan.analysis.pair_distances.PairDistances¶
- class locan.analysis.pair_distances.PairDistances(meta=None)[source]¶
Bases:
_AnalysisCompute the pairwise distances within data or the pairwise distances between data and other_data.
The algorithm relies on sklearn.metrics.pairwise.
- Parameters:
meta (locan.analysis.metadata_analysis_pb2.AMetadata) – Metadata about the current analysis routine.
- Variables:
count (int) – A counter for counting instantiations.
parameter (dict) – A dictionary with all settings for the current computation.
meta (locan.analysis.metadata_analysis_pb2.AMetadata) – Metadata about the current analysis routine.
results (pandas.DataFrame) – Computed results.
Methods
__init__([meta])compute(locdata[, other_locdata])Run the computation.
hist([ax, bins, density])Provide histogram of all pairwise distances.
report(*args, **kwargs)Show a report about analysis results.
Attributes
A counter for counting Analysis class instantiations (class attribute).
-
count:
int= 0¶ A counter for counting Analysis class instantiations (class attribute).
- hist(ax=None, bins='auto', density=True, **kwargs)[source]¶
Provide histogram of all pairwise distances.
- Parameters:
ax (
Axes|None) – The axes on which to show the image.bins (
Union[int,list[int|float],Literal['auto']]) – Bin specification as used inmatplotlib.hist()density (
bool) – Flag for normalization as used in matplotlib.hist. True returns probability density function; None returns counts.kwargs (
Any) – Other parameters passed tomatplotlib.hist().
- Returns:
Axes object with the plot.
- Return type:
matplotlib.axes.Axes