Conversation
cgueck895
force-pushed
the
weighted-anomaly-scores
branch
from
September 15, 2026 12:46
04fc675 to
90172c7
Compare
Contributor
|
Shouldn't the |
added 2 commits
September 16, 2026 15:30
…precated pca-based mahalanobis_score. Also added documentation on anomaly scores
Loading a FaultDetector reconstructs each sub-model with no constructor arguments, which previously raised a TypeError for the weighted_rmse score because feature_weights was a required parameter. Default it to None and add unit tests covering the FaultDetector save/load round-trip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
WeightedRMSEScoreanomaly score (weighted_rmse) that applies per-feature weights tostandardized reconstruction errors before computing the RMSE, enabling feature-specific
importance in anomaly detection.
RMSEScore.standardize()andMahalanobisScore.standardize()helper methods, extractedfrom the respective
transform()methods, to share the standardization logic.covariance_methodparameter onMahalanobisScore("auto"|"min_cov_det"|"shrinkage"), with support for full-dimensionality (non-PCA) Mahalanobis norm computation onmean-centred reconstruction errors.
min_cov_det_ratio(default2.0) andshrinkage_method("oas"|"ledoit_wolf")parameters to control the automatic covariance-estimator selection.
docs/anomaly_scores.rstexplaining the available anomaly scores andwhen to use which, recommending RMSE as the default (linked from
docs/index.rst).Changed
MahalanobisScorenow always standardizes reconstruction errors before applying PCA andthe Minimum Covariance Determinant (MinCovDet) estimation (previously only when
scale=True).RMSEScorereconstruction errors are always standardized (behavior unchanged from before).MahalanobisScoredefault clean path (pca=False) withcovariance_method="auto"now usesMinCovDet only when it is stable (n/p >=
min_cov_det_ratioand the covariance is full-rank andwell-conditioned); otherwise it falls back to a shrinkage estimator (Ledoit-Wolf/OAS), keeping
the score stable for low sample-to-feature ratios and collinear/high-dimensional features.
Deprecated
RMSEScore(scale=...)andMahalanobisScore(scale=...): thescaleparameter no longer hasany effect and is accepted only for backwards compatibility. Passing it now emits a
DeprecationWarning. It will be removed in a future release; omit it (standardization isalways applied).
MahalanobisScore(pca=True): the PCA-based path is deprecated and will be replaced by the cleanfull-dimensionality Mahalanobis norm implementation. Use
pca=False(withcovariance_methodfor covariance-estimator control) instead.
Removed
anomaly_score.params.scalekey from the advanced configuration example(
docs/examples/advanced_config.yaml) forrmse(andscalefrom themahalanobisexamplein the class docstrings).