detectors.aggregations package

Submodules

detectors.aggregations.anomaly module

class detectors.aggregations.anomaly.AnomalyBaseAggregation(method_class, **kwargs)[source]

Bases: object

fit(stack: Tensor, *args, **kwargs)[source]
class detectors.aggregations.anomaly.IFAggregation(n_estimators=100, **kwargs)[source]

Bases: AnomalyBaseAggregation

class detectors.aggregations.anomaly.LOFAggregation(n_neighbors: int = 20, p=2, **kwargs)[source]

Bases: AnomalyBaseAggregation

detectors.aggregations.basics module

detectors.aggregations.basics.avg_topk_aggregation(x: Tensor, k: int, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.depth_weighted_sum(x: Tensor, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.layer_idx(x: Tensor, layer_idx: int = -1, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.max_aggregation(x: Tensor, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.mean_aggregation(x: Tensor, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.median_aggregation(x: Tensor, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.min_aggregation(x: Tensor, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.none_aggregation(x: Tensor, *args, **kwargs) Tensor[source]
detectors.aggregations.basics.topk_aggregation(x: Tensor, k: int, *args, **kwargs) Tensor[source]

detectors.aggregations.cosine module

class detectors.aggregations.cosine.CosineAggregation(*args, **kwargs)[source]

Bases: object

fit(stack: Tensor, *args, **kwargs)[source]

detectors.aggregations.innerprod module

class detectors.aggregations.innerprod.InnerProductAggregation(*args, **kwargs)[source]

Bases: object

fit(stack: Tensor, *args, **kwargs)[source]

detectors.aggregations.mahalanobis module

class detectors.aggregations.mahalanobis.MahalanobisAggregation(*args, **kwargs)[source]

Bases: object

fit(stack: Tensor, *args, **kwargs)[source]
detectors.aggregations.mahalanobis.mahalanobis_distance_inv_fast(x: Tensor, y: Tensor, precision: Tensor)[source]

Mahalanobis distance betwee x and y with an accelerated implementation.

Parameters:
  • x (Tensor) – first point.

  • y (Tensor) – second point.

  • precision (Tensor) – inverse of the covariance matrix.

detectors.aggregations.quantile module

class detectors.aggregations.quantile.QuantileAggregation[source]

Bases: object

fit(stack: Tensor, *args, **kwargs)[source]

detectors.aggregations.supervised module

class detectors.aggregations.supervised.WeightRegression(verbose=False, ignore_dim=0, split_size=1000, regressor=<class 'sklearn.linear_model._logistic.LogisticRegressionCV'>, recall_level=0.95, seed=0)[source]

Bases: object

scoring_obj(y_true, y_pred)[source]
split_data(data_in, data_out)[source]

Module contents

class detectors.aggregations.Aggregation(aggregation_method, *args, **kwargs)[source]

Bases: object

Aggregation wrapper class.

fit(stack: Tensor, *args, **kwargs)[source]
detectors.aggregations.create_aggregation(aggregation_name: str, **kwargs) Aggregation[source]
detectors.aggregations.list_aggregations() list[source]
detectors.aggregations.register_aggregation(name: str)[source]

Decorator to register a new aggregation method.