Practical overview
When it fits
Use PyNomaly when observations should be assessed against their local neighborhoods and a normalized 0–1 LoOP score is useful for downstream review or analysis.
Who it is for
- Python data analysts who need local-density outlier scores for records or observations.
- Teams that want to rank samples for anomaly review or use scores as an input signal in a data-analysis pipeline.
Documented uses
- Calculate a normalized outlier score for each row of a two-dimensional dataset.
- Rank observations by their local deviation from neighboring samples.
- Calculate scores relative to assigned clusters when data contains regions with different densities.
Requirements & limits
The project README provides pip and conda-forge installation commands and identifies the implementation as Apache 2.0 licensed.
- The method relies on nearest-neighbor distances, and its results depend on neighborhood size and the extent parameter.
- Feature normalization may be appropriate when dimensions have different scales.
- Missing values must be handled before scoring.
- Cluster labels can make local comparisons within clusters when the dataset contains regions of varying density.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install PyNomaly and calculate LoOP scores
Install the library, fit its LocalOutlierProbability model to a two-dimensional dataset, and retrieve sample scores.
Before you start
- Python 3.8–3.14
- A two-dimensional NumPy array or Pandas DataFrame without missing values
- NumPy and python-utils; Numba and SciPy are optional dependencies
Steps
Install with the command below or
conda install conda-forge::pynomaly.pip install PyNomalyImport
loopfromPyNomalyand create a model withloop.LocalOutlierProbability(data).fit().Read the scores from
m.local_outlier_probabilities.
Expected outcome
A LoOP score in the range 0–1 for each sample, interpretable as an outlier probability.
Guide limitations
- Handle missing values before using the library.
- Normalize data when feature scales differ, especially for multidimensional inputs.
- The documented defaults are extent 3 and 10 neighbors; the number of neighbors must be greater than zero.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 20 November 2026
- Original website title
- vc1492a/PyNomaly · Official homepage title · retained in its source language

